Skip to content

Commit e1f71f0

Browse files
committed
Support Cloud Docs Preview and local build
1 parent 8310405 commit e1f71f0

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

README.adoc

+53-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,56 @@ This repository only contains the source files for the published documentation.
66
To view the published version, see link:https://docs.tigergraph.com/cloud[TigerGraph Cloud Documentation].
77

88
== Contribution
9-
For instructions on how to contribute to this repository, see link:https://github.com/tigergraph/doc-site/blob/main/contribution.adoc[Contribution guidelines].
9+
For instructions on how to contribute to this repository, see link:https://github.com/tigergraph/doc-site/blob/main/contribution.adoc[Contribution guidelines].
10+
11+
== Install dependencies
12+
To install dependencies, navigate to this repository and run:
13+
[,console]
14+
----
15+
npm install
16+
----
17+
18+
== Build site locally
19+
To build the site locally, run:
20+
[,console]
21+
----
22+
npm run build
23+
----
24+
The build will be available in the `build/` folder in the root directory.
25+
26+
IMPORTANT: Though the files are all in the `/build` folder, you won't be able to access other pages through the links if the files are not served by a server.
27+
To preview locally, you can <<Run a local server to view the build>>. If you really don't want to use a local server, edit the `antora-playbook.yml` file in your local environment, and change the `html_extension_style` under `urls` to `default`. This allows you to open the static files and have the links work.
28+
29+
=== Build from your local content source repository
30+
To have Antora build the site from your local content source repository, change the corresponding content source in the file `antora-playbook.yml` to point to your local git repository.
31+
32+
See https://docs.antora.org/antora/2.3/playbook/content-source-url/#local-urls[Use local content repositories] on Antora's documentation.
33+
34+
== Watch Mode
35+
36+
Watch Mode launches a local web server for preview. It will continue watching your local content source repository changes and rebuild the site.
37+
38+
[,console]
39+
----
40+
npm run dev
41+
----
42+
43+
You can access the web server at http://localhost:5000[http://localhost:5000].
44+
45+
== Run a local server to view the build
46+
47+
To open the build, run:
48+
[,console]
49+
----
50+
$ npm i -g http-server
51+
$ http-server build/site -c-1
52+
----
53+
Upon launching the command, the local address of the web server will be displayed in your terminal. You should see the following output in your terminal:
54+
55+
----
56+
Starting up http-server, serving build/site
57+
Available on:
58+
http://127.0.0.1:8080
59+
http://192.168.1.8:8080
60+
Hit CTRL-C to stop the server
61+
----

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
87
"build": "antora generate --fetch antora-playbook.yml",
98
"dev": "gulp",
109
"serve": "http-server build/site -c-1"

0 commit comments

Comments
 (0)