From 9210b263169e39bd0b79a5dd3365a17258f471ed Mon Sep 17 00:00:00 2001 From: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Date: Tue, 7 May 2024 13:07:15 +0000 Subject: [PATCH] docs: fix 404 styling (#18094) * docs: fix 404 styling Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * hack around custom tag destruction Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-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 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