Skip to content

Commit d8308f4

Browse files
authored
update(chore): adapte la config et l'outillage maintenant que la version gratuite est équivalente (#1364)
See: https://squidfunk.github.io/mkdocs-material/blog/2025/11/11/insiders-now-free-for-everyone/
2 parents 7459aaa + 88cf2e6 commit d8308f4

13 files changed

+93
-545
lines changed

.github/labeler.yml

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,80 @@
11
articles:
2-
- changed-files:
3-
- any-glob-to-any-file:
4-
- content/articles/**/*.md
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- content/articles/**/*.md
55

66
contenus communs:
7-
- changed-files:
8-
- any-glob-to-any-file:
9-
- content/*.md
10-
- content/newsletter/*.md
11-
- content/toc_nav_ignored/**
12-
- head-branch:
13-
- common
7+
- changed-files:
8+
- any-glob-to-any-file:
9+
- content/*.md
10+
- content/newsletter/*.md
11+
- content/toc_nav_ignored/**
12+
- head-branch:
13+
- common
1414

1515
contributeurices:
16-
- changed-files:
17-
- any-glob-to-any-file:
18-
- content/team/**/*.md
16+
- changed-files:
17+
- any-glob-to-any-file:
18+
- content/team/**/*.md
1919

2020
dependencies:
21-
- changed-files:
22-
- any-glob-to-any-file:
23-
- requirements/*.txt
24-
- requirements.txt
21+
- changed-files:
22+
- any-glob-to-any-file:
23+
- requirements/*.txt
24+
- requirements.txt
2525

2626
enhancement:
27-
- head-branch:
28-
- ^feature
29-
- feature
30-
- ^improve
31-
- improve
27+
- head-branch:
28+
- ^feature
29+
- feature
30+
- ^improve
31+
- improve
3232

3333
mkdocs:
34-
- changed-files:
35-
- any-glob-to-any-file:
36-
- config/**
37-
- content/**/*.pages
38-
- hooks/**
39-
- mkdocs*.yml
34+
- changed-files:
35+
- any-glob-to-any-file:
36+
- config/**
37+
- content/**/*.pages
38+
- hooks/**
39+
- mkdocs*.yml
4040

4141
rdp:
42-
- changed-files:
43-
- any-glob-to-any-file:
44-
- content/rdp/**/*.md
45-
- head-branch:
46-
- ^rdp
47-
- rdp
42+
- changed-files:
43+
- any-glob-to-any-file:
44+
- content/rdp/**/*.md
45+
- head-branch:
46+
- ^rdp
47+
- rdp
4848

4949
thème:
50-
- changed-files:
51-
- any-glob-to-any-file:
52-
- content/theme/**/*
53-
- requirements-insiders.txt
54-
- head-branch:
55-
- theme
56-
- ^theme
50+
- changed-files:
51+
- any-glob-to-any-file:
52+
- content/theme/**/*
53+
- head-branch:
54+
- theme
55+
- ^theme
5756

5857
tipex:
59-
- head-branch:
60-
- tipex
61-
- ^tipex
58+
- head-branch:
59+
- tipex
60+
- ^tipex
6261

6362
outillage:
64-
- changed-files:
65-
- any-glob-to-any-file:
66-
- .devcontainer/**
67-
- .github/**
68-
- .pre-commit-config.yaml
69-
- .vscode/**/*
70-
- .docker
71-
- .lincheckrrc
72-
- .mailmap
73-
- .markdownlint*
74-
- docker*
75-
- Dockerfile
76-
- scripts/**
77-
- head-branch:
78-
- ^ci
79-
- ci
80-
- ^tooling
81-
- tooling
63+
- changed-files:
64+
- any-glob-to-any-file:
65+
- .devcontainer/**
66+
- .github/**
67+
- .pre-commit-config.yaml
68+
- .vscode/**/*
69+
- .docker
70+
- .lincheckrrc
71+
- .mailmap
72+
- .markdownlint*
73+
- docker*
74+
- Dockerfile
75+
- scripts/**
76+
- head-branch:
77+
- ^ci
78+
- ci
79+
- ^tooling
80+
- tooling

.github/workflows/deploy.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ jobs:
5050
cache: "pip"
5151

5252
- name: Install dependencies
53-
env:
54-
GH_TOKEN_MATERIAL_INSIDERS: ${{ secrets.GH_TOKEN_MATERIAL_INSIDERS }}
5553
run: |
5654
python -m pip install --upgrade pip setuptools wheel
57-
python -m pip install --upgrade -r requirements-insiders.txt
55+
python -m pip install --upgrade -r requirements.txt
5856
5957
- name: Cache build dependencies (external assets downloaded)
6058
uses: actions/cache@v4

.github/workflows/links_checker.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ jobs:
3131
cache: "pip"
3232

3333
- name: Install dependencies
34-
env:
35-
GH_TOKEN_MATERIAL_INSIDERS: ${{ secrets.GH_TOKEN_MATERIAL_INSIDERS }}
3634
run: |
3735
python -m pip install --upgrade pip setuptools wheel
38-
python -m pip install --upgrade -r requirements-insiders.txt
36+
python -m pip install --upgrade -r requirements.txt
3937
python -m pip install --upgrade "LinkChecker>=10,<11"
4038
4139
- name: Build static website

.github/workflows/pr_checker_build.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,9 @@ jobs:
4141

4242
- name: Install dependencies
4343
id: dependencies
44-
env:
45-
GH_TOKEN_MATERIAL_INSIDERS: ${{ secrets.GH_TOKEN_MATERIAL_INSIDERS }}
4644
run: |
4745
python -m pip install -U pip setuptools wheel
48-
49-
# if secret (PR created by repo collaborator) exists = paid features, else only free
50-
if [[ -z "${GH_TOKEN_MATERIAL_INSIDERS}" ]]; then
51-
echo "::warning:: L'accès aux token est réservé aux comptes avec droits d'écriture sur le dépôt. La version gratuite du thème est donc utilisée sans mots-clés, etc.)"
52-
python -m pip install -U -r requirements-free.txt
53-
echo "MKDOCS_CONFIG_FILENAME=mkdocs-free.yml" >> $GITHUB_ENV
54-
else
55-
# install insiders version using token
56-
python -m pip install -U -r requirements-insiders.txt
57-
echo "MKDOCS_CONFIG_FILENAME=mkdocs.yml" >> $GITHUB_ENV
58-
fi
46+
python -m pip install -U -r requirements.txt
5947
6048
- name: Cache build dependencies (external assets downloaded)
6149
uses: actions/cache@v4
@@ -77,13 +65,13 @@ jobs:
7765
export MKDOCS_SITE_URL="https://${NETLIFY_SITE_PREFIX}--${NETLIFY_SITE_NAME}.netlify.app/"
7866
7967
# merge different configs
80-
python scripts/100_mkdocs_config_merger.py -c ${{ env.MKDOCS_CONFIG_FILENAME }}
68+
python scripts/100_mkdocs_config_merger.py
8169
8270
# build
83-
mkdocs build --config-file ${{ env.MKDOCS_CONFIG_FILENAME }} --strict
71+
mkdocs build --strict
8472
8573
# save mkdocs.yml for debug
86-
cp ${{ env.MKDOCS_CONFIG_FILENAME }} ${{ env.BUILD_DIR }}
74+
cp mkdocs.yml ${{ env.BUILD_DIR }}
8775
8876
# remove files reserved for production
8977
rm ${{ env.BUILD_DIR }}/CNAME

README.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Sources et contenus du site de Geotribu, accessible via les URLs suivantes :
2424
2525
### Prérequis
2626

27-
- Python >= 3.9
27+
- Python >= 3.12
2828

2929
#### Recommandés
3030

@@ -39,19 +39,8 @@ python -m pip install -U pip
3939
python -m pip install -U setuptools wheel
4040
```
4141

42-
### Version gratuite
43-
4442
```bash
45-
python -m pip install -U -r requirements-free.txt
46-
```
47-
48-
#### Version Insiders
49-
50-
Pour utiliser la [version Insiders du thème Material for Mkdocs](https://squidfunk.github.io/mkdocs-material/insiders/), il faut disposer du *token* lié au compte GitHub de Geotribu :
51-
52-
```bash
53-
export GH_TOKEN_MATERIAL_INSIDERS=************
54-
python -m pip install -U -r requirements-insiders.txt
43+
python -m pip install -U -r requirements.txt
5544
```
5645

5746
### Générer le site
@@ -62,12 +51,6 @@ Version complète :
6251
mkdocs build
6352
```
6453

65-
Version complète gratuite :
66-
67-
```bash
68-
mkdocs build -f mkdocs-free.yml
69-
```
70-
7154
Version minimale (seulement certains plugins) :
7255

7356
```bash
@@ -82,12 +65,6 @@ Version complète :
8265
mkdocs serve --dirtyreload
8366
```
8467

85-
Version complète gratuite :
86-
87-
```bash
88-
mkdocs serve -f mkdocs-free.yml --dirtyreload
89-
```
90-
9168
Version minimale (seulement certains plugins) :
9269

9370
```bash
@@ -115,4 +92,4 @@ L'objectif de ce financement est de :
11592
- financer les outils open-source que l'on utilise pour le site :
11693
- Material for MkDocs (voir la page sponsor <https://github.com/sponsors/squidfunk>)
11794
- GeoRezo (pour le CDN)
118-
- financer les suffixes du nom de domaine (geotribu.fr/.net/.org)
95+
- financer le nom de domaine (geotribu.fr/.net/.org)

config/plugins_git-committers.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ git-committers:
1111
- pre-commit-ci[bot]
1212
- web-flow
1313
repository: geotribu/website
14-
token:
15-
!ENV ["MKDOCS_GIT_COMMITTERS_APIKEY", !ENV ["GH_TOKEN_MATERIAL_INSIDERS"]]
14+
token: !ENV ["MKDOCS_GIT_COMMITTERS_APIKEY"]

hooks/mkdocs/G000_load_subconfigs.py

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
# standard library
88
import logging
99
from pathlib import Path
10-
from typing import Literal, Optional
10+
from typing import Literal
1111

1212
# 3rd party
1313
import mkdocs.plugins
14-
from material import __version__ as material_version
1514
from mkdocs.config.defaults import MkDocsConfig
1615
from mkdocs.structure.pages import Page
1716
from mkdocs.utils.meta import get_data
@@ -62,20 +61,6 @@ def get_latest_content(
6261
return output_contents_list
6362

6463

65-
def is_mkdocs_theme_material_insiders() -> Optional[bool]:
66-
"""Check if the material theme is community or insiders edition.
67-
68-
Returns:
69-
bool: True if the theme is Insiders edition. False if community.
70-
"""
71-
if material_version is not None and "insiders" in material_version:
72-
logger.debug(log_prefix + "Material theme edition INSIDERS")
73-
return True
74-
else:
75-
logger.debug(log_prefix + "Material theme edition COMMUNITY")
76-
return False
77-
78-
7964
# ###########################################################################
8065
# ########## Hooks #################
8166
# ##################################
@@ -99,28 +84,9 @@ def on_config(config: MkDocsConfig) -> MkDocsConfig:
9984
config_filename = Path(config.get("config_file_path")).name
10085
if config_filename == "mkdocs.yml":
10186
config["extra"]["website_flavor"] = "insiders"
102-
elif config_filename == "mkdocs-free.yml":
103-
config["extra"]["website_flavor"] = "community"
10487
else:
10588
config["extra"]["website_flavor"] = "minimal"
10689

107-
# check if insiders version is installed
108-
if (
109-
config["extra"]["website_flavor"] == "insiders"
110-
and not is_mkdocs_theme_material_insiders()
111-
):
112-
logger.warning(
113-
log_prefix
114-
+ f"Le fichier {config.get('config_file_path')} contient des paramètres ou "
115-
"plugins uniquement disponibles dans la version Insiders (payante) du thème "
116-
"Material. Or c'est la version community (gratuite) qui est installée "
117-
f"({material_version}). La génération va probablement échouer. Deux solutions :"
118-
"A. Installer la version Insiders (requiert un jeton GitHub). "
119-
"B. Utiliser la configuration basée sur la version communautaire (gratuite), "
120-
"par exemple : 'mkdocs build -f mkdocs-free.yml'"
121-
)
122-
config["extra"]["website_flavor"] = "community"
123-
12490
logger.info(
12591
log_prefix + f"Génération du site {config.get('site_name')} "
12692
f"en version {config.get('extra').get('website_flavor').upper()}"

0 commit comments

Comments
 (0)