docs(layouts): add header comments to undocumented partials

Add `{{/* ... */}}` header comments to 25 partials that had no documentation,
enabling `pnpm gen:docs` to generate their reference docs. Also fix
base/head/index.html leading blank line that prevented parser matching.

Groups covered: base/, feed/, function/, home/, init/, plugin/, single/, store/, (root).
This commit is contained in:
Cell
2026-07-23 12:56:40 +08:00
parent a254e10136
commit 5322a15ceb
30 changed files with 253 additions and 3 deletions
@@ -1,3 +1,11 @@
{{- /*
Content expiration reminder partial.
Displays a note or warning admonition when the page's last modification date
exceeds configurable day thresholds (default: 90 days for note, 180 days for warning).
Skipped for password-protected pages.
*/ -}}
{{- $expirationReminder := dict "Page" . "Key" "expiration_reminder" | partial "function/param.html" | default dict -}}
{{- if $expirationReminder.enable | and (not .Params.password) -}}
@@ -1,3 +1,10 @@
{{- /*
Post author display partial.
Renders the author name with optional avatar and link.
Stores the resolved author map in the page store for use by other partials.
*/ -}}
{{- $author := partial "function/get-author-map.html" .Params.author -}}
{{- .Store.Set "author" $author -}}
{{- $optim := slice
@@ -1,3 +1,10 @@
{{- /*
Post categories and collections display partial.
Renders category and collection links with icons for the current page.
Displays categories only, collections only, or both depending on which are present.
*/ -}}
{{- $categories := slice -}}
{{- range .GetTerms "categories" -}}
{{- $categories = $categories | append (
+7
View File
@@ -1,3 +1,10 @@
{{- /*
Post reward/donation panel partial.
Reads the reward config from front matter and site defaults,
then delegates rendering to plugin/reward.html.
*/ -}}
{{- $reward := dict "Page" . "Key" "reward" | partial "function/param.html" -}}
{{- $author := .Store.Get "author" -}}
{{- $options := dict "Reward" $reward "Id" "fi-reward" "Author" $author.name -}}