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

Bug: absURL to relURL #83

Merged
merged 7 commits into from
Nov 13, 2017
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
2 changes: 1 addition & 1 deletion exampleSite/content/blog/goisforlovers.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ instead of depending on the context.
```
{{ $title := .Site.Title }}
{{ range .Params.tags }}
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">
<li> <a href="/tags/{{ . | urlize }}">
{{ . }}</a> - {{ $title }} </li>
{{ end }}
```
Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
</p>
</div>
<div class="buttons-container">
<a class="border-button" href="{{ .Site.BaseURL }}">Go To Homepage</a>
<a class="border-button" href="{{ "/" | relURL }}">Go To Homepage</a>
<a class="border-button" href="mailto:{{ .Site.Social.email }}">Report A Problem</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions layouts/_default/header.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<header>
<div class="title">
{{ if $.Scratch.Get "h1" }}
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
{{ $.Scratch.Set "h1" false }}
{{ else }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ with .Description }}
<p>{{ . }}</p>
Expand Down
4 changes: 2 additions & 2 deletions layouts/about/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<header>
<div class="title">
{{ if $.Scratch.Get "h1" }}
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
{{ $.Scratch.Set "h1" false }}
{{ else }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ with .Description }}
<p>{{ . }}</p>
Expand Down
4 changes: 2 additions & 2 deletions layouts/contact/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<header>
<div class="title">
{{ if $.Scratch.Get "h1" }}
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
{{ $.Scratch.Set "h1" false }}
{{ else }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ with .Description }}
<p>{{ . }}</p>
Expand Down
4 changes: 2 additions & 2 deletions layouts/itemized/header.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<header>
<div class="title">
{{ if $.Scratch.Get "h1" }}
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
{{ $.Scratch.Set "h1" false }}
{{ else }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ with .Description }}
<p>{{ . }}</p>
Expand Down
10 changes: 4 additions & 6 deletions layouts/partials/favicon.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

{{ $favVer := $.Scratch.Get "favVer" }}

<link rel="apple-touch-icon-precomposed"
href='{{"/favicon/apple-touch-icon-precomposed" | relURL }}{{ $favVer }}.png'>
<link rel="icon" href='{{"/favicon/favicon" | relURL }}{{ $favVer }}.png'>
<link rel="apple-touch-icon-precomposed" href='{{ "favicon/apple-touch-icon-precomposed" | relURL }}{{ $favVer }}.png'>
<link rel="icon" href='{{ "favicon/favicon" | relURL }}{{ $favVer }}.png'>
<!--[if IE]><link rel="shortcut icon" href='/favicon{{ $favVer }}.ico'><![endif]-->
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage"
content='{{"/favicon/mstile" | relURL }}{{ $favVer }}.png'>
<meta name="msapplication-TileImage" content='{{ "favicon/mstile" | relURL }}{{ $favVer }}.png'>
<meta name="application-name" content="{{ .Site.Title }}">
<meta name="msapplication-tooltip" content="{{ .Site.Params.Description }}">
<meta name="msapplication-config" content='{{ "/favicon/ieconfig.xml" | relURL }}'>
<meta name="msapplication-config" content='{{ "favicon/ieconfig.xml" | relURL }}'>
{{ end }}
8 changes: 4 additions & 4 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/skel/3.0.1/skel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.25/jquery.fancybox.min.js"></script>
<script src="{{ "js/util.js" | absURL }}"></script>
<script src="{{ "js/main.js" | absURL }}"></script>
<script src="{{ "js/backToTop.js" | absURL }}"></script>
<script src="{{ "js/util.js" | relURL }}"></script>
<script src="{{ "js/main.js" | relURL }}"></script>
<script src="{{ "js/backToTop.js" | relURL }}"></script>
{{ end }}

{{ if ne ($.Scratch.Get "jsFiles") false }}
{{ range $.Scratch.Get "jsFiles" }}
{{ if ne . "default" }}
<script src="{{ . | absURL }}"></script>
<script src="{{ . | relURL }}"></script>
{{ end }}
{{ end }}
{{ end }}
Expand Down
10 changes: 4 additions & 6 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,19 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway:400,800,900|Source+Sans+Pro:400,700">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.25/jquery.fancybox.min.css">
<link rel="stylesheet" href="{{ "css/main.css" | absURL }}">
<link rel="stylesheet" href="{{ "css/add-on.css" | absURL }}">
<link rel="stylesheet" href="{{ "css/main.css" | relURL }}">
<link rel="stylesheet" href="{{ "css/add-on.css" | relURL }}">
{{ end }}

{{ if ne ($.Scratch.Get "cssFiles") false }}
{{ range $.Scratch.Get "cssFiles" }}
{{ if ne . "default" }}
<link rel="stylesheet" href="{{ . | absURL }}">
<link rel="stylesheet" href="{{ . | relURL }}">
{{ end }}
{{ end }}
{{ end }}

{{ if not (in (printf "%#v" .Site.BaseURL) "localhost") }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
{{ template "_internal/google_analytics.html" . }}
</head>
<body>

Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Header -->
<header id="header">
{{ if .IsHome }}
<h1><a href="{{ .Site.BaseURL }}">{{ .Site.Params.navbarTitle }}</a></h1>
<h1><a href="{{ "/" | relURL }}">{{ .Site.Params.navbarTitle }}</a></h1>
{{ else if ne .Section "" }}
<h1><a href="{{ .Site.BaseURL }}">{{ .Section }}</a></h1>
<h1><a href="{{ "/" | relURL }}">{{ .Section }}</a></h1>
{{ else }}
<h1><a href="{{ .Site.BaseURL }}">{{ .Title }}</a></h1>
<h1><a href="{{ "/" | relURL }}">{{ .Title }}</a></h1>
{{ end }}

<nav class="links">
Expand Down Expand Up @@ -83,7 +83,7 @@ <h3>Recent Posts</h3>
{{ range first ($.Scratch.Get "postLimit") (where ($.Scratch.Get "recentPosts") "Type" "post") }}
<article class="mini-post">
<header>
<h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
{{ $.Scratch.Set "dateType" .Date }}
<time class="published" datetime=
'{{ ($.Scratch.Get "dateType").Format "2006-01-02" }}'>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h3>Recent Posts</h3>
<article class="mini-post">
<header>
<h3>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h3>
{{ $.Scratch.Set "dateType" .Date }}
<time class="published" datetime='{{ ($.Scratch.Get "dateType").Format "2006-01-02" }}'>
Expand Down
2 changes: 1 addition & 1 deletion layouts/post/content-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<footer>
<ul class="actions">
<li><a href="{{ .Permalink }}" class="button big">Continue Reading</a></li>
<li><a href="{{ .RelPermalink }}" class="button big">Continue Reading</a></li>
</ul>
{{ .Render "footer-category" }}
</footer>
Expand Down
2 changes: 1 addition & 1 deletion layouts/post/featured.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{ $alt := $.Scratch.Get "alt" }}
{{ $img := $.Scratch.Get "img" }}

<a href="{{ .Permalink }}" class="image featured">
<a href="{{ .RelPermalink }}" class="image featured">
<img src="{{ $path | relURL }}/{{ .Params.featured }}" alt="{{ $alt }}">
</a>
{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/post/header.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<header>
<div class="title">
{{ if $.Scratch.Get "h1" }}
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
{{ $.Scratch.Set "h1" false }}
{{ else }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ with .Description }}
<p>{{ . }}</p>
Expand Down
4 changes: 2 additions & 2 deletions layouts/post/prev-next.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<ul class="actions pagination">
{{ if .PrevInSection }}
<li><a href="{{ .PrevInSection.Permalink }}"
<li><a href="{{ .PrevInSection.RelPermalink }}"
class="button big previous">{{ .PrevInSection.Title }}</a></li>
{{ end }}

{{ if .NextInSection }}
<li><a href="{{ .NextInSection.Permalink }}"
<li><a href="{{ .NextInSection.RelPermalink }}"
class="button big next">{{ .NextInSection.Title }}</a></li>
{{ end }}
</ul>
2 changes: 1 addition & 1 deletion layouts/post/staticman.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ <h2>Say something</h2>
{{ with .Site.Params.staticman }}
<form class="post-new-comment" method="POST" action="https://dev.staticman.net/v2/entry/{{ .username }}/{{ .repo }}/{{ .branch }}/comments">
{{ end }}
<input type="hidden" name="options[redirect]" value="{{ .Permalink }}">
<input type="hidden" name="options[redirect]" value="{{ .RelPermalink }}">
<input type="hidden" name="options[entryId]" value="{{ .UniqueID }}">
<input required name="fields[name]" type="text" placeholder="Your name (Required)">
<input name="fields[website]" type="text" placeholder="Your website">
Expand Down