mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-24 12:49:03 -05:00
scripts/sitediagrams.py writes the explainer, install flow, verification modes, MinUI card, pipeline and data layer diagrams as inline SVG from the registry, the platform files, the install manifests and the pipeline step list. A page asks for one with an image comment, which the decoration pass resolves. The two mermaid diagrams of the architecture page are replaced, so no page loads mermaid from unpkg. Platform logos and system icons are copied once by fetch_site_images.py with their source and owner recorded, and the build rewrites the remote links to the copies. validate_site refuses an image from another host. Three registry logos named a personal avatar instead of the project's (RomM, ROCKNIX, MiSTer FPGA) and MyMinUI's was a GitHub identicon, now dropped. One 1200x630 sharing card per section, a 404 page with search and the two entry pages, and a list of screenshots that need a real device.
53 lines
3.2 KiB
HTML
53 lines
3.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{#
|
|
Open Graph and Twitter card tags.
|
|
|
|
mkdocs-material only emits these through its social plugin, which pulls in
|
|
Pillow and CairoSVG to render preview images. The pages here already carry a
|
|
per-page title and description, so the tags can be filled from those without
|
|
taking on two image dependencies. The links get shared on Discord, Reddit and
|
|
forums, where a bare URL with no preview is the difference between a card and
|
|
a grey rectangle.
|
|
|
|
One sharing card per section (docs_assets/og, made by
|
|
scripts/make_og_cards.py). The section is the page's level when the
|
|
generator gives one, otherwise it follows from the URL.
|
|
#}
|
|
{% block extrahead %}
|
|
{% set page_title = page.meta.title if page and page.meta and page.meta.title else (page.title if page and page.title else config.site_name) %}
|
|
{% set page_description = page.meta.description if page and page.meta and page.meta.description else config.site_description %}
|
|
{% set page_url = page.canonical_url if page and page.canonical_url else config.site_url %}
|
|
{% set url = page.url if page and page.url else '' %}
|
|
{% set level = page.meta.level if page and page.meta and page.meta.level else '' %}
|
|
{% if not url %}{% set section = 'home' %}
|
|
{% elif level in ['start', 'setup', 'explore', 'reference', 'contribute'] %}{% set section = level %}
|
|
{% elif url.startswith('which-pack') or url.startswith('wiki/first-install') or url.startswith('wiki/faq') or url.startswith('wiki/getting-started') %}{% set section = 'start' %}
|
|
{% elif url.startswith('platforms') %}{% set section = 'setup' %}
|
|
{% elif url.startswith('systems') or url.startswith('emulators') or url.startswith('files') %}{% set section = 'explore' %}
|
|
{% elif url.startswith('contributing') or url.startswith('wiki/adding') or url.startswith('wiki/profiling') or url.startswith('wiki/testing') or url.startswith('wiki/release') %}{% set section = 'contribute' %}
|
|
{% else %}{% set section = 'reference' %}{% endif %}
|
|
{% set preview_image = config.site_url ~ 'assets/og/' ~ section ~ '.png' if config.site_url else '' %}
|
|
|
|
<meta property="og:type" content="{{ 'website' if not url else 'article' }}">
|
|
<meta property="og:site_name" content="{{ config.site_name }}">
|
|
<meta property="og:title" content="{{ page_title }}">
|
|
<meta property="og:description" content="{{ page_description }}">
|
|
{% if page_url %}<meta property="og:url" content="{{ page_url }}">{% endif %}
|
|
{% if preview_image %}
|
|
<meta property="og:image" content="{{ preview_image }}">
|
|
<meta property="og:image:width" content="1200">
|
|
<meta property="og:image:height" content="630">
|
|
<meta property="og:image:alt" content="{{ config.site_name }}: {{ page_title }}">
|
|
{% endif %}
|
|
|
|
{# The sitemap, named from every page: a project site under /retrobios/
|
|
cannot serve the host-root robots.txt that would announce it. #}
|
|
{% if config.site_url %}<link rel="sitemap" type="application/xml" title="Sitemap" href="{{ config.site_url }}sitemap.xml">{% endif %}
|
|
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:title" content="{{ page_title }}">
|
|
<meta name="twitter:description" content="{{ page_description }}">
|
|
{% if preview_image %}<meta name="twitter:image" content="{{ preview_image }}">{% endif %}
|
|
{% endblock %}
|