mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-12-25 15:29:27 +01:00
Add coverCaption param to post frontmatter
This commit is contained in:
parent
149fb37220
commit
d4d477e3b6
@ -188,6 +188,7 @@ Adding a cover image to your post is simple and there are two options when you e
|
||||
* Resulting in `https://www.yourpage.com/path/to/absolute/img.jpg`
|
||||
* Use `cover = "img.jpg"` and `useRelativeCover = true` to link the image relative to the blog post folder
|
||||
* Resulting in `https://www.yourpage.com/posts/blog-entry-xy/img.jpg`
|
||||
* Use `coverCaption = "Image Credit to [Barry Bluejeans](https://unsplash.com/)"` to add a caption for the cover image.
|
||||
|
||||
## How to display the Last Modified Date in your posts
|
||||
|
||||
|
@ -32,11 +32,17 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
{{ if .Params.UseRelativeCover }}
|
||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" class="post-cover" />
|
||||
{{ else }}
|
||||
<img src="{{ .Params.Cover | absURL }}" class="post-cover" />
|
||||
{{ end }}
|
||||
<figure class="post-cover">
|
||||
{{ if .Params.UseRelativeCover }}
|
||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" />
|
||||
{{ else }}
|
||||
<img src="{{ .Params.Cover | absURL }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.CoverCaption }}
|
||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
|
@ -55,7 +55,10 @@
|
||||
margin: 40px -50px;
|
||||
width: 860px;
|
||||
max-width: 860px;
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
|
||||
|
||||
img {
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
@media (--tablet) {
|
||||
margin: 20px 0;
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user