From fa7f330ab3c785761dae52d94498152eb50aec83 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 09:07:49 -0400 Subject: [PATCH] docs: fix 404 styling (#18094) (#18105) * docs: fix 404 styling * hack around custom tag destruction --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --- hack/gen-docs/main.go | 6 ++++++ mkdocs.yml | 1 + 2 files changed, 7 insertions(+) diff --git a/hack/gen-docs/main.go b/hack/gen-docs/main.go index b076224a0aaee..f102f4c1d7e89 100644 --- a/hack/gen-docs/main.go +++ b/hack/gen-docs/main.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "fmt" "log" "os" @@ -64,6 +65,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 d4c206a01c4d1..7da6ca1db0a41 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -221,6 +221,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