File tree Expand file tree Collapse file tree 3 files changed +60
-9
lines changed
Expand file tree Collapse file tree 3 files changed +60
-9
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy MkDocs to GitHub Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - ' docs/**'
9+ - ' mkdocs.yml'
10+ - ' README.md'
11+ - ' .github/workflows/deploy-docs.yml'
12+
13+ permissions :
14+ contents : write
15+ pages : write
16+ id-token : write
17+
18+ jobs :
19+ deploy :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v4
24+
25+ - name : Set up Python
26+ uses : actions/setup-python@v5
27+ with :
28+ python-version : ' 3.12'
29+
30+ - name : Install uv
31+ uses : astral-sh/setup-uv@v3
32+
33+ - name : Install dependencies
34+ run : |
35+ uv venv
36+ source .venv/bin/activate
37+ uv pip install -e .
38+
39+ - name : Install Cairo dependencies (for social cards)
40+ run : |
41+ sudo apt-get update
42+ sudo apt-get install -y libcairo2-dev libpango1.0-dev
43+
44+ - name : Build and deploy docs
45+ run : |
46+ source .venv/bin/activate
47+ uv run mkdocs gh-deploy --force
Original file line number Diff line number Diff line change 22Script to manually add the Pioneers Hub logo to the social cards of website.
33This is not supported by the open version of mkdocs-material, yet.
44"""
5+
56from pathlib import Path
67
78from PIL import Image
@@ -17,12 +18,12 @@ def on_post_build(config):
1718 the_logo_position = (960 , 450 )
1819 base_width = 175
1920 ph_logo = Image .open (path_to_logo )
20- w_percent = ( base_width / ph_logo .size [0 ])
21+ w_percent = base_width / ph_logo .size [0 ]
2122 h_size = int (float (ph_logo .size [1 ]) * float (w_percent ))
2223 ph_logo = ph_logo .resize ((base_width , h_size ), Image .Resampling .LANCZOS )
23- for k , dir_from_project_root in xtra ["social_cards" ]["dirs" ].items ():
24+ for _ , dir_from_project_root in xtra ["social_cards" ]["dirs" ].items ():
2425 read_dir = root / dir_from_project_root
25- for social_card in read_dir .glob (' *.png' ):
26+ for social_card in read_dir .glob (" *.png" ):
2627 # Get the social card image
2728 social_card_image = Image .open (social_card )
2829 # Paste the Pioneers Hub logo onto the social card image
Original file line number Diff line number Diff line change 1- """ Alter config on run
2- https://www.mkdocs.org/user-guide/configuration/#hooks
3- """
1+ """Alter config on run
2+ https://www.mkdocs.org/user-guide/configuration/#hooks
3+ """
4+
45from datetime import datetime
56
67
7- def on_config (config , ** kwargs ):
8+ def on_config (config , ** kwargs ): # noqa ARG001
89 config .copyright = f"Copyright © { datetime .now ().year } Your Name"
9- config .copyright = (f'Copyright © 2024{ "-" + str (datetime .now ().year ) if datetime .now ().year > 2024 else "" } Pioneers Hub gGmbH – '
10- f'<a href="#__consent">Change cookie settings</a>' )
10+ config .copyright = (
11+ f"Copyright © 2024{ '-' + str (datetime .now ().year ) if datetime .now ().year > 2024 else '' } Pioneers Hub gGmbH – " # noqa: PLR2004
12+ f'<a href="#__consent">Change cookie settings</a>'
13+ )
You can’t perform that action at this time.
0 commit comments