mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
5322a15ceb
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).
29 lines
1.0 KiB
HTML
29 lines
1.0 KiB
HTML
{{- /*
|
|
Global initialization partial.
|
|
|
|
Merges translations, resolves main section pages, stores them for cross-partial
|
|
access, and sets up the GitHub API token header from the HUGO_PARAMS_GHTOKEN
|
|
environment variable.
|
|
*/ -}}
|
|
|
|
{{- $pages := .Site.RegularPages }}
|
|
|
|
{{- /* Merge missing translations from other languages */ -}}
|
|
{{- if .Site.Params.enable_translation_merge -}}
|
|
{{- range .Site.Home.Translations -}}
|
|
{{- $pages = $pages | lang.Merge .Site.RegularPages -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- /* Set pages of main sections */ -}}
|
|
{{- $pages = where $pages "Section" "in" .Site.MainSections -}}
|
|
{{- $pages = $pages | union (where .Site.RegularPages "Type" "in" .Site.MainSections) -}}
|
|
{{- .Site.Store.Set "mainSectionPages" $pages -}}
|
|
|
|
{{- /* Select the scope named `public_repo` to generate personal access token */ -}}
|
|
{{- $header := dict "Authorization" "" -}}
|
|
{{- with (getenv "HUGO_PARAMS_GHTOKEN") -}}
|
|
{{- $header = dict "Authorization" (printf "token %v" .) -}}
|
|
{{- end -}}
|
|
{{- hugo.Store.Set "githubTokenHeader" $header -}}
|