handle all manually wirte URL with relURL

This commit is contained in:
leafee98 2022-05-16 18:46:25 +08:00
parent babe8865cb
commit b343bac3f9
7 changed files with 14 additions and 14 deletions

View file

@ -17,7 +17,7 @@
{{ with .Params.tags }}
{{ range . }}
<a class="tags" href="{{ "tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
<a class="tags" href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}

View file

@ -18,7 +18,7 @@
<div>
Categories:
{{ range . }}
<a href="{{ "/categories/" | absURL }}{{ . | urlize }}">{{ . }}</a>
<a href="{{ "/categories/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end }}
@ -27,7 +27,7 @@
<div>
Tags:
{{ range . }}
<a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
<a href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end }}

View file

@ -17,7 +17,7 @@
<div class="categories">
<span>Categories:</span>
{{ range first 2 . }}
<a href="{{ "/categories/" | absURL }}{{ . | urlize }}">{{ . }}</a>
<a href="{{ "/categories/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end }}
@ -26,7 +26,7 @@
<div class="tags">
<span>Tags:</span>
{{ range first 5 . }}
<a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a>
<a href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
</div>
{{ end }}

View file

@ -7,7 +7,7 @@
{{/* load mermaid if any mermaid code block */}}
{{ if .Page.Store.Get "hasMermaid" }}
<script src="{{ "/js/meraid-9.0.0.min.js" | absURL }}"></script>
<script src="{{ "/js/meraid-9.0.0.min.js" | relURL }}"></script>
<script>mermaid.initialize({ startOnLoad: true });</script>
{{ end }}

View file

@ -5,7 +5,7 @@
<ul>
{{ range $key, $_ := .Site.Taxonomies.categories }}
<li>
<a href="{{ "/categories/" }}{{ $key | urlize }}">{{ $key }}({{ .Count }})</a>
<a href="{{ "/categories/" | relURL }}{{ $key | urlize }}">{{ $key }}({{ .Count }})</a>
</li>
{{ end }}
</ul>

View file

@ -5,7 +5,7 @@
<ul>
{{ range .Site.Taxonomies.tags.Alphabetical }}
<li>
<a href="{{ "/tags/" }}{{ .Name | urlize }}">{{ .Name }} ({{ .Count }})</a>
<a href="{{ "/tags/" | relURL }}{{ .Name | urlize }}">{{ .Name }} ({{ .Count }})</a>
</li>
{{ end }}
</ul>