diff --git a/docs/hardware/makerfloss.eu.md b/docs/hardware/makerfloss.eu.md index 2a65e70..ff3c604 100644 --- a/docs/hardware/makerfloss.eu.md +++ b/docs/hardware/makerfloss.eu.md @@ -13,7 +13,7 @@ storage_type: nvme nic_gbps: 1 --- -# Notes +## Notes Hetzner Cloud VPS running the public-facing MakerFLOSS stack: Forgejo (self-hosted git forge), Traefik with Let's Encrypt, poste.io mail diff --git a/docs/hardware/mf00.md b/docs/hardware/mf00.md index 405792e..8e8cff1 100644 --- a/docs/hardware/mf00.md +++ b/docs/hardware/mf00.md @@ -16,11 +16,11 @@ storage: nic_gbps: [1, 2.5, 10] --- -# Notes +## Notes PCIe USB add-in card: ASMedia ASM2141/ASM3142 -# ToDo +## ToDo 1. Update BIOS/UEFI firmware 2. Update BIOS/UEFI settings diff --git a/docs/hardware/mf01.md b/docs/hardware/mf01.md index c6b5766..b466de0 100644 --- a/docs/hardware/mf01.md +++ b/docs/hardware/mf01.md @@ -13,11 +13,11 @@ storage_type: nvme nic_gbps: 1 --- -# Notes +## Notes HP desktop. -# ToDo +## ToDo 1. Update BIOS/UEFI firmware 2. Update BIOS/UEFI settings diff --git a/docs/hardware/mf02.md b/docs/hardware/mf02.md index 9656177..c883157 100644 --- a/docs/hardware/mf02.md +++ b/docs/hardware/mf02.md @@ -13,11 +13,11 @@ storage_type: nvme nic_gbps: 1 --- -# Notes +## Notes HP desktop. -# ToDo +## ToDo 1. Update BIOS/UEFI firmware 2. Update BIOS/UEFI settings diff --git a/docs/hardware/mf03.md b/docs/hardware/mf03.md index 5c91cba..b93f4a7 100644 --- a/docs/hardware/mf03.md +++ b/docs/hardware/mf03.md @@ -13,11 +13,11 @@ storage_type: hdd nic_gbps: 1 --- -# Notes +## Notes Old Gamer style PC -# ToDo +## ToDo 1. Update BIOS/UEFI firmware 2. Update BIOS/UEFI settings diff --git a/mkdocs.yml b/mkdocs.yml index 3afb211..16e9767 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -48,6 +48,9 @@ markdown_extensions: plugins: - search +hooks: + - scripts/mkdocs_hooks.py + nav: - Home: index.md - Hardware: diff --git a/scripts/mkdocs_hooks.py b/scripts/mkdocs_hooks.py new file mode 100644 index 0000000..b74f4ef --- /dev/null +++ b/scripts/mkdocs_hooks.py @@ -0,0 +1,34 @@ +"""MkDocs build hook: render a Specs section on each hardware host page from its YAML frontmatter.""" +from __future__ import annotations + +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from gen_overview import fmt_cpu, fmt_nic, fmt_ram, fmt_storage # noqa: E402 + + +def _render_specs(meta: dict) -> str: + rows = [ + ("Model", meta.get("model")), + ("Location", meta.get("location")), + ("CPU", fmt_cpu(meta)), + ("RAM", fmt_ram(meta)), + ("Storage", fmt_storage(meta)), + ("NIC", fmt_nic(meta)), + ("Status", meta.get("status")), + ] + lines = ["| Field | Value |", "|---|---|"] + for label, value in rows: + if not value: + continue + lines.append(f"| {label} | {value} |") + return "\n".join(lines) + + +def on_page_markdown(markdown, page, config, files): # noqa: ARG001 + meta = page.meta or {} + hostname = meta.get("hostname") + if not hostname: + return markdown + return f"# {hostname}\n\n## Specs\n\n{_render_specs(meta)}\n\n{markdown}"