Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/your-identity/hugo-theme-dimension.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authord-asnaghi <asnaghi@me.com>2020-08-02 20:47:16 +0300
committerd-asnaghi <asnaghi@me.com>2020-08-02 20:50:34 +0300
commit95833a767272bd75258a2d59fba4b13ec2976986 (patch)
tree38d86988f459a706a947e602d5ce75ae6b898ba8
parent8eb35c00263ffb5306d25a4c1c11cd41482b9ad0 (diff)
[THEME] use base 64 encoding for unicode URLs
-rw-r--r--layouts/_default/list.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 86b9e3a..252d465 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -25,7 +25,9 @@
{{ range .Pages.ByDate }}
{{if .Title }}
{{if .Content}}
- <li><a href="#{{ .Title | urlize }}">{{ .Title }}</a></li>
+ <li>
+ <a href="#{{ cond (in (.Title|urlize) "%") (.Title | base64Encode) (.Title) | urlize }}">{{ .Title }}</a>
+ </li>
{{ else }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
@@ -41,7 +43,7 @@
{{ range .Pages }}
{{if .Title }}
{{if .Content }}
- <article id="{{ .Title | urlize }}">
+ <article id="{{ cond (in (.Title|urlize) "%") (.Title | base64Encode) (.Title) | urlize }}">
<h2 class="major">{{ .Title }}</h2>
<span class="image main"><img src="{{ .Params.image }}" alt="" /></span>
{{ .Content }}