From 5a7bf179bbce4d31778759b6dd3850192aa84ec1 Mon Sep 17 00:00:00 2001 From: redjax Date: Sun, 5 Jan 2025 22:25:13 -0500 Subject: [PATCH] Add required-frontmatter plugin. It doesn't seem to actually do anything. Github issue opened: https://github.com/unmc-vcr/mkdocs-required-frontmatter-plugin/issues/1 --- mkdocs.yml | 14 ++++++++++++++ pyproject.toml | 1 + uv.lock | 11 +++++++++++ 3 files changed, 26 insertions(+) diff --git a/mkdocs.yml b/mkdocs.yml index b96a3f6a..e8b14b96 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -89,6 +89,20 @@ plugins: validate_rendered_template: True ## Enable offline version of site. Breaks many features. # - offline + - required-frontmatter: + enabled: true + required-keys: + - tags + - a_test_tag + ## Disable required frontmatter on specific files/paths + exclude: + ## All index.md files + - index.md + ## A path to a directory and file pattern + # - example/path/* + ## Fail build when page is missing frontmatter & strict: true + strict: true + markdown_extensions: ## Add footnotes to marked-up abbreviations to provide extra context. diff --git a/pyproject.toml b/pyproject.toml index ab6f33c6..58f69879 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ authors = [{ name = "redjax", email = "none@none.com" }] license = { text = "MIT" } dependencies = [ "markdown-include>=0.8.1", + "mkdocs-required-frontmatter-plugin>=0.0.2", "mkdocs>=1.6.1", "mkdocs-autorefs>=1.2.0", "mkdocs-gen-files>=0.5.0", diff --git a/uv.lock b/uv.lock index a68aa625..116a5787 100644 --- a/uv.lock +++ b/uv.lock @@ -542,6 +542,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5b/54/662a4743aa81d9582ee9339d4ffa3c8fd40a4965e033d77b9da9774d3960/mkdocs_material_extensions-1.3.1-py3-none-any.whl", hash = "sha256:adff8b62700b25cb77b53358dad940f3ef973dd6db797907c49e3c2ef3ab4e31", size = 8728 }, ] +[[package]] +name = "mkdocs-required-frontmatter-plugin" +version = "0.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0b/4d/693f2ce94139c907fbed996df4d457827be064c79fe192c83ca2c45708dc/mkdocs-required-frontmatter-plugin-0.0.2.tar.gz", hash = "sha256:b153f0f208079b2074ca1201b7e575dce98b1243b4f88cc141848ce928067c08", size = 4468 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/70/dc/d32fed91981b74f8bac4163f9bf6f5fa730367d4b999c57c061aa035c668/mkdocs_required_frontmatter_plugin-0.0.2-py3-none-any.whl", hash = "sha256:0d4a3d99fa2fc56e9de6b196c13a7666e07164ba0a117ce9c5fe076fdc1f5aca", size = 4903 }, +] + [[package]] name = "mkdocs-rss-plugin" version = "1.17.1" @@ -841,6 +850,7 @@ dependencies = [ { name = "mkdocs-htmlproofer-plugin" }, { name = "mkdocs-literate-nav" }, { name = "mkdocs-material" }, + { name = "mkdocs-required-frontmatter-plugin" }, { name = "mkdocs-rss-plugin" }, { name = "mkdocs-section-index" }, { name = "mkdocstrings", extra = ["python"] }, @@ -866,6 +876,7 @@ requires-dist = [ { name = "mkdocs-htmlproofer-plugin", specifier = ">=1.3.0" }, { name = "mkdocs-literate-nav", specifier = ">=0.6.1" }, { name = "mkdocs-material", specifier = ">=9.5.42" }, + { name = "mkdocs-required-frontmatter-plugin", specifier = ">=0.0.2" }, { name = "mkdocs-rss-plugin", specifier = ">=1.15.0" }, { name = "mkdocs-section-index", specifier = ">=0.3.9" }, { name = "mkdocstrings", extras = ["python"], specifier = ">=0.26.2" },