post-cover-image : add support for cover image for post

usage with post params =>
    cover = "<absolute image url>"
This commit is contained in:
Aditya Telange 2020-09-14 17:45:22 +05:30
parent ea94a8bd77
commit ab451ef89c
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
3 changed files with 17 additions and 0 deletions

View File

@ -90,6 +90,13 @@
font-size: 14px;
}
.entry-cover img {
border-radius: var(--radius);
margin-bottom: var(--gap);
pointer-events: none;
width: 100%;
}
.social-icons a {
margin: 2px;
padding: 6px;

View File

@ -32,6 +32,11 @@
{{- $class = "post-entry tag-entry" }}
{{- end }}
<article class="{{ $class }}">
{{ if .Params.cover }}
<figure class="entry-cover">
<img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title }}">
</figure>
{{ end }}
<header class="entry-header">
<h2>
{{ .Title }}

View File

@ -14,6 +14,11 @@
</div>
{{end}}
</header>
{{ if .Params.cover }}
<figure class="entry-cover">
<img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title | plainify }}">
</figure>
{{ end }}
{{ if .Params.ShowToc }}
<div class="toc">
<details>