Use relURL where possible

This commit is contained in:
Jake Howard 2018-01-06 22:27:36 +00:00
parent 6562adeb7b
commit 2c664160b0
No known key found for this signature in database
GPG key ID: 57AFB45680EDD477
3 changed files with 6 additions and 6 deletions

View file

@ -48,8 +48,8 @@
</p>
<p>{{T "message-404"}}</p>
<p></p>
<p><a href="{{.Site.BaseURL}}">{{T "Go-to-homepage"}}</a></p>
<p><img src="{{ .Site.BaseURL }}/images/gopher-404.jpg" style="width:50%"></img></p>
<p><a href='{{ "" | relURL }}'>{{T "Go-to-homepage"}}</a></p>
<p><img src='{{ "/images/gopher-404.jpg" | relURL }}' style="width:50%"></img></p>
</div>
</div>

View file

@ -8,9 +8,9 @@
<script type="text/javascript" src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
<script type="text/javascript">
{{ if .Site.IsMultiLingual }}
var baseurl = "{{.Site.BaseURL}}{{.Site.LanguagePrefix}}";
var baseurl = "{{.Site.LanguagePrefix | relURL }}";
{{ else }}
var baseurl = "{{.Site.BaseURL}}";
var baseurl = '{{ "" | relURL }}';
{{ end }}
</script>
<script type="text/javascript" src="{{"js/search.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>

View file

@ -14,7 +14,7 @@
{{if ($.Get "pattern")}}
{{if (findRE ($.Get "pattern") .Name)}}
<li>
<a href="{{ printf "%s/%s%s/%s" $.Site.BaseURL $fileDir ($.Scratch.Get "filesName") .Name }}" >
<a href="{{ (printf "%s%s/%s" $fileDir ($.Scratch.Get "filesName") .Name) | relURL }}" >
{{.Name}}
</a>
({{div .Size 1024 }} ko)
@ -22,7 +22,7 @@
{{end}}
{{else}}
<li>
<a href="{{ printf "%s/%s%s/%s" $.Site.BaseURL $fileDir ($.Scratch.Get "filesName") .Name }}" >
<a href="{{ (printf "%s%s/%s" $fileDir ($.Scratch.Get "filesName") .Name) | relURL }}" >
{{.Name}}
</a>
({{div .Size 1024 }} ko)