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 = [ tags = [
"awesome", "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; margin-bottom: 10px;
} }
.post-title a {
color: inherit;
text-decoration: inherit;
}
.post-description { .post-description {
padding-top: 10px; padding-top: 10px;
} }
.post-title a { .post-image {
color: inherit; padding-top: 15px;
text-decoration: inherit;
} }
.readmore { .readmore {
@ -82,6 +86,11 @@ body {
max-width: 720px; max-width: 720px;
} }
img:not(.noborder) {
padding: 5px;
border: 5px solid #1b5b9b;
}
a { a {
color: #4da6ff; color: #4da6ff;
text-decoration: inherit; text-decoration: inherit;

View File

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