diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 1b908f8..dbc3e8f 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -44,7 +44,8 @@ jobs: cargo +${RUST_VERSION} install --locked cargo-about - name: Generate Docs run: | - cd ./docs && myst build --html && cd ../ + cd ./docs && myst build --html --ci --port 3042 && cd ../ + export URL="https://taco-mc.dev" && ./scripts/replace-urls.sh mkdir -p ./public && mv ./docs/_build/html/* ./public/ cargo doc --no-deps --document-private-items --workspace mkdir -p ./public/dev-docs && mv ./target/doc/* ./public/dev-docs/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 95734e3..6d09972 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## [Unreleased] +### Fixed + +- replaced `localhost` reference in `sitemap.xml` and `robots.txt` (#1) + ## [v0.1.0] ### Added diff --git a/docs/myst.yml b/docs/myst.yml index df8143b..c81a4b7 100644 --- a/docs/myst.yml +++ b/docs/myst.yml @@ -27,6 +27,8 @@ project: license: code: "Apache-2.0" content: "CC-BY-4.0" + github: "https://github.com/cispa/TACO" + source_url: "https://github.com/cispa/TACO/tree/main/docs" bibliography: ./references.bib copyright: "2026 - The TACO contributors" abbreviations: @@ -52,6 +54,27 @@ project: - file: ./usage-cli/tla-specification.md - file: ./usage-cli/advanced-configuration.md - file: dev-docs.md + children: + - url: https://taco-mc.dev/dev-docs/taco_interval_ta/index.html + title: taco-interval-ta + - url: https://taco-mc.dev/dev-docs/taco_threshold_automaton/index.html + title: taco-threshold-automaton + - url: https://taco-mc.dev/dev-docs/taco_model_checker/index.html + title: taco-model-checker + - url: https://taco-mc.dev/dev-docs/taco_smt_model_checker/index.html + title: taco-smt-model-checker + - url: https://taco-mc.dev/dev-docs/taco_zcs_model_checker/index.html + title: taco-zcs-model-checker + - url: https://taco-mc.dev/dev-docs/taco_acs_model_checker/index.html + title: taco-acs-model-checker + - url: https://taco-mc.dev/dev-docs/taco_bdd/index.html + title: taco-bdd + - url: https://taco-mc.dev/dev-docs/taco_cli/index.html + title: taco-cli + - url: https://taco-mc.dev/dev-docs/taco_display_utils/index.html + title: taco-display-utils + - url: https://taco-mc.dev/dev-docs/taco_smt_encoder/index.html + title: taco-smt-encoder - file: about.md plugins: - ./resources/tla-highlighter.mjs diff --git a/scripts/replace-urls.sh b/scripts/replace-urls.sh new file mode 100755 index 0000000..562cf4d --- /dev/null +++ b/scripts/replace-urls.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Replaces occurrences of http://localhost:3042 with the value of the URL +# environment variable in the _build folder. This is necessary for sitemap.xml +# and robots.txt to be valid when the site is generated in the CI and deployed +# via GitHub actions. + +# Strict mode with error reporting +set -euo pipefail + +if [ -z "$URL" ]; then + echo "Error: URL environment variable is not set." + echo "Usage: URL=\"https://your-domain.com\" $0" + exit 1 +fi + +# Determine target directory +TARGET_DIR="" +if [ -d "docs/_build" ]; then + TARGET_DIR="docs/_build" +elif [ -d "_build" ]; then + TARGET_DIR="_build" +else + echo "Error: Could not find 'docs/_build' or '_build' directory." + exit 1 +fi + +echo "Target directory: $TARGET_DIR" +echo "Replacing 'http://localhost:3042' with '$URL'..." + +# Find files containing the string and replace them +# grep -r: recursive +# grep -l: print filename only +# xargs -r: do not run if no input +grep -rl "http://localhost:3042" "$TARGET_DIR" | xargs -r sed -i "s|http://localhost:3042|$URL|g" + +echo "Done."