Skip to content

Commit 8cb5f46

Browse files
committed
Adds an example pattern for canonical URLs.
1 parent 44c7cc6 commit 8cb5f46

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

.readthedocs.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ version: 2
1010
# os: ubuntu-22.04
1111
# tools:
1212
# python: "3.10"
13-
14-
# This pattern will be supported by a better environment variable, proposed
15-
# here: TBD
16-
build:
17-
os: ubuntu-22.04
18-
tools:
19-
python: "3.10"
20-
jobs:
21-
pre_build:
22-
- export "MKDOCS_SITE_URL=$READTHEDOCS_PROJECT"
2313

2414
mkdocs:
2515
configuration: mkdocs.yml

mkdocs.yml

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

0 commit comments

Comments
 (0)