Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Demicev <[email protected]>
  • Loading branch information
alexander-demicev committed Jan 17, 2025
1 parent a515e36 commit 430f718
Showing 1 changed file with 61 additions and 17 deletions.
78 changes: 61 additions & 17 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Run the git command to clone this repository.

[,console]
----
git clone https://github.com/rancher/turtles-product-docs.git
git clone https://github.com/rancher/turtles-docs.git
----

[#install-node-modules]
Expand All @@ -53,40 +53,84 @@ Open a terminal at the root of the git repository. Run the command below.
npm install
----

[#run-antora-to-build-the-static-website]
=== Run Antora to build the static website
[#build-the-static-website]
=== Build the Static Website

As a local example, run the command below to build the site:
You can use the `make` command to build the documentation site locally or remotely. The Makefile defines various tasks for building the site using different playbooks.

### Build the site locally using the GitHub Pages playbook:

To build the site locally using the GitHub Pages playbook, run the following command:

[,console]
----
npx antora --fetch turtles-local-playbook.yml
make gh-pages
----

Navigate to the `./build/site` directory and open the index.html file in your browser to view and navigate the documentation site.
This will generate the static website using the `turtles-gh-pages-playbook.yml` playbook.

Alternatively, run the below command first and then open `+http://127.0.0.1:8080/+` in your browser for a web server preview:
### Build the site remotely:

To build the site remotely using the remote playbook, run:

[,console]
----
make preview
make remote
----

[#run-antora-to-build-the-static-website-using-the-local-documentation-content]
=== Run Antora to build the static website using the local documentation content
This will use the `playbook-remote.yml` to generate the site remotely.

### Build the site using the development playbook:

For development purposes, you can build the site using the development playbook by running:

[,console]
----
make dev
----

The command provided in the previous section fetches documentation content of the products from their respective remote GitHub repositories. If you want the playbook to use the documentation content from your local machine instead you can do so with `product-docs-playbook-local.yml`.
This will use the `turtles-dev-playbook.yml` to generate the site with development settings.

Clone all the individual product documentation Github repositories one level above the current playbook repository.
### Clean up the build:

As an example, run the command below to use the local `turtles-local-playbook.yml` file.
To remove the build and temporary directories, use the following command:

[,console]
----
npx antora --fetch turtles-local-playbook.yml
make clean
----

[#makefile]
=== Makefile
This will delete the `build` and `tmp` directories.

### Preview the site locally:

To preview the site locally, use the `preview` task:

[,console]
----
make preview
----

This will serve the site locally, allowing you to view it in your browser.

### Watch for changes and rebuild:

To watch for changes in the content and rebuild the site automatically, use the `watch` task:

[,console]
----
make watch
----

This will watch the content and documentation files for changes, rebuild the site, and preview it with hot reload.

### Continuous Integration (CI):

To run the build process for continuous integration, use the `ci` task:

[,console]
----
make ci
----

The Makefile can also be used to set up your environment, build the local and remote static site, and clean your build output directory.
This will run the build using the GitHub Pages playbook and the development playbook in sequence.

0 comments on commit 430f718

Please sign in to comment.