mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-15 04:45:08 +01:00
Merge pull request #225 from thomasjsn/master
Move post cover to partial
This commit is contained in:
commit
e6504a8bd7
@ -47,17 +47,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Params.Cover }}
|
{{ if .Params.Cover }}
|
||||||
<figure class="post-cover">
|
{{ partial "postcover.html" . }}
|
||||||
{{ if .Params.UseRelativeCover }}
|
|
||||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
|
|
||||||
{{ else }}
|
|
||||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ if .Params.CoverCaption }}
|
|
||||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
|
||||||
{{ end }}
|
|
||||||
</figure>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
@ -35,17 +35,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Params.Cover }}
|
{{ if .Params.Cover }}
|
||||||
<figure class="post-cover">
|
{{ partial "postcover.html" . }}
|
||||||
{{ if .Params.UseRelativeCover }}
|
|
||||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
|
|
||||||
{{ else }}
|
|
||||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ if .Params.CoverCaption }}
|
|
||||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
|
||||||
{{ end }}
|
|
||||||
</figure>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
@ -39,17 +39,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Params.Cover }}
|
{{ if .Params.Cover }}
|
||||||
<figure class="post-cover">
|
{{ partial "postcover.html" . }}
|
||||||
{{ if .Params.UseRelativeCover }}
|
|
||||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
|
|
||||||
{{ else }}
|
|
||||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ if .Params.CoverCaption }}
|
|
||||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
|
||||||
{{ end }}
|
|
||||||
</figure>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
11
layouts/partials/postcover.html
Normal file
11
layouts/partials/postcover.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<figure class="post-cover">
|
||||||
|
{{ if .Params.UseRelativeCover }}
|
||||||
|
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
|
||||||
|
{{ else }}
|
||||||
|
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Params.CoverCaption }}
|
||||||
|
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
||||||
|
{{ end }}
|
||||||
|
</figure>
|
Loading…
Reference in New Issue
Block a user