fix: PermaLink to RelPermalink

This commit is contained in:
Junyi Hou 2024-04-09 19:33:28 +08:00
parent f774d2689d
commit 9f33764cff
7 changed files with 18 additions and 20 deletions

View file

@ -18,7 +18,7 @@
</div>
{{ end }}
<a class="post-hidden-url u-url" href="{{ .Permalink }}">{{ .Permalink }}</a>
<a class="post-hidden-url u-url" href="{{ .RelPermalink }}">{{ .RelPermalink }}</a>
<a href="{{ .Site.BaseURL }}" class="p-name p-author post-hidden-author h-card" rel="me">{{ .Params.author | default .Site.Params.author }}</a>
@ -27,7 +27,7 @@
<ul class="post-categories">
{{ range $cat_name := .Params.categories }}
{{ $cat := ($.Site.GetPage (printf "/categories/%s" $cat_name | urlize )) }}
<li><a href="{{ $cat.Permalink }}">{{ $cat.Title | default $cat_name }}</a></li>
<li><a href="{{ $cat.RelPermalink }}">{{ $cat.Title | default $cat_name }}</a></li>
{{ end }}
</ul>
{{ end }}
@ -35,7 +35,7 @@
<ul class="post-tags">
{{ range $tag_name := .Params.tags }}
{{ $tag := ($.Site.GetPage (printf "/tags/%s" $tag_name | urlize )) }}
<li><a href="{{ $tag.Permalink }}">#{{ $tag.Title | default $tag_name }}</a></li>
<li><a href="{{ $tag.RelPermalink }}">#{{ $tag.Title | default $tag_name }}</a></li>
{{ end }}
</ul>
{{ end }}
@ -43,7 +43,7 @@
<ul class="post-authors">
{{ range $author_name := .Params.authors }}
{{ $author := ($.Site.GetPage (printf "/authors/%s" $author_name | urlize )) }}
<li><a href="{{ $author.Permalink }}">@{{ $author_name }}</a></li>
<li><a href="{{ $author.RelPermalink }}">@{{ $author_name }}</a></li>
{{ end }}
</ul>
{{ end }}