Вывод картинки поста и описания в боковой панели
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"
},
{
"title": "featured_image",
"name": "Thumbnail",
"title": "Thumbnail",
"name": "featured_image",
"type": "image"
},
{
"title": "lastmod",
"name": "Last modified",
"title": "Last modified",
"name": "lastmod",
"type": "datetime"
},
{
"title": "Telegram Entry ID (channel/id)",
"name": "telegram_entry_id",
"type": "string"
}
]
}

View File

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

View File

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