浏览代码

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

This commit completes 94e6169320faff9cdc3035fdf5951be8be8e6f1d in reverting commit 03af4df

Ensure `removePathAccents = true` in `config.toml` to workaround the Hugo bug: gohugoio/hugo#5687

Fix #1575
Fix #1563
George Cushen 5 年之前
父节点
当前提交
4ed72d85b2
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      layouts/partials/functions/get_author_name.html
  2. 1 1
      layouts/partials/page_metadata_authors.html

+ 1 - 1
layouts/partials/functions/get_author_name.html

@@ -12,7 +12,7 @@
   {{ $author_username = $page.Scratch.Get "superuser_username" }}
 {{ else if $page.Params.authors }}
   {{ $author = index $page.Params.authors 0 }}
-  {{ $author_username = anchorize $author }}
+  {{ $author_username = urlize $author }}
 {{ end }}
 
 {{ $taxonomy := "authors" }}

+ 1 - 1
layouts/partials/page_metadata_authors.html

@@ -4,7 +4,7 @@
 {{ with .Param $taxonomy }}
   {{ $link_authors := site.Params.link_authors | default true }}
   {{ range $index, $value := . }}
-    {{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy (. | anchorize)) -}}
+    {{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy (. | urlize)) -}}
     {{- $name := $profile_page.Params.name | default ($value|markdownify) -}}
     {{- if gt $index 0 }}, {{ end -}}
     <span>