Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes all URL's to be relative URL's instead of absolute URL's. #3

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ <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 }}
</ul>
{{ partial "pagination.html" . }}
</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 @@ -13,7 +13,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 @@ -27,4 +27,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