Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dldx/hpstr-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDurand D'souza <durand1@gmail.com>2016-10-18 04:50:48 +0300
committerDurand D'souza <durand1@gmail.com>2016-10-18 04:50:48 +0300
commitdc139bee47a438a91e03902cd3371a42e228ec54 (patch)
tree71ae0e78f3de715cf320d86e24e5e673b16ebbd2
parentfd3ce438cf769abdce0f306c4c0e0bd270f3e739 (diff)
Fixed absURLs in places where specifying an external image messed up
-rw-r--r--exampleSite/config.toml2
-rw-r--r--layouts/_default/list.html4
-rw-r--r--layouts/_default/single.html4
-rw-r--r--layouts/partials/head.html2
-rw-r--r--layouts/partials/navigation.html2
5 files changed, 7 insertions, 7 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index e34a56d..24e0213 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -16,6 +16,6 @@ relativeurls = true
bio = "A static site generator written in Go"
github = "spf13/hugo"
[params.image]
- feature = "abstract-1.jpg"
+ feature = "/images/abstract-1.jpg"
credit = "dargadgetz"
creditlink = "http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/"
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index b376cb1..5c3bb8e 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -6,7 +6,7 @@
{{ $imageparams := index ($.Scratch.Get "Params") "image" }}
{{ if $imageparams.credit }}<div class="image-credit">Image source: <a href="{{ $imageparams.creditlink }}">{{ $imageparams.credit }}</a></div><!-- /.image-credit -->{{ end }}
<div class="entry-image">
- <img src="{{ .Site.BaseURL }}{{ $imageparams.feature }}" alt="{{ .Title }}">
+ <img src="{{ $imageparams.feature | absURL }}" alt="{{ .Title }}">
</div><!-- /.entry-image -->
{{ end }}
<div class="header-title">
@@ -34,7 +34,7 @@
<header>
{{ if .Params.image.feature }}
<div class="entry-image-index">
- <a href="{{ .Permalink }}" title="{{ .Title }}"><img src="{{ .Site.BaseURL }}{{ .Params.image.feature }}" alt="{{ .Title }}"></a>
+ <a href="{{ .Permalink }}" title="{{ .Title }}"><img src="{{ .Params.image.feature | absURL }}" alt="{{ .Title }}"></a>
</div><!-- /.entry-image -->
{{ end }}
<div class="entry-meta">
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 549d709..8cee4d9 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -6,7 +6,7 @@
{{ $imageparams := index ($.Scratch.Get "Params") "image" }}
{{ if $imageparams.credit }}<div class="image-credit">Image credit: <a {{ with $imageparams.creditlink }}href="{{ . }}"{{ end }}>{{ $imageparams.credit }}</a></div><!-- /.image-credit -->{{ end }}
<div class="entry-image">
- <img src="{{ .Site.BaseURL }}{{ $imageparams.feature }}" alt="{{ .Title }}">
+ <img src="{{ $imageparams.feature | absURL }}" alt="{{ .Title }}">
</div><!-- /.entry-image -->
</div><!-- /.entry-header -->
{{ end }}
@@ -36,7 +36,7 @@
<span class="entry-tags">{{ range .Params.tags }}<a href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}" title="Pages tagged {{ . }}" class="tag"><span class="term">{{ . }}</span></a>{{ end }}</span>
{{ end }}
{{ if gt .Lastmod .Date }}<span>Updated on <span class="entry-date date updated"><time datetime="{{ .Lastmod }}">{{ .Lastmod.Format "Jan 2, 2006" }}</time></span></span>
- <span class="author vcard"><span class="fn">{{ $.Site.Author }}</span></span>{{ end }}
+ <span class="author vcard"><span class="fn">{{ $.Site.Params.author.name }}</span></span>{{ end }}
{{ if not (eq .Params.share false) }}{{ partial "share.html" . }}{{ end }}
</footer>
</div><!-- /.entry-content -->
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index b7edc5b..f8da399 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -48,6 +48,6 @@
{{ $.Scratch.Set "Params" .Params }}
{{ end }}
{{ with .Params.background }}
-<style type="text/css">body {background-image:url({{ $.Site.BaseURL }}{{ . }});}</style>
+<style type="text/css">body {background-image:url({{ . | absURL }});}</style>
{{ end }}
</head>
diff --git a/layouts/partials/navigation.html b/layouts/partials/navigation.html
index 30b0234..cc233d5 100644
--- a/layouts/partials/navigation.html
+++ b/layouts/partials/navigation.html
@@ -8,7 +8,7 @@
{{ with .Site.Params.author }}
<li>
{{ if isset . "avatar" }}
- <img src="{{ .Site.BaseURL }}/images/{{ .avatar }}" alt="{{ .name }}'s photo" class="author-photo">
+ <img src="{{ .Site.BaseURL }}{{ .avatar }}" alt="{{ .name }}'s photo" class="author-photo">
{{ end }}
<h4>{{ .name }}</h4>
<p>{{ .bio }}</p>