mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-14 20:35:07 +01:00
move post cover to partial
This commit is contained in:
parent
2c2588d1c6
commit
02105f748b
@ -47,17 +47,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<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>
|
||||
{{ partial "postcover.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
|
@ -35,17 +35,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<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>
|
||||
{{ partial "postcover.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
|
@ -39,17 +39,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<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>
|
||||
{{ partial "postcover.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<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