Skip to content

Commit

Permalink
fix: correct relative url function
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Meier <[email protected]>
  • Loading branch information
astromechza committed Jul 10, 2024
1 parent 89968b6 commit 5652a78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1>Not found</h1>
<p>
Oops! This page doesn't exist. Try going back to the
<a href="{{.Site.BaseURL}}">home page</a>.
<a href="{{ relURL "" }}">home page</a>.
</p>
</div>
{{- end }}
4 changes: 2 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<html>
<head>
<!-- Add a custom home page here, or redirect right into the main docs (if you're first page is not /home, update the url below accordingly)-->
<meta http-equiv="REFRESH" content="0;url={{ .Site.BaseURL }}/docs/">
<meta http-equiv="REFRESH" content="0;url={{ relURL "docs" }}">
</head>
<body>
<p>This page has moved <a href="{{ .Site.BaseURL }}/docs/">here</a>.
<p>This page has moved <a href="{{ relURL "docs" }}">here</a>.
</p>
</body>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link
rel="{{ .Rel }}"
type="{{ .MediaType.Type }}"
href="{{ $.Site.BaseURL }}/docs/"
href="{{ relURL "docs" }}"
/>
{{ end -}} {{ $outputFormat := partial "outputformat.html" . -}} {{ if and
hugo.IsProduction (ne $outputFormat "print") -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{{ $pre := .Pre -}}
{{ $post := .Post -}}
{{ $url := urls.Parse .URL -}}
{{ $baseurl := urls.Parse $.Site.Params.Baseurl -}}
{{ $baseurl := urls.Parse $.Site.BaseUrl -}}
<a {{/**/ -}}
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}}
href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"
Expand Down

0 comments on commit 5652a78

Please sign in to comment.