mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
3e8bdfd8f9
* ⚡ Perf: adjust global/site scope state management * ⚡ Perf: adjust page scope state management
18 lines
873 B
HTML
18 lines
873 B
HTML
{{- /* Set site home relative permalink */ -}}
|
|
{{- $homeRelPermalink := .Site.Home.RelPermalink -}}
|
|
{{- $homeRelPermalink = strings.TrimSuffix "archives/" $homeRelPermalink -}}
|
|
{{- $homeRelPermalink = strings.TrimSuffix "offline/" $homeRelPermalink -}}
|
|
{{- .Site.Store.Set "homeRelPermalink" $homeRelPermalink -}}
|
|
|
|
{{- /* Set pages of main sections */ -}}
|
|
{{- $pages := where .Site.RegularPages "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 -}}
|