diff options
author | Davide Asnaghi <30296575+d-asnaghi@users.noreply.github.com> | 2020-08-03 06:33:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-03 06:33:30 +0300 |
commit | eadd918adf900a546a11168e5e80788cbcc3a85c (patch) | |
tree | 38d86988f459a706a947e602d5ce75ae6b898ba8 | |
parent | 8eb35c00263ffb5306d25a4c1c11cd41482b9ad0 (diff) | |
parent | 95833a767272bd75258a2d59fba4b13ec2976986 (diff) |
Merge pull request #6 from your-identity/unicode-href
[THEME] use base 64 encoding for unicode URLs
-rw-r--r-- | layouts/_default/list.html | 6 |
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 }} |