Skip to content

Commit

Permalink
Merge pull request #3 from Nizzlay/relative
Browse files Browse the repository at this point in the history
Changes all URL's to be relative URL's instead of absolute URL's.
  • Loading branch information
Nizzlay authored Oct 7, 2020
2 parents e3cfd81 + 1358e64 commit 0483629
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>{{ $pageYear }}</h2>
<time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02") }}</time>
</div>
<span>
<a class="" href="{{ .Permalink }}">{{ if .Title }} {{ .Title }} {{ else }} Untitled {{ end }}</a>
<a class="" href="{{ .RelPermalink }}">{{ if .Title }} {{ .Title }} {{ else }} Untitled {{ end }}</a>
</span>
</li>
{{ end }}
Expand All @@ -27,4 +27,4 @@ <h2>{{ $pageYear }}</h2>
{{ partial "pagination.html" . }}
{{ end }}
</div>
{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="tag-cloud-tags">
{{ $AllRegularPagesCount := len .Site.RegularPages }}
{{ range $elem := .Data.Terms.Alphabetical }}
<a style="font-size: {{ (add 0.8 (mul 15 (div (float $elem.Count) $AllRegularPagesCount))) }}rem;" href="{{ $elem.Page.Permalink }}">
<a style="font-size: {{ (add 0.8 (mul 15 (div (float $elem.Count) $AllRegularPagesCount))) }}rem;" href="{{ $elem.Page.RelPermalink }}">
{{- .Page.Title -}}
</a>
{{ end }}
Expand All @@ -28,7 +28,7 @@
<ul class="category-list">
{{ range .Data.Terms.Alphabetical }}
<li class="category-list-item">
<a class="category-list-link" href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
<a class="category-list-link" href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>
<span class="category-list-count">{{ .Count }}</span>
</li>
{{ end }}
Expand Down
8 changes: 4 additions & 4 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

<section id="writing">
<!-- TODO: use built in mainSections parameter https://gohugo.io/functions/where/#mainsections -->
<span class="h1"><a href="{{ .Site.Params.mainSection | absURL }}">Writings</a></span>
<span class="h1"><a href="{{ .Site.Params.mainSection | relURL }}">Writings</a></span>
{{ if (and (and (isset .Site.Params "tagsoverview") (eq .Site.Params.tagsOverview true)) (gt (len .Site.Taxonomies.tags) 0)) }}
<span class="h2">Topics</span>
<span class="widget tagcloud">
{{ $AllRegularPagesCount := len .Site.RegularPages }}
{{ range $elem := .Site.Taxonomies.tags.Alphabetical }}
<a style="font-size: {{ (add 0.5 (mul 5 (div (float $elem.Count) $AllRegularPagesCount))) }}rem;" href="{{ $elem.Page.Permalink }}">
<a style="font-size: {{ (add 0.5 (mul 5 (div (float $elem.Count) $AllRegularPagesCount))) }}rem;" href="{{ $elem.Page.RelPermalink }}">
{{- .Page.Title -}}
</a>
{{ end }}
Expand All @@ -62,7 +62,7 @@
{{ range (sort .Paginator.Pages "Date" "desc") }}
<li class="post-item">
<div class="meta"><time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time></div>
<span><a href="{{ .Permalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
<span><a href="{{ .RelPermalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
</li>
{{ end }}
</ul>
Expand All @@ -78,7 +78,7 @@
{{ range (first (.Scratch.Get "count") (sort .Site.RegularPages "Date" "desc")) }}
<li class="post-item">
<div class="meta"><time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time></div>
<span><a href="{{ .Permalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
<span><a href="{{ .RelPermalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
</li>
{{ end }}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/favicon.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!-- TODO -->
<link rel="icon" type="image/png" href="{{ "images/favicon.ico" | absURL }}" />
<link rel="icon" type="image/png" href="{{ "images/favicon.ico" | relURL }}" />
4 changes: 2 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{ .Scratch.Set "colortheme" .Site.Params.Colortheme }}
{{ end }}
{{ $colortheme := .Scratch.Get "colortheme" }}
<link rel="stylesheet" href="{{ $colortheme | printf "css/style-%s.css" | absURL }}">
<link rel="stylesheet" href="{{ $colortheme | printf "css/style-%s.css" | relURL }}">
{{ `
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
Expand All @@ -28,4 +28,4 @@
{{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }}
{{ end }}
{{ end }}
</head>
</head>
8 changes: 4 additions & 4 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<header id="header">
<a href="{{ .Site.BaseURL }}">
<a href="{{ .Site.Home.RelPermalink }}">
{{ if (isset .Site.Params "gravatar") }}
<div id="logo" style="background-image: url(https://www.gravatar.com/avatar/{{ md5 .Site.param.gravatar }}?s=100&d=identicon)"></div>
{{ else if (isset .Site.Params "logo") }}
<div id="logo" style="background-image: url({{ .Site.Params.logo | absURL }})"></div>
<div id="logo" style="background-image: url({{ .Site.Params.logo | relURL }})"></div>
{{ else }}
<div id="logo" style="background-image: url({{ "images/logo.png" | absURL }})"></div>
<div id="logo" style="background-image: url({{ "images/logo.png" | relURL }})"></div>
{{ end}}
<div id="title">
<h1>{{ .Site.Title }}</h1>
Expand All @@ -22,4 +22,4 @@ <h1>{{ .Site.Title }}</h1>
</ul>
</div>
</header>


4 changes: 2 additions & 2 deletions layouts/partials/page_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
<ul>
{{ if .Prev }}
<li>
<a class="icon" href=" {{ .Prev.Permalink }}">
<a class="icon" href=" {{ .Prev.RelPermalink }}">
<i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i>
</a>
</li>
{{ end }}
{{ if .Next }}
<li>
<a class="icon" href="{{ .Next.Permalink }}">
<a class="icon" href="{{ .Next.RelPermalink }}">
<i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i>
</a>
</li>
Expand Down

0 comments on commit 0483629

Please sign in to comment.