Jelajahi Sumber

fix: revert "fix: workaround Hugo GetPage/urlize bug with non-ASCII usernames"

This reverts commit 03af4df1

Ensure `removePathAccents = true` in `config.toml` to workaround the Hugo bug: https://github.com/gohugoio/hugo/issues/5687

Fix #1575
Fix #1563
George Cushen 5 tahun lalu
induk
melakukan
94e6169320

+ 1 - 1
layouts/index.json

@@ -40,7 +40,7 @@
         {{- if gt $authorLen 0 -}}
           {{- $authors = slice -}}
             {{- range $k, $v := .Params.authors -}}
-              {{- $person_page_path := (printf "/authors/%s" (anchorize $v)) -}}
+              {{- $person_page_path := (printf "/authors/%s" (urlize $v)) -}}
               {{- $person_page := site.GetPage $person_page_path -}}
               {{- if and $person_page $person_page.File -}}
                 {{- $person := $person_page.Params -}}

+ 1 - 1
layouts/partials/page_author.html

@@ -14,7 +14,7 @@
   {{ if .Params.authors }}
     {{ $first_author = index .Params.authors 0 }}
   {{ end }}
-  {{ $author_urlized = anchorize $first_author }}
+  {{ $author_urlized = urlize $first_author }}
 {{ end }}
 
 {{ $site_type := site.Params.site_type | default "Person" }}

+ 1 - 1
layouts/partials/widgets/about.html

@@ -8,7 +8,7 @@
   {{ $author = $page.Params.author }}
 {{end}}
 
-{{ $person_page_path := (printf "/authors/%s" (anchorize $author)) }}
+{{ $person_page_path := (printf "/authors/%s" (urlize $author)) }}
 {{ $person_page := site.GetPage $person_page_path }}
 {{ if not $person_page }}
   {{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://sourcethemes.com/academic/docs/page-builder/#about " $person_page_path }}

+ 1 - 1
layouts/shortcodes/mention.html

@@ -1,5 +1,5 @@
 {{- $username := .Get 0 -}}
-{{- $username_url := $username | anchorize -}}
+{{- $username_url := $username | urlize -}}
 {{- $taxonomy := "authors" -}}
 {{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy $username_url) -}}
 {{- $name := $profile_page.Params.name | default ($username|markdownify) -}}