mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 00:14:05 +00:00
fix: build fails on Windows: "Error: Could not find author page at..."
Fix #1068 Fix #1064
This commit is contained in:
1 parent
71f0959b9e
commit
c88f90bd5d
3 files changed
+7
-11
No files matched your search
+5
-5
@@ -26,10 +26,10 @@
|
||||
{{- $permalink := .Permalink -}}
|
||||
|
||||
{{/* Correct the title and URL for author profile pages. */}}
|
||||
{{- if eq .Section "author" -}}
|
||||
{{- if eq .Section "authors" -}}
|
||||
{{- $title = .Params.name -}}
|
||||
{{- $dir := path.Base (path.Split .Path).Dir -}}
|
||||
{{- with site.GetPage (printf "/authors/%s" (path.Base (path.Split .Path).Dir)) -}}
|
||||
{{- $username := path.Base (path.Split .Path).Dir -}}
|
||||
{{- with site.GetPage (printf "/authors/%s" $username) -}}
|
||||
{{- $permalink = .Permalink -}}
|
||||
{{- $rel_permalink = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
@@ -40,9 +40,9 @@
|
||||
{{- if gt $authorLen 0 -}}
|
||||
{{- $authors = slice -}}
|
||||
{{- range $k, $v := .Params.authors -}}
|
||||
{{- $person_page_path := (printf "/author/%s" (urlize $v)) -}}
|
||||
{{- $person_page_path := (printf "/authors/%s" (urlize $v)) -}}
|
||||
{{- $person_page := site.GetPage $person_page_path -}}
|
||||
{{- if $person_page -}}
|
||||
{{- if and $person_page $person_page.File -}}
|
||||
{{- $person := $person_page.Params -}}
|
||||
{{- $authors = $authors | append $person.name -}}
|
||||
{{- else -}}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{{ $superuser_role := "" }}
|
||||
{{ range first 1 (where (where site.Pages "Section" "authors") "Params.superuser" true) }}
|
||||
{{ $superuser_name = .Params.name }}
|
||||
{{ $superuser_username = delimit (last 1 (split (substr .File.Dir 0 -1) "/")) "" }}
|
||||
{{ $superuser_username = path.Base (path.Split .Path).Dir }}
|
||||
{{ $superuser_role = .Params.role }}
|
||||
{{ end }}
|
||||
{{ $scr.Set "superuser_username" $superuser_username }}{{/* For access from page_author.html. */}}
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
{{ $page := . }}
|
||||
{{ $pdf_link := false }}
|
||||
{{ $cite_link := false }}
|
||||
|
||||
{{ $slug := "" }}
|
||||
{{ if eq $page.File.TranslationBaseName "index" }}{{/* Check if using dir-based page bundles. */}}
|
||||
{{ $slug = delimit (last 1 (split (substr $page.File.Dir 0 -1) "/")) "" }}
|
||||
{{ end }}
|
||||
{{ $slug := $page.File.ContentBaseName }}
|
||||
{{ $resource := $page.Resources.GetMatch (printf "%s.pdf" $slug) }}
|
||||
{{ with $resource }}
|
||||
{{ $pdf_link = true }}
|
||||
|
||||
Reference in new issue
Block a user