Add See Next section #44
This commit is contained in:
parent
5c94f0297f
commit
4503d1b7a3
@ -20,6 +20,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
|
|||||||
- ISSO
|
- ISSO
|
||||||
- Utteranc.es
|
- Utteranc.es
|
||||||
- RSS feeds
|
- RSS feeds
|
||||||
|
- Related posts (Read Next section)
|
||||||
- Deploy via Netlify (config included in example site)
|
- Deploy via Netlify (config included in example site)
|
||||||
- Hiding posts from the RSS feed
|
- Hiding posts from the RSS feed
|
||||||
- Hidden posts (available only by link)
|
- Hidden posts (available only by link)
|
||||||
@ -82,7 +83,8 @@ params:
|
|||||||
dateFormat: "2006-01-02"
|
dateFormat: "2006-01-02"
|
||||||
paginationSinglePost: true
|
paginationSinglePost: true
|
||||||
style: light-without-switcher
|
style: light-without-switcher
|
||||||
readMore: false
|
readMore: false # show read more button
|
||||||
|
readNextPosts: 5 # show 5 related posts, 0 by default
|
||||||
disableSummary: false
|
disableSummary: false
|
||||||
copyCodeButton: true # true by default
|
copyCodeButton: true # true by default
|
||||||
rssAsSocialIcon: true
|
rssAsSocialIcon: true
|
||||||
@ -216,6 +218,9 @@ For production — allow all, for other — disallow all.
|
|||||||
### Favorite posts
|
### Favorite posts
|
||||||
Add `favorite: true` to post front matter. It adds a "★" icon nearby post's title.
|
Add `favorite: true` to post front matter. It adds a "★" icon nearby post's title.
|
||||||
|
|
||||||
|
### Related posts (Read Next section)
|
||||||
|
Based on `readNextPosts` config parameter. Check [this article](https://gohugo.io/content-management/related/#configure-related-content) for configuration details.
|
||||||
|
|
||||||
### Hiding posts from RSS
|
### Hiding posts from RSS
|
||||||
Add `disable_feed: true` to post front matter.
|
Add `disable_feed: true` to post front matter.
|
||||||
|
|
||||||
|
@ -556,6 +556,16 @@ article figcaption {
|
|||||||
color: var(--link-state-color);
|
color: var(--link-state-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.read-next-title {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.read-next-posts {
|
||||||
|
margin-top: 5px;
|
||||||
|
list-style-type:"- ";
|
||||||
|
padding-inline-start: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Other pages */
|
/* Other pages */
|
||||||
.terms {
|
.terms {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
@ -17,6 +17,7 @@ dateFormat = "2006-01-02"
|
|||||||
paginationSinglePost = true
|
paginationSinglePost = true
|
||||||
style = "auto"
|
style = "auto"
|
||||||
readMore = false
|
readMore = false
|
||||||
|
readNextPosts = 2
|
||||||
copyCodeButton = true
|
copyCodeButton = true
|
||||||
rssAsSocialIcon = true
|
rssAsSocialIcon = true
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ dateFormat = "2006-01-02"
|
|||||||
paginationSinglePost = true
|
paginationSinglePost = true
|
||||||
style = "auto"
|
style = "auto"
|
||||||
readMore = false
|
readMore = false
|
||||||
|
readNextPosts = 2
|
||||||
copyCodeButton = true
|
copyCodeButton = true
|
||||||
rssAsSocialIcon = true
|
rssAsSocialIcon = true
|
||||||
|
|
||||||
|
@ -42,3 +42,6 @@ darkTheme:
|
|||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "Helles Theme"
|
other: "Helles Theme"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "Weiter lesen"
|
@ -42,3 +42,6 @@ darkTheme:
|
|||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "Light theme"
|
other: "Light theme"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "Read next"
|
||||||
|
@ -42,3 +42,6 @@ darkTheme:
|
|||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "Thème clair"
|
other: "Thème clair"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "Lire la suite"
|
@ -42,3 +42,6 @@ darkTheme:
|
|||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "Jasny schemat"
|
other: "Jasny schemat"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "Czytaj dalej"
|
@ -41,4 +41,7 @@ darkTheme:
|
|||||||
other: "Tema Escuro"
|
other: "Tema Escuro"
|
||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "Tema Claro"
|
other: "Tema Claro"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "Leia a seguir"
|
@ -42,3 +42,6 @@ darkTheme:
|
|||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "Светлая тема"
|
other: "Светлая тема"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "Читать далее"
|
||||||
|
@ -42,3 +42,6 @@ darkTheme:
|
|||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "亮色主題"
|
other: "亮色主題"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "閱讀下一篇"
|
@ -41,4 +41,7 @@ darkTheme:
|
|||||||
other: "暗色主题"
|
other: "暗色主题"
|
||||||
|
|
||||||
lightTheme:
|
lightTheme:
|
||||||
other: "亮色主题"
|
other: "亮色主题"
|
||||||
|
|
||||||
|
readNext:
|
||||||
|
other: "继续阅读"
|
||||||
|
@ -21,6 +21,18 @@
|
|||||||
{{ partial "post-info.html" . }}
|
{{ partial "post-info.html" . }}
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
{{ if gt .Site.Params.readNextPosts 0 }}
|
||||||
|
{{ $related := .Site.RegularPages.Related . | first .Site.Params.readNextPosts }}
|
||||||
|
{{ with $related }}
|
||||||
|
<h3 class="read-next-title">{{ i18n "readNext" }}</h3>
|
||||||
|
<ul class="read-next-posts">
|
||||||
|
{{ range . }}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }}
|
{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }}
|
||||||
{{ partial "post-pagination.html" . }}
|
{{ partial "post-pagination.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user