Skip to content

Commit 592d03b

Browse files
committed
chore: make docs copyright year automatic
1 parent e1d1994 commit 592d03b

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,4 @@ nb-configuration.xml
110110
/.phpunit.*.cache
111111

112112
/.php-cs-fixer.php
113+
/docs/assets/__pycache__/

docs/assets/hooks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from datetime import datetime
2+
3+
def on_config(config, **kwargs):
4+
config.copyright = config.copyright.format(year=datetime.now().year)
5+
return config

mkdocs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ extra:
5757
site_url: https://shield.codeigniter.com/
5858
repo_url: https://github.com/codeigniter4/shield
5959
edit_uri: edit/develop/docs/
60-
copyright: Copyright © 2023-2025 CodeIgniter Foundation.
60+
copyright: Copyright © 2022-{year} CodeIgniter Foundation.
61+
62+
hooks:
63+
- docs/assets/hooks.py
6164

6265
markdown_extensions:
6366
- pymdownx.superfences

0 commit comments

Comments
 (0)