diff options
author | zzossig <zzossig@gmail.com> | 2020-10-21 02:59:02 +0300 |
---|---|---|
committer | zzossig <zzossig@gmail.com> | 2020-10-21 02:59:02 +0300 |
commit | 8bfeed9247f03d5a795ec7c603e9ee89137b164d (patch) | |
tree | b08f86a012421042fbc0746df2f256b98ff6e4fd /layouts | |
parent | a8b283e1f49e287408aaf06c79cc5c1c29849d48 (diff) |
css fix, featuredImage shortcode, edit-this-page bug fix, exampleSite update
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/main/component/edit-this-page.html | 13 | ||||
-rw-r--r-- | layouts/shortcodes/featuredImage.html | 14 |
3 files changed, 23 insertions, 6 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e553375..b097c04 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,5 +1,5 @@ {{ define "header" }} - {{ partial "main/header.html" . }} + {{ partial "main/header.html" . }} {{ end }} {{ define "main" }} {{ partial "main/single.html" . }} diff --git a/layouts/partials/main/component/edit-this-page.html b/layouts/partials/main/component/edit-this-page.html index edc27ab..03d3791 100644 --- a/layouts/partials/main/component/edit-this-page.html +++ b/layouts/partials/main/component/edit-this-page.html @@ -1,7 +1,10 @@ {{ if $.Param "enableEditBtn" }} - <a href="{{ $.Param "editBaseURL" }}{{ strings.TrimSuffix "/" (.Permalink | relLangURL) }}.md" target="_blank" rel="noreferrer"> - <button class="editBtn" aria-label="Edit This Page Button"> - {{ i18n "edit-this-page" | default "EDIT THIS PAGE" }} - </button> - </a> + {{ $root := .}} + {{ with .FirstSection }} + <a href="{{ .Params.editBaseURL | default ($.Param "editBaseURL") }}{{ strings.TrimSuffix "/" ($root.Permalink | relLangURL) }}.md" target="_blank" rel="noreferrer"> + <button class="editBtn" aria-label="Edit This Page Button"> + {{ i18n "edit-this-page" | default "EDIT THIS PAGE" }} + </button> + </a> + {{ end }} {{ end }}
\ No newline at end of file diff --git a/layouts/shortcodes/featuredImage.html b/layouts/shortcodes/featuredImage.html new file mode 100644 index 0000000..b7c8a1d --- /dev/null +++ b/layouts/shortcodes/featuredImage.html @@ -0,0 +1,14 @@ +{{ $imgSrc := false }} +{{ $params := $.Page.Params }} + +{{ if $params.image }} + {{ $imgSrc = $params.image }} +{{ else if $params.featured_image }} + {{ $imgSrc = (print "images/" $params.featured_image) }} +{{ end }} + +{{ if $imgSrc }} + <div class="featured-image__wrapper"> + <img src="{{ $imgSrc | relURL }}" alt="{{ (.Get "alt") | default "Featured Image" }}" class="featured-image" style="width: {{ with (.Get "width") }}{{ . }}px{{ end }};height: {{ with (.Get "height") }}{{ . }}px{{ end }};"> + </div> +{{ end }}
\ No newline at end of file |