Fix #3: add categories support
This commit is contained in:
parent
2b7ab07c57
commit
95d551b945
10
i18n/en.yaml
10
i18n/en.yaml
@ -17,13 +17,19 @@ tag:
|
||||
other: "tag"
|
||||
|
||||
Tags:
|
||||
other: "tags"
|
||||
other: "Tags"
|
||||
|
||||
Posts:
|
||||
other: "Posts"
|
||||
|
||||
category:
|
||||
other: "category"
|
||||
|
||||
Categories:
|
||||
other: "Categories"
|
||||
|
||||
toAllTags:
|
||||
other: "To all tags"
|
||||
other: "to all tags"
|
||||
|
||||
toAllCategories:
|
||||
other: "to all categories"
|
10
i18n/ru.yaml
10
i18n/ru.yaml
@ -14,7 +14,7 @@ toOldPosts:
|
||||
other: "к старым записям"
|
||||
|
||||
tag:
|
||||
other: "Тег"
|
||||
other: "тег"
|
||||
|
||||
Tags:
|
||||
other: "Теги"
|
||||
@ -22,8 +22,14 @@ Tags:
|
||||
Posts:
|
||||
other: "Записи"
|
||||
|
||||
category:
|
||||
other: "Категория"
|
||||
|
||||
Categories:
|
||||
other: "Категории"
|
||||
|
||||
toAllTags:
|
||||
other: "Ко списку всех тегов"
|
||||
other: "ко списку всех тегов"
|
||||
|
||||
toAllCategories:
|
||||
other: "ко списку всех категорий"
|
@ -14,6 +14,16 @@
|
||||
{{ if .Params.date }}
|
||||
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
|
||||
{{ end }}
|
||||
{{ if .Params.categories }}
|
||||
<ul class="article-categories">
|
||||
{{ range .Params.categories }}
|
||||
<li><a href="/categories/{{ . }}">{{ . }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ if and (.Params.categories) (.Params.tags) }}
|
||||
|
|
||||
{{ end }}
|
||||
{{ if .Params.tags }}
|
||||
<ul class="article-tags">
|
||||
{{ range .Params.tags }}
|
||||
|
@ -9,6 +9,16 @@
|
||||
{{ if .Params.date }}
|
||||
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
|
||||
{{ end }}
|
||||
{{ if .Params.categories }}
|
||||
<ul class="article-categories">
|
||||
{{ range .Params.categories }}
|
||||
<li><a href="/categories/{{ . }}">{{ . }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ if and (.Params.categories) (.Params.tags) }}
|
||||
|
|
||||
{{ end }}
|
||||
{{ if .Params.tags }}
|
||||
<ul class="article-tags">
|
||||
{{ range .Params.tags }}
|
||||
|
@ -12,6 +12,16 @@
|
||||
{{ if .Params.date }}
|
||||
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
|
||||
{{ end }}
|
||||
{{ if .Params.categories }}
|
||||
<ul class="article-categories">
|
||||
{{ range .Params.categories }}
|
||||
<li><a href="/categories/{{ . }}">{{ . }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ if and (.Params.categories) (.Params.tags) }}
|
||||
|
|
||||
{{ end }}
|
||||
{{ if .Params.tags }}
|
||||
<ul class="article-tags">
|
||||
{{ range .Params.tags }}
|
||||
|
28
layouts/taxonomy/category.html
Normal file
28
layouts/taxonomy/category.html
Normal file
@ -0,0 +1,28 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<h1>{{ i18n "category" | humanize }}: {{ .Title }}</h1>
|
||||
<div class="article-info">
|
||||
<a href="/categories/">{{ i18n "toAllCategories" | humanize }}</a>
|
||||
</div>
|
||||
{{ range .Data.Pages }}
|
||||
<article class="post-list">
|
||||
<header>
|
||||
<h1>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<div class="article-info">
|
||||
{{ if .Params.date }}
|
||||
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ .Summary }}
|
||||
<div class="read-more">
|
||||
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
@ -159,6 +159,18 @@ article header h1 a {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.article-categories {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.article-categories li {
|
||||
display: inline;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.article-tags {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
|
Loading…
Reference in New Issue
Block a user