Files
FixIt/layouts/partials/init/global.html
T
2024-04-10 14:34:19 +08:00

24 lines
1.2 KiB
HTML

{{- /* Set customFilePath default value */ -}}
{{- $customFilePath := .Site.Params.customFilePath -}}
{{- $customFilePath = dict "aside" ($customFilePath.aside | default "custom/aside.html") | merge $customFilePath -}}
{{- $customFilePath = dict "profile" ($customFilePath.profile | default "custom/profile.html") | merge $customFilePath -}}
{{- $customFilePath = dict "footer" ($customFilePath.footer | default "custom/footer.html") | merge $customFilePath -}}
{{- .Scratch.Set "customFilePath" $customFilePath -}}
{{- /* Set site home relative permalink */ -}}
{{- $homeRelPermalink := .Site.Home.RelPermalink -}}
{{- $homeRelPermalink = strings.TrimSuffix "archives/" $homeRelPermalink -}}
{{- $homeRelPermalink = strings.TrimSuffix "offline/" $homeRelPermalink -}}
{{- .Scratch.Set "homeRelPermalink" $homeRelPermalink -}}
{{- /* Set pages of main section */ -}}
{{- $pages := where .Site.RegularPages "Type" "posts" -}}
{{- .Scratch.Set "mainSectionPages" $pages -}}
{{- /* Select the scope named "public_repo" to generate personal access token */ -}}
{{- $header := dict "Authorization" "" -}}
{{- with .Site.Params.dev.githubtoken -}}
{{- $header = dict "Authorization" (printf "token %v" .) -}}
{{- end -}}
{{- .Scratch.Set "githubTokenHeader" $header -}}