Using relative URLs in the header (#118)

* using relative URLs in the header

* using relative permalinks for regular pages
This commit is contained in:
Aaron Schlesinger
2019-04-06 11:23:02 -07:00
committed by Michael Noronha
parent bf38d4ef79
commit 55a3b2a42b
2 changed files with 7 additions and 7 deletions

View File

@@ -41,13 +41,13 @@
{{ end }}
{{ range .Site.Params.extracssfiles }}
<link rel="stylesheet" href="{{ . | absURL }}">
<link rel="stylesheet" href="{{ . | relURL }}">
{{ end }}
<!-- Icon -->
<link rel="shortcut icon"
{{ if .Site.Params.faviconfile }}
href="{{ .Site.Params.faviconfile | absURL }}"
href="{{ .Site.Params.faviconfile | relURL }}"
{{ else }}
href="{{ .Site.BaseURL }}img/favicon.ico"
{{ end }}

View File

@@ -14,25 +14,25 @@
{{ if (not (isset .Site.Params "logofile")) }}
<a href="https://github.com/mtn/cocoa-eh-hugo-theme/wiki/Configuration#logo">Logo HOWTO</a>
{{ else if ne .Site.Params.logofile "" }}
<a href="{{ .Site.BaseURL }}"><img class="logo" src="{{ .Site.Params.logofile | absURL }}" alt="logo"></a>
<a href="{{ .Site.BaseURL }}"><img class="logo" src="{{ .Site.Params.logofile | relURL }}" alt="logo"></a>
{{ end }}
<div class="content">
<a href="{{ .Site.BaseURL }}"><div class="name"><h1>{{ .Site.Title }}</h1></div></a>
<a href="/"><div class="name"><h1>{{ .Site.Title }}</h1></div></a>
<nav>
<ul>
{{ if (and (ne (len (where .Site.RegularPages "Section" "blog")) 0) (not (in .Site.Params.exclude_headings "blog"))) }}
<li><a href="{{ .Site.BaseURL }}blog/">Blog</a></li>
<li><a href="/blog/">Blog</a></li>
{{ end }}
{{ range $.Site.Home.Sections }}
{{ range first 1 (where .Pages "Section" "ne" "")}}
{{ if (and (ne .Section "blog") (not (in .Site.Params.exclude_headings (lower .Section))))}}
<li><a href="{{ .Section | urlize | absURL }}">{{ .Section }}</a></li>
<li><a href="{{ .Section | urlize | relURL }}">{{ .Section }}</a></li>
{{ end }}
{{ end }}
{{ end }}
{{ range where .Site.RegularPages "Section" ""}}
{{ if (and (and (ne .Title "License") (ne .Title "Home")) (not (in .Site.Params.exclude_headings (lower .Title))))}}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>