From 94e6169320faff9cdc3035fdf5951be8be8e6f1d Mon Sep 17 00:00:00 2001 From: George Cushen Date: Thu, 5 Mar 2020 19:54:10 +0000 Subject: [PATCH] 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 --- layouts/index.json | 2 +- layouts/partials/page_author.html | 2 +- layouts/partials/widgets/about.html | 2 +- layouts/shortcodes/mention.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/index.json b/layouts/index.json index 50ff9ce8..4e9f95d7 100644 --- a/layouts/index.json +++ b/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 -}} diff --git a/layouts/partials/page_author.html b/layouts/partials/page_author.html index 5e833edb..a93b54f5 100644 --- a/layouts/partials/page_author.html +++ b/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" }} diff --git a/layouts/partials/widgets/about.html b/layouts/partials/widgets/about.html index 430f5c87..b6967be9 100644 --- a/layouts/partials/widgets/about.html +++ b/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 }} diff --git a/layouts/shortcodes/mention.html b/layouts/shortcodes/mention.html index 1ac54108..3eb5e02b 100644 --- a/layouts/shortcodes/mention.html +++ b/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) -}}