Skip to content

Commit 540e1dd

Browse files
authored
Add dark theme to docs and Blog (#13296)
1 parent 9458ec9 commit 540e1dd

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

bin/rtd-docs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ fi
1414
if [ "${READTHEDOCS_PROJECT}" = "docspypiorg" ]; then
1515
pip install -r requirements/docs/user.txt
1616
asdf reshim
17-
mkdocs build -f mkdocs-user-docs.yml
17+
mkdocs build -f docs/mkdocs-user-docs.yml
1818
mkdir _readthedocs && mv docs/user-site _readthedocs/html
1919
fi
2020

2121
if [ "${READTHEDOCS_PROJECT}" = "blogpypiorg" ]; then
2222
pip install -r requirements/docs/blog.txt
2323
asdf reshim
24-
mkdocs build -f docs/blog.yml
24+
mkdocs build -f docs/mkdocs-blog.yml
2525
mkdir _readthedocs && mv docs/blog-site _readthedocs/html
2626
fi

bin/user-docs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export LANG="${ENCODING:-en_US.UTF-8}"
1010
# Print all the following commands
1111
set -x
1212

13-
mkdocs build -f mkdocs-user-docs.yml
13+
mkdocs build -f docs/mkdocs-user-docs.yml

docs/blog.yml renamed to docs/mkdocs-blog.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ theme:
88
favicon: assets/favicon.ico
99
homepage: https://pypi.org
1010
custom_dir: blog/overrides
11+
palette:
12+
- scheme: default
13+
media: "(prefers-color-scheme: light)"
14+
toggle:
15+
icon: material/weather-night
16+
name: Switch to Dark mode
17+
- scheme: slate
18+
media: "(prefers-color-scheme: dark)"
19+
toggle:
20+
icon: material/weather-sunny
21+
name: Switch to Light mode
1122
markdown_extensions:
1223
- footnotes
1324
extra_css:

mkdocs-user-docs.yml renamed to docs/mkdocs-user-docs.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
site_name: PyPI Docs
2-
docs_dir: docs/user
3-
site_dir: docs/user-site
2+
docs_dir: user
3+
site_dir: user-site
44
plugins:
55
- macros:
6-
module_name: docs/user/main
6+
module_name: user/main
77
markdown_extensions:
88
- admonition
99
- pymdownx.details
@@ -16,6 +16,17 @@ theme:
1616
homepage: https://pypi.org
1717
features:
1818
- content.action.edit
19+
palette:
20+
- scheme: default
21+
media: "(prefers-color-scheme: light)"
22+
toggle:
23+
icon: material/weather-night
24+
name: Switch to Dark mode
25+
- scheme: slate
26+
media: "(prefers-color-scheme: dark)"
27+
toggle:
28+
icon: material/weather-sunny
29+
name: Switch to Light mode
1930
extra_css:
2031
- stylesheets/extra.css
2132
extra:

0 commit comments

Comments
 (0)