diff options
| author | Eltrac <hi@guhub.cn> | 2025-02-06 11:40:49 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-02-06 11:40:49 +0800 |
| commit | 80e1228da549dd41d01e1152355bf01f10e3f170 (patch) | |
| tree | 916db402a711e668255c005f559b4ac29fe4cef6 | |
| parent | 7eabfa47b266548e058f1cb0dfd0dfb7590811e0 (diff) | |
feat: post banner
| -rw-r--r-- | layouts/_default/single.html | 1 | ||||
| -rw-r--r-- | layouts/partials/components/banner.html | 12 |
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 }} |
