diff options
author | Dillon <dillonzq@outlook.com> | 2020-02-03 06:46:30 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-02-03 06:46:30 +0300 |
commit | 8aba2262906628f38f114a9947783bc6c7fd7495 (patch) | |
tree | 445b65d993aa2e82c2e6c97c48fb23fd6d1bd053 /layouts/_default/_markup | |
parent | b91ca3d61ac77d3bec257325682a82729e00890d (diff) |
feat(partial): add hook and image partial
Diffstat (limited to 'layouts/_default/_markup')
-rw-r--r-- | layouts/_default/_markup/render-image.html | 13 | ||||
-rw-r--r-- | layouts/_default/_markup/render-link.html | 9 |
2 files changed, 3 insertions, 19 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 193374d..c143d1d 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,15 +1,6 @@ <figure> - <img - {{ $res := resources.Get "svg/loading.svg" | minify -}} - src="{{ $res.RelPermalink }}" - data-sizes="auto" - data-src="{{ .Destination | safeURL }}" - alt="{{ .Text }}" - {{ with .Title -}} - title="{{ . }}" - {{ end -}} - class="lazyload" - > + {{- $loading := resources.Get "svg/loading.svg" | minify -}} + <img src="{{ $loading.RelPermalink }}" data-sizes="auto" data-src="{{ .Destination | safeURL }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }} class="lazyload"> <figcaption class="image-caption"> {{- if .Title -}} {{- .Title -}} diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index d3224c2..01f37d1 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,10 +1,3 @@ -<a href="{{ .Destination | safeURL }}" - {{ with .Title -}} - title="{{ . }}" - {{ end -}} - {{ if strings.HasPrefix .Destination "http" -}} - target="_blank" - {{ end -}} - > +<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}> {{- .Text | safeHTML -}} </a>
\ No newline at end of file |