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

This commit is contained in:
MultiMote 2024-06-01 23:57:11 +03:00
parent ed2238d5a6
commit b48d98b067
3 changed files with 40 additions and 7 deletions

View File

@ -43,6 +43,16 @@
"title": "Categories",
"name": "categories",
"type": "categories"
},
{
"title": "featured_image",
"name": "Thumbnail",
"type": "image"
},
{
"title": "lastmod",
"name": "Last modified",
"type": "datetime"
}
]
}
@ -54,4 +64,4 @@
"filePrefix": ""
}
]
}
}

View File

@ -203,7 +203,18 @@ section.posts {
margin-bottom: 16px;
}
ul {
.toc {
ul {
list-style-position: inside;
margin: 0;
padding-left: 0;
}
ul ul {
padding-left: 1em;
}
}
.categories ul {
list-style-type: "- ";
list-style-position: inside;
padding: 0;

View File

@ -10,13 +10,25 @@
Согласен, лучше не стало. Но всё ещё впереди.
</p>
</div>
{{ if strings.Contains .TableOfContents "li" }}
<div class="item">
<h4>Содержание</h4>
<div class="toc">
{{ .TableOfContents }}
</div>
</div>
{{ end }}
<div class="item">
<h4>Категории</h4>
<ul>
{{ range .Site.Taxonomies.categories }}
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> {{/* .Count */}}</li>
{{ end }}
</ul>
<div class="categories">
<ul>
{{ range .Site.Taxonomies.categories }}
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> {{/* .Count */}}</li>
{{ end }}
</ul>
</div>
</div>
<div class="item">
<p>