Skip to content

Commit

Permalink
Adds an example pattern for canonical URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming committed Dec 7, 2022
1 parent 44c7cc6 commit 8cb5f46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 0 additions & 10 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ version: 2
# os: ubuntu-22.04
# tools:
# python: "3.10"

# This pattern will be supported by a better environment variable, proposed
# here: TBD
build:
os: ubuntu-22.04
tools:
python: "3.10"
jobs:
pre_build:
- export "MKDOCS_SITE_URL=$READTHEDOCS_PROJECT"

mkdocs:
configuration: mkdocs.yml
Expand Down
6 changes: 5 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
site_name: Basic MkDocs Example Project
site_url: !ENV MKDOCS_SITE_URL
# Until https://github.com/readthedocs/readthedocs.org/issues/9781 is fixed, you need to
# define CUSTOM_CANONICAL_URL yourself as a workaround.
# (don't expose it to PRs, they build on different URLs)
# For instance, define it as https://SLUG.readthedocs.io/en/stable/
site_url: !ENV [READTHEDOCS_CANONICAL_URL, CUSTOM_CANONICAL_URL, ""]
theme:
name: readthedocs
highlightjs: true
Expand Down

0 comments on commit 8cb5f46

Please sign in to comment.