Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/docs/check_deployed_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# and the sitemap's first URL lies under the site and loads too.
#
# Usage: check_deployed_site.sh <site>
# site the site's address, e.g. https://dronecode.github.io/mavlink-military/
# site the site's address, e.g. https://mavlink-m.dronecode.org/
#
# Environment: CHECK_RETRIES (default 5) and CHECK_RETRY_DELAY in seconds
# (default 10) set how often curl retries each request, since the CDN can lag
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ permissions:
contents: read

env:
# Project Pages URL until the custom domain is live. When it is: add
# docs/public/CNAME, set the domain in Settings > Pages, remove DOCS_BASE,
# and point DOCS_HOSTNAME at the new domain.
DOCS_BASE: /mavlink-military/
DOCS_HOSTNAME: https://dronecode.github.io/mavlink-military
# Served at the root of the custom domain set in Settings > Pages; an
# Actions deploy ignores a CNAME file. A fork served from
# https://<owner>.github.io/<repo>/ sets DOCS_BASE to /<repo>/ and
# DOCS_HOSTNAME to that address.
DOCS_BASE: /
DOCS_HOSTNAME: https://mavlink-m.dronecode.org

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAVLink-M

**Documentation and message reference: https://dronecode.github.io/mavlink-military/**
**Documentation and message reference: https://mavlink-m.dronecode.org/**

MAVLink-M is an open dialect of [MAVLink 2](https://mavlink.io) for
coordination and situational-awareness messaging between uncrewed platforms and
Expand Down
7 changes: 3 additions & 4 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { defineConfig } from "vitepress";
import { sidebar } from "./get_sidebar.js";

// Served from https://dronecode.github.io/mavlink-military/ until the project
// domain is live. CI sets DOCS_BASE and DOCS_HOSTNAME; once the custom domain
// is configured, drop DOCS_BASE (defaults to "/") and point DOCS_HOSTNAME at it.
// Served at the root of https://mavlink-m.dronecode.org/. CI sets DOCS_BASE and
// DOCS_HOSTNAME (docs.yml); the defaults build for the same place.
const base = process.env.DOCS_BASE || "/";
// The sitemap resolves each page against the hostname, which drops the last
// path segment unless the hostname ends in a slash.
const hostname = (process.env.DOCS_HOSTNAME || "https://dronecode.github.io/mavlink-military").replace(/\/?$/, "/");
const hostname = (process.env.DOCS_HOSTNAME || "https://mavlink-m.dronecode.org").replace(/\/?$/, "/");
const repo = "https://github.com/Dronecode/mavlink-military";

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/check_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main(argv: list[str]) -> int:
dist = Path(argv[1]) if len(argv) > 1 else DIST
base = slash("/" + os.environ.get("DOCS_BASE", "/").strip("/"))
hostname = slash(
os.environ.get("DOCS_HOSTNAME", "https://dronecode.github.io/mavlink-military")
os.environ.get("DOCS_HOSTNAME", "https://mavlink-m.dronecode.org")
)
if not (dist / "index.html").is_file():
print(f"ERROR: no built site in {dist}; run npm run docs:build first", file=sys.stderr)
Expand Down
4 changes: 2 additions & 2 deletions docs/scripts/tests/test_check_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def test_site_at_the_root_of_a_domain(self) -> None:
self.assertEqual(status, 0, out)

def test_defaults_match_the_vitepress_config(self) -> None:
# Without the variables, config.mjs builds for "/" on the Pages hostname.
# Without the variables, config.mjs builds for "/" on the project domain.
self.write("index.html", page('<a href="/en/">Docs</a>'))
self.sitemap("en/", host="https://dronecode.github.io/mavlink-military")
self.sitemap("en/", host="https://mavlink-m.dronecode.org")
status, out, _ = self.check({"DOCS_BASE": None, "DOCS_HOSTNAME": None})
self.assertEqual(status, 0, out)

Expand Down
Loading