Вывод содержания в боковой панели
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", "title": "Categories",
"name": "categories", "name": "categories",
"type": "categories" "type": "categories"
},
{
"title": "featured_image",
"name": "Thumbnail",
"type": "image"
},
{
"title": "lastmod",
"name": "Last modified",
"type": "datetime"
} }
] ]
} }
@ -54,4 +64,4 @@
"filePrefix": "" "filePrefix": ""
} }
] ]
} }

View File

@ -203,7 +203,18 @@ section.posts {
margin-bottom: 16px; 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-type: "- ";
list-style-position: inside; list-style-position: inside;
padding: 0; padding: 0;

View File

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