summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-02-06 11:40:49 +0800
committerEltrac <hi@guhub.cn>2025-02-06 11:40:49 +0800
commitfa29c0987a887ea1f70dd3f244c9300de8662493 (patch)
treef6616887ad1c837413534345766f1ef0e3d16eb1
parentdbb3c7471c5183c9a5eaef44966073f312f0701d (diff)
feat: post banner
Former-commit-id: 80e1228da549dd41d01e1152355bf01f10e3f170
-rw-r--r--layouts/_default/single.html1
-rw-r--r--layouts/partials/components/banner.html12
2 files changed, 13 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index f1e37444..3733936e 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -8,6 +8,7 @@
<!-- Post Header -->
<header class="post-header">
{{ if in .Site.Params.mainSections .Type }}
+ {{ partial "components/banner.html" . }}
<!-- Title and Subtitle -->
<h1 class="post-title">
{{ .Title }}
diff --git a/layouts/partials/components/banner.html b/layouts/partials/components/banner.html
new file mode 100644
index 00000000..c4f27c01
--- /dev/null
+++ b/layouts/partials/components/banner.html
@@ -0,0 +1,12 @@
+{{ with .Params.banner }}
+<div class="post-banner">
+ <img src="{{ . }}">
+</div>
+<style>
+.post-banner img {
+ width: 100%;
+ height: auto;
+ display: block;
+}
+</style>
+{{ end }}