Skip to content

Commit

Permalink
🐛 Fix: escape CJK character in tag and category (#245, #246)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Nov 19, 2022
1 parent 203de93 commit d312150
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/function/path.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- /* https://discourse.gohugo.io/t/how-decode-urls-in-hugo/7549/4 */ -}}
{{- /* https://github.com/hugo-fixit/FixIt/issues/245 */ -}}
{{- $URL := . | urlize | urlquery | urls.Parse -}}
{{- $URL := partial "function/urlquery.html" . -}}
{{- $URL = $URL | urlize | urls.Parse -}}
{{- return $URL.Path -}}
6 changes: 6 additions & 0 deletions layouts/partials/function/urlquery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- /* Escape url special characters to query format, e.g: `#` -> `%23` */ -}}
{{- /* https://github.com/hugo-fixit/FixIt/issues/245 */ -}}

{{- $content := . -}}
{{- $content = replace $content "#" "%23" -}}
{{- return $content -}}

1 comment on commit d312150

@vercel
Copy link

@vercel vercel bot commented on d312150 Nov 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

fixit – ./

fixit-x-cell.vercel.app
hugofixit.vercel.app
fixit-git-master-x-cell.vercel.app
fixit.lruihao.cn

Please sign in to comment.