mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 17:33:30 -05:00
The sitemap gave every page the build date. A page now states its own date and a mkdocs hook passes it on, or leaves lastmod out. The values added to the site's code spans today are also escaped: a backtick in a profile or file name could close the span and inject markup.
18 lines
647 B
Python
18 lines
647 B
Python
"""MkDocs hooks for the generated site.
|
|
|
|
The sitemap gave all 664 pages the build date as lastmod, so the field told
|
|
a crawler nothing. A page whose content carries its own date (an emulator
|
|
page: the day its profile was last read against the source) states it in
|
|
its front matter; the rest get no lastmod rather than an inexact one.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
|
|
def on_page_markdown(markdown: str, page: Any, config: Any, files: Any) -> str: # noqa: ARG001
|
|
"""Take lastmod from the page's own date, or leave it out."""
|
|
page.update_date = str(page.meta.get("date_modified") or "")
|
|
return markdown
|