Add the ability to feature an image in an article on list pages

This commit is contained in:
BBaoVanC 2021-10-06 17:34:55 -05:00
parent 02fcd97a9a
commit 2490ebe6d9
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
3 changed files with 24 additions and 3 deletions

View File

@ -11,4 +11,10 @@ Lorem ipsum
tags = [
"awesome",
]
# this image will be shown for the article in list pages
[[resources]]
name = "feature"
src = "gui.webp"
title = "Checkra1n GUI running on Arch Linux"
+++

View File

@ -7,13 +7,17 @@
margin-bottom: 10px;
}
.post-title a {
color: inherit;
text-decoration: inherit;
}
.post-description {
padding-top: 10px;
}
.post-title a {
color: inherit;
text-decoration: inherit;
.post-image {
padding-top: 15px;
}
.readmore {
@ -82,6 +86,11 @@ body {
max-width: 720px;
}
img:not(.noborder) {
padding: 5px;
border: 5px solid #1b5b9b;
}
a {
color: #4da6ff;
text-decoration: inherit;

View File

@ -66,6 +66,12 @@
</div>
{{ end }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-image">
<img src="{{ .Permalink }}" alt="{{ .Title }}" />
</div>
{{ end }}
<div class="post-description">
{{ if .Description }}
{{ .Description | markdownify }}