From e9fecf4bc5e1d4b792e06bcecdd9150d18a4b71b Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Wed, 7 Dec 2022 12:13:57 +0100 Subject: [PATCH] Experiment adding a dynamic canonical URL to mkdocs --- .readthedocs.yaml | 8 ++++++++ mkdocs.yml | 1 + 2 files changed, 9 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d9222bb..c0e2542 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,8 +11,16 @@ version: 2 # tools: # python: "3.10" +# This pattern will be supported by a better environment variable, proposed +# here: TBD +build: + jobs: + pre_build: + - export "MKDOCS_SITE_URL=$READTHEDOCS_PROJECT" + mkdocs: configuration: mkdocs.yml + fail_on_warning: true # Optionally declare the Python requirements required to build your docs python: diff --git a/mkdocs.yml b/mkdocs.yml index 2a5a12e..0e94b62 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,5 @@ site_name: Basic MkDocs Example Project +site_url: !ENV MKDOCS_SITE_URL theme: name: readthedocs highlightjs: true