diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 9a838ee..ec308d6 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -6,8 +6,10 @@ on: - main paths: - 'docs/**' + - 'overrides/**' - 'mkdocs.yml' - 'docs-requirements.txt' + workflow_dispatch: jobs: deploy: @@ -16,6 +18,8 @@ jobs: contents: write steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: actions/setup-python@v5 with: diff --git a/docs-requirements.txt b/docs-requirements.txt index 99207a8..394ce44 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -5,3 +5,5 @@ mkdocs-material-extensions pymdown-extensions mkdocstrings mkdocstrings-python +mkdocs-callouts +mkdocs-git-revision-date-localized-plugin diff --git a/docs/assets/cat.png b/docs/assets/cat.png new file mode 100644 index 0000000..696b06d Binary files /dev/null and b/docs/assets/cat.png differ diff --git a/mkdocs.yml b/mkdocs.yml index 88d36d0..b6bc7ed 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -9,8 +9,9 @@ copyright: Copyright (c) 2023 Microsoft Corporation theme: name: material - favicon: https://zenodo.org/records/15376499/files/cat.png - logo: https://zenodo.org/records/15376499/files/cat.png + custom_dir: overrides + favicon: assets/cat.png + logo: assets/cat.png icon: menu: material/menu alternate: material/translate @@ -99,6 +100,11 @@ markdown_extensions: pygments_lang_class: true plugins: + - callouts - search - meta - tags + - git-revision-date-localized: + type: date + enable_creation_date: true + fallback_to_build_date: true diff --git a/overrides/main.html b/overrides/main.html new file mode 100644 index 0000000..74fda2a --- /dev/null +++ b/overrides/main.html @@ -0,0 +1,90 @@ +{% extends "base.html" %} + +{# + Theme override for SEO structured data and a clean homepage . + Schema is gated on page.file.src_path. Homepage uses a connected @graph + (WebSite + SoftwareSourceCode + Organization) per schema review. +#} + +{% block htmltitle %} + {%- if page and page.file and page.file.src_path == "index.md" -%} + <title>PyTorch-Wildlife: Open-Source Conservation Deep Learning Framework | Microsoft AI for Good + {%- else -%} + {{ super() }} + {%- endif -%} +{% endblock %} + +{% block extrahead %} + {{ super() }} + + {%- set social_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 social_desc = page.meta.description if page and page.meta and page.meta.description else config.site_description -%} + + + + + + + + + + + + + {#- TODO(design): swap in a 1200x630 banner + add og:image:width/height when delivered -#} + + {%- if page and page.file and page.file.src_path == "index.md" %} + + {%- endif %} + + {%- if page and page.file and page.file.src_path != "index.md" and page.canonical_url %} + + {%- endif %} +{% endblock %}