Skip to content

Commit

Permalink
change to absurl
Browse files Browse the repository at this point in the history
  • Loading branch information
eueung committed Dec 30, 2017
1 parent 8dfc67d commit 41571aa
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ languageCode = "en-US"
disqusShortname = ""
paginate = 6
#SectionPagesMenu = "main"
canonifyurls = true

[params]
title = "Hugo Casper Two"
Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<article class="post-card post">
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url(/defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>

<div class="post-card-content">
Expand Down
10 changes: 5 additions & 5 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="shortcut icon" href="{{ "favicon.ico" | relURL}}" />
<link rel="shortcut icon" href="{{ "favicon.ico" | absURL}}" />
<link rel="canonical" href="{{ .Permalink }}" />

{{ if .IsPage }} <meta name="description" content="{{ .Description | default (substr .Summary 0 160) }}" /> {{ else }}
Expand All @@ -21,11 +21,11 @@
{{ .Hugo.Generator }}

{{ "<!-- Stylesheets -->" | safeHTML }}
<link rel="stylesheet" type="text/css" href="{{ "built/screen.css" | relURL}}" />
<link rel="stylesheet" type="text/css" href="{{ "css/casper-two.css" | relURL}}" />
<link rel="stylesheet" type="text/css" href="{{ "built/screen.css" | absURL}}" />
<link rel="stylesheet" type="text/css" href="{{ "css/casper-two.css" | absURL}}" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" />
{{ range .Site.Params.customCSS }} <link rel="stylesheet" href="{{ . | relURL }}" /> {{ end }}
{{ range .Site.Params.customCSS }} <link rel="stylesheet" href="{{ . | absURL }}" /> {{ end }}

{{ if .Site.Params.RSSLink}}<link href="{{.Site.Params.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> {{else}}{{ if eq .URL "/" }}<link href="{{ "index.xml" | relURL}}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> {{ end }} {{ end }}
{{ if .Site.Params.RSSLink}}<link href="{{.Site.Params.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> {{else}}{{ if eq .URL "/" }}<link href="{{ "index.xml" | absURL}}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> {{ end }} {{ end }}

</head>
6 changes: 3 additions & 3 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<header class="site-header outer " {{if .Site.Params.cover}} style="background-image: url({{.Site.Params.cover | relURL}})" {{end}} >
<header class="site-header outer " {{if .Site.Params.cover}} style="background-image: url({{.Site.Params.cover | absURL}})" {{end}} >
<div class="inner">
<div class="site-header-content">
<h1 class="site-title">{{ if .Site.Params.logo }}
<img class="site-logo" src="{{ .Site.Params.logo | relURL}}" alt="{{ .Site.Params.title }}" />
<img class="site-logo" src="{{ .Site.Params.logo | absURL}}" alt="{{ .Site.Params.title }}" />
{{else}} {{ .Site.Params.title }} {{end}} </h1>
<h2 class="site-description">{{ .Site.Params.subtitle }} </h2>
</div>
Expand All @@ -29,7 +29,7 @@ <h2 class="site-description">{{ .Site.Params.subtitle }} </h2>
{{ if .Site.Params.RSSLink}}
<a class="subscribe-button" href="{{.Site.Params.RSSLink }}">Subscribe</a> </div>
{{else}}
<a class="subscribe-button" href="{{if .IsNode}}{{.RSSLink}}{{else}}{{"index.xml" | relURL}}{{end}}">Subscribe</a>
<a class="subscribe-button" href="{{if .IsNode}}{{.RSSLink}}{{else}}{{"index.xml" | absURL}}{{end}}">Subscribe</a>
{{end}}
</div>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/js.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="{{ "js/jquery.fitvids.js" | relURL}}"></script>
<script type="text/javascript" src="{{ "js/jquery.fitvids.js" | absURL}}"></script>

<script>hljs.initHighlightingOnLoad();</script>

Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/meta-facebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
<meta property="og:type" content="website" />
<meta property="og:description" content="{{ .Site.Params.description }}" />
{{ end }}{{if .Params.image }}
<meta property="og:image" content="{{ .Params.image | relURL}}"/>
<meta property="og:image" content="{{ .Params.image | absURL}}"/>
{{else}}{{if .Site.Params.cover}}
<meta property="og:image" content="{{ .Site.Params.cover | relURL}}"/>{{end}}{{end}}
<meta property="og:image" content="{{ .Site.Params.cover | absURL}}"/>{{end}}{{end}}
4 changes: 2 additions & 2 deletions layouts/partials/meta-twitter.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{ if .IsPage }} <!-- Credit V JEANTET -->
{{ with .Params.image }}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ . | relURL }}"/>
<meta name="twitter:image" content="{{ . | absURL }}"/>
{{ else }}
<meta name="twitter:card" content="summary"/>
{{ end }}
{{ else }}
<meta name="twitter:card" content="summary"/>
{{ with .Site.Params.cover }}<meta name="twitter:image" content="{{ . | relURL }}"/>{{ end }}
{{ with .Site.Params.cover }}<meta name="twitter:image" content="{{ . | absURL }}"/>{{ end }}
{{ end }} <!-- Twitter Card data -->
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{if .IsPage}}{{ .Description | default (substr .Summary 0 160) }}{{ else }}{{ .Site.Params.description }}{{ end }}"/>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/page-single.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<article class="post-card post">
{{if .Params.image}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{.Params.image | relURL}})"></div>
<div class="post-card-image" style="background-image: url({{.Params.image | absURL}})"></div>
</a>
{{else}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url(/defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>
{{end}}

Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/post-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<article class="post-card post">
{{if .Params.image}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{.Params.image | relURL}})"></div>
<div class="post-card-image" style="background-image: url({{.Params.image | absURL}})"></div>
</a>
{{else}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url(/defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>
{{end}}

Expand All @@ -30,8 +30,8 @@ <h2 class="post-card-title">{{.Title}}</h2>
</a>

<footer class="post-card-meta">
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | relURL}}" alt="Ghost" />
<span class="post-card-author"><a href="/author/ghost/">{{.Params.author | default .Site.Params.author}}</a></span>
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | absURL}}" alt="Author" />
<span class="post-card-author"><a href="/">{{.Params.author | default .Site.Params.author}}</a></span>
</footer>
</div>
</article>
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/post-single.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<article class="post-card post">
{{if .Params.image}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{.Params.image | relURL}})"></div>
<div class="post-card-image" style="background-image: url({{.Params.image | absURL}})"></div>
</a>
{{else}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url(/defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>
{{end}}

Expand All @@ -23,8 +23,8 @@ <h2 class="post-card-title">{{.Title}}</h2>
</section>

<footer class="post-card-meta">
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | relURL}}" alt="Ghost" />
<span class="post-card-author"><a href="/author/ghost/">{{.Params.author | default .Site.Params.author}}</a></span>
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | absURL}}" alt="Author" />
<span class="post-card-author"><a href="/">{{.Params.author | default .Site.Params.author}}</a></span>
</footer>
</div>
</article>

0 comments on commit 41571aa

Please sign in to comment.