Use more relative links

This commit is contained in:
Joshua Goins 2023-04-17 17:00:05 -04:00
parent d1f6e89c74
commit 56354e484c
9 changed files with 14 additions and 15 deletions

View file

@ -1,4 +1,4 @@
{{ $icon := resources.Get "external-link.svg" }} {{ $icon := resources.Get "external-link.svg" }}
<a class="ext-link" href="{{ .Destination | safeURL }}" {{ if strings.HasPrefix .Destination "http" }} <a class="ext-link" href="{{ .Destination | safeURL }}" {{ if strings.HasPrefix .Destination "http" }}
target="_blank"{{ end }}>{{ .Text | safeHTML }}{{ if strings.HasPrefix .Destination "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.Permalink }}">{{- end -}}</a> target="_blank"{{ end }}>{{ .Text | safeHTML }}{{ if strings.HasPrefix .Destination "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.RelPermalink }}">{{- end -}}</a>

View file

@ -19,14 +19,14 @@
<figure> <figure>
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }} {{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
<audio controls src="{{ $full.Permalink }}" preload="metadata"> <audio controls src="{{ $full.RelPermalink }}" preload="metadata">
Your browser does not support audio. Your browser does not support audio.
</audio> </audio>
<figcaption> <figcaption>
"{{ .title }}" "{{ .title }}"
{{ if .newgrounds_url }} {{ if .newgrounds_url }}
<a href="{{ .newgrounds_url }}" style="vertical-align: bottom"><img style="vertical-align: bottom" alt="Newgrounds Icon" width="19" height="19" src="{{ $newgrounds_icon.Permalink }}"></a> <a href="{{ .newgrounds_url }}" style="vertical-align: bottom"><img style="vertical-align: bottom" alt="Newgrounds Icon" width="19" height="19" src="{{ $newgrounds_icon.RelPermalink }}"></a>
{{ end }} {{ end }}
</figcaption> </figcaption>
</figure> </figure>

View file

@ -1,7 +1,7 @@
{{ if not .IsHome }} {{ if not .IsHome }}
{{- range .Ancestors.Reverse }} {{- range .Ancestors.Reverse }}
<a href="{{ .Permalink }}">{{ .Title }}</a> <a href="{{ .RelPermalink }}">{{ .Title }}</a>
<span> / </span> <span> / </span>
{{- end }} {{- end }}
<a href="{{ .Permalink }}">{{ .Title }}</a> <a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }} {{ end }}

View file

@ -2,7 +2,7 @@
{{ range $.Site.Menus.badges }} {{ range $.Site.Menus.badges }}
{{ $badgeScope := . }} {{ $badgeScope := . }}
{{ with resources.Get .URL }} {{ with resources.Get .URL }}
<img style="image-rendering: pixelated;" width="{{ .Width }}" height="{{ .Height }}" src="{{ .Permalink }}" alt="{{ $badgeScope.Name }}"> <img style="image-rendering: pixelated;" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}" alt="{{ $badgeScope.Name }}">
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>

View file

@ -21,7 +21,7 @@
{{ $year = index $split 3 }} {{ $year = index $split 3 }}
{{ end }} {{ end }}
<a aria-label="Gallery Item" class="no-decoration grid-item" href="{{ .Permalink }}"> <a aria-label="Gallery Item" class="no-decoration grid-item" href="{{ .RelPermalink }}">
{{ $path := printf "/%s/%d/%.2d/%s" $base (int $year) (int $month) $filename_without_ext}} {{ $path := printf "/%s/%d/%.2d/%s" $base (int $year) (int $month) $filename_without_ext}}
{{ $title := .Params.title }} {{ $title := .Params.title }}
@ -34,17 +34,17 @@
{{ with $image }} {{ with $image }}
{{ if $.Params.threed }} {{ if $.Params.threed }}
{{ with resources.Get "3d.png" }} {{ with resources.Get "3d.png" }}
<img alt="Viewable 3D" title="Viewable 3D" style="z-index: 1; position: absolute; left: 10px; top: 10px; border: none" src="{{ .Permalink }}"> <img alt="Viewable 3D" title="Viewable 3D" style="z-index: 1; position: absolute; left: 10px; top: 10px; border: none" src="{{ .RelPermalink }}">
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if $.Params.animation }} {{ if $.Params.animation }}
{{ with resources.Get "play-circle.png" }} {{ with resources.Get "play-circle.png" }}
<img alt="Viewable Animation" title="Viewable Animation" style="z-index: 1; position: absolute; left: 10px; top: 10px; border: none" src="{{ .Permalink }}"> <img alt="Viewable Animation" title="Viewable Animation" style="z-index: 1; position: absolute; left: 10px; top: 10px; border: none" src="{{ .RelPermalink }}">
{{ end }} {{ end }}
{{ end }} {{ end }}
<img width="{{ .Width }}" height="{{ .Height }}" alt="{{ $title }}" title="{{ $title }}" src="{{ .Permalink }}"> <img width="{{ .Width }}" height="{{ .Height }}" alt="{{ $title }}" title="{{ $title }}" src="{{ .RelPermalink }}">
{{ else }} {{ else }}
<p>Thumbnail not found!</p> <p>Thumbnail not found!</p>
{{ end }} {{ end }}

View file

@ -5,7 +5,7 @@
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<div class="site-menu"> <div class="site-menu">
<a href="{{ .URL }}">{{ .Name }}{{ if strings.HasPrefix .URL "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.Permalink }}">{{- end -}}</a> <a href="{{ .URL }}">{{ .Name }}{{ if strings.HasPrefix .URL "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.RelPermalink }}">{{- end -}}</a>
</div> </div>
{{ end }} {{ end }}
</details> </details>

View file

@ -14,7 +14,6 @@
{{ $site := resources.Get "js/voting.js" | minify | fingerprint | resources.PostProcess }} {{ $site := resources.Get "js/voting.js" | minify | fingerprint | resources.PostProcess }}
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script> <script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
<script> <script>
refresh({{ $name }}) refresh({{ $name }})
</script> </script>

View file

@ -2,7 +2,7 @@
<ul style="padding: 0"> <ul style="padding: 0">
{{ range first 3 (where .Site.Pages "Type" "blog").ByDate.Reverse }} {{ range first 3 (where .Site.Pages "Type" "blog").ByDate.Reverse }}
<li style="margin-left: 10px; list-style-type: square;"> <li style="margin-left: 10px; list-style-type: square;">
<a href="{{ .Permalink }}">{{ .Title }}</a> <a href="{{ .RelPermalink }}">{{ .Title }}</a>
<p><i>{{ .Summary }}</i></p> <p><i>{{ .Summary }}</i></p>
</li> </li>
{{ end }} {{ end }}

View file

@ -19,14 +19,14 @@
<figure> <figure>
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }} {{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
<audio controls src="{{ $full.Permalink }}" preload="metadata"> <audio controls src="{{ $full.RelPermalink }}" preload="metadata">
Your browser does not support audio. Your browser does not support audio.
</audio> </audio>
<figcaption> <figcaption>
"{{ .title }}" "{{ .title }}"
{{ if .newgrounds_url }} {{ if .newgrounds_url }}
<a href="{{ .newgrounds_url }}" style="vertical-align: bottom"><img style="vertical-align: bottom" alt="Newgrounds Icon" width="19" height="19" src="{{ $newgrounds_icon.Permalink }}"></a> <a href="{{ .newgrounds_url }}" style="vertical-align: bottom"><img style="vertical-align: bottom" alt="Newgrounds Icon" width="19" height="19" src="{{ $newgrounds_icon.RelPermalink }}"></a>
{{ end }} {{ end }}
</figcaption> </figcaption>
</figure> </figure>