-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: Fix bug with overrides (#685)
- Loading branch information
Showing
5 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import logging | ||
from typing import Dict, Any | ||
|
||
from mkdocs.config.defaults import MkDocsConfig | ||
|
||
logger = logging.getLogger('mkdocs') | ||
|
||
config_updated = False | ||
|
||
|
||
# Ideally there would be a better hook, but it's unclear if context can | ||
# be obtained any earlier | ||
def on_template_context( | ||
context: Dict[str, Any], | ||
template_name: str, | ||
config: MkDocsConfig, | ||
) -> None: | ||
"""Update the copyright in the footer.""" | ||
global config_updated | ||
if not config_updated: | ||
config_updated = True | ||
now = context['build_date_utc'].strftime('%Y/%m/%d') | ||
config.copyright = f'{config.copyright}, last updated {now}' | ||
logger.info(f'Updated copyright to {config.copyright}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters