post-cover: add support for adding caption (#17)

* shown only on single page

usage =>
in page-vars front-matter

cover:
  image: '<image path/url>'
  alt: '<alt text>'
  caption: '<text>'
This commit is contained in:
Aditya Telange 2020-10-04 18:44:13 +05:30
parent 3068647f58
commit 35788daad1
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
2 changed files with 8 additions and 1 deletions

View File

@ -88,9 +88,15 @@
font-size: 14px; font-size: 14px;
} }
.entry-cover {
margin-bottom: var(--gap);
text-align: center;
font-size: 14px;
color: var(--secondary);
}
.entry-cover img { .entry-cover img {
border-radius: var(--radius); border-radius: var(--radius);
margin-bottom: var(--gap);
pointer-events: none; pointer-events: none;
width: 100%; width: 100%;
} }

View File

@ -33,6 +33,7 @@
{{- else}} {{- else}}
<img src="{{ .Permalink -}} {{- .Params.cover.image }}" alt="{{ .Params.cover.alt | plainify }}"> <img src="{{ .Permalink -}} {{- .Params.cover.image }}" alt="{{ .Params.cover.alt | plainify }}">
{{- end}} {{- end}}
<p>{{.Params.cover.caption}}</p>
</figure> </figure>
{{- end }} {{- end }}
{{- if .Params.ShowToc }} {{- if .Params.ShowToc }}