Вывод картинки поста и описания в боковой панели
All checks were successful
Build and deploy mmote.ru / Build-And-Deploy (push) Successful in 22s

This commit is contained in:
MultiMote 2024-06-02 15:20:23 +03:00
parent b48d98b067
commit 1f80adaf1f
3 changed files with 26 additions and 16 deletions

View File

@ -45,14 +45,19 @@
"type": "categories" "type": "categories"
}, },
{ {
"title": "featured_image", "title": "Thumbnail",
"name": "Thumbnail", "name": "featured_image",
"type": "image" "type": "image"
}, },
{ {
"title": "lastmod", "title": "Last modified",
"name": "Last modified", "name": "lastmod",
"type": "datetime" "type": "datetime"
},
{
"title": "Telegram Entry ID (channel/id)",
"name": "telegram_entry_id",
"type": "string"
} }
] ]
} }

View File

@ -204,6 +204,8 @@ section.posts {
} }
.toc { .toc {
margin-top: 1em;
ul { ul {
list-style-position: inside; list-style-position: inside;
margin: 0; margin: 0;
@ -224,6 +226,10 @@ section.posts {
p { p {
margin: 0; margin: 0;
} }
img {
max-width: 100%;
}
} }
} }

View File

@ -1,22 +1,21 @@
<section class="sidebar"> <section class="sidebar">
{{ if .IsPage }}
<div class="item"> <div class="item">
<h4>Будь осторожен!</h4> {{- $thumb := .Page.Resources.Get .Params.featured_image -}}
<p> {{if $thumb}}
Это минимальный набор всего, <img class="thumb" alt="thumb" src="{{ ($thumb.Fit "300x300").RelPermalink }}">
чтобы начать работать с сайтом. {{end}}
</p>
<p> {{ with .Description }}
Согласен, лучше не стало. Но всё ещё впереди. <div>{{ . }}</div>
</p> {{ end }}
</div>
{{ if strings.Contains .TableOfContents "li" }} {{ if strings.Contains .TableOfContents "li" }}
<div class="item">
<h4>Содержание</h4>
<div class="toc"> <div class="toc">
{{ .TableOfContents }} {{ .TableOfContents }}
</div> </div>
{{ end }}
</div> </div>
{{ end }} {{ end }}