diff --git a/hack/gen-docs/main.go b/hack/gen-docs/main.go index 180b02fffec4f..9d8a16eb59844 100644 --- a/hack/gen-docs/main.go +++ b/hack/gen-docs/main.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "fmt" "log" "os" @@ -61,6 +62,11 @@ func updateMkDocsNav(parent string, child string, subchild string, files []strin if err != nil { return err } + + // The marshaller drops custom tags, so re-add this one. Turns out this is much less invasive than trying to handle + // it at the YAML parser level. + newmkdocs = bytes.Replace(newmkdocs, []byte("site_url: READTHEDOCS_CANONICAL_URL"), []byte("site_url: !ENV READTHEDOCS_CANONICAL_URL"), 1) + return os.WriteFile("mkdocs.yml", newmkdocs, 0644) } diff --git a/mkdocs.yml b/mkdocs.yml index bdfdb322672bb..859bcc27adfb9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -213,6 +213,7 @@ nav: - Blog ⧉: https://blog.argoproj.io/ repo_url: https://github.com/argoproj/argo-cd site_name: Argo CD - Declarative GitOps CD for Kubernetes +site_url: !ENV READTHEDOCS_CANONICAL_URL strict: true theme: custom_dir: overrides