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

github.com/amzrk2/hugo-theme-fuji.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramzrk2 <amzrk2@outlook.com>2020-07-24 04:17:09 +0300
committeramzrk2 <amzrk2@outlook.com>2020-07-24 04:17:09 +0300
commit9897eff5d4fe78e26efd5e362cd32672575fae14 (patch)
treeb0ecc5483044a81e8185a2606ded2084ea6b0db7 /layouts
parent3483f357ac417d7418461c01a5ab1cfc91816431 (diff)
Fix image relative link issue
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/_markup/render-image.html2
-rw-r--r--layouts/shortcodes/img-lazy.html6
-rw-r--r--layouts/shortcodes/img-nz-lazy.html12
-rw-r--r--layouts/shortcodes/img-nz.html4
4 files changed, 12 insertions, 12 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index 397ff55..ab7aa31 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -1 +1 @@
-<img class="img-zoomable" src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
+<img class="img-zoomable" src="{{ .Destination | relURL | safeURL }}" alt="{{ .Text }}" />
diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html
index a8927a5..bac255b 100644
--- a/layouts/shortcodes/img-lazy.html
+++ b/layouts/shortcodes/img-lazy.html
@@ -2,21 +2,21 @@
<img
class="lazyload img-zoomable"
src="{{ .Site.Params.lazyPlaceholder | relURL }}"
- data-src="{{ index .Params 1 }}"
+ data-src="{{ index .Params 1 | relURL | safeURL }}"
alt="{{ index .Params 0 }}"
/>
{{ else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" }}
<img
class="lazyload img-zoomable"
src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
{{ else if eq (index .Params 0) "col" }}
<img
class="lazyload img-zoomable"
src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
{{ else }}{{ end }}{{ else }}{{ end }}
diff --git a/layouts/shortcodes/img-nz-lazy.html b/layouts/shortcodes/img-nz-lazy.html
index a606f51..8a46329 100644
--- a/layouts/shortcodes/img-nz-lazy.html
+++ b/layouts/shortcodes/img-nz-lazy.html
@@ -2,21 +2,21 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholder | relURL }}"
- data-src="{{ index .Params 1 }}"
+ data-src="{{ index .Params 1 | relURL | safeURL }}"
alt="{{ index .Params 0 }}"
/>
{{ else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" }}
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
{{ else if eq (index .Params 0) "col" }}
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
{{ else }}
@@ -24,7 +24,7 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholder | relURL }}"
- data-src="{{ index .Params 1 }}"
+ data-src="{{ index .Params 1 | relURL | safeURL }}"
alt="{{ index .Params 0 }}"
/>
</a>
@@ -33,7 +33,7 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
</a>
@@ -42,7 +42,7 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
</a>
diff --git a/layouts/shortcodes/img-nz.html b/layouts/shortcodes/img-nz.html
index 30ea28a..2e4b3af 100644
--- a/layouts/shortcodes/img-nz.html
+++ b/layouts/shortcodes/img-nz.html
@@ -1,7 +1,7 @@
{{ if (index .Params 2) }}
<a href="{{ index .Params 2 }}" target="_blank">
- <img src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
+ <img src="{{ index .Params 1 | relURL | safeURL }}" alt="{{ index .Params 0 }}" />
</a>
{{ else }}
-<img src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
+<img src="{{ index .Params 1 | relURL | safeURL }}" alt="{{ index .Params 0 }}" />
{{ end }}