feat: use relative URL

This commit is contained in:
Hanwen Guo 2023-01-01 17:08:14 +08:00
parent 210f46cbb3
commit 6c52934e93
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
{{- range $item := .collection -}} {{- range $item := .collection -}}
<li> <li>
{{- with $item.url -}} {{- with $item.url -}}
<a href="{{ $item.url }}">{{ safeHTML $item.title }}</a> <a href="{{ $item.url | relURL }}">{{ safeHTML $item.title }}</a>
{{- else -}} {{- else -}}
{{ safeHTML $item.title }} {{ safeHTML $item.title }}
{{- end -}} {{- end -}}

View File

@ -29,11 +29,11 @@
{{- range $post := $posts -}} {{- range $post := $posts -}}
<li> <li>
<span>{{- ($post.Date | time.Format site.Params.theme_config.date_format) }}</span> <span>{{- ($post.Date | time.Format site.Params.theme_config.date_format) }}</span>
<a href="{{ $post.Permalink }}">{{ $post.Title }}</a> <a href="{{ $post.Permalink | relURL }}">{{ $post.Title }}</a>
</li> </li>
{{ end }} {{ end }}
{{- if and .show_more $limit_exceeded }} {{- if and .show_more $limit_exceeded }}
<li><a href="{{ .show_more_url }}">{{ .show_more_text | default "Show more..." }}</a></li> <li><a href="{{ .show_more_url | relURL }}">{{ .show_more_text | default "Show more..." }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{ end }}