[new feature] another lists in the sidebar
Added new option `enableSidebarPostsByOrder` in params.toml file
This commit is contained in:
parent
97d73a5e96
commit
366e1a2f2c
|
@ -287,6 +287,7 @@ enableTocSwitch = true # single page table of contents visibility switch
|
||||||
itemsPerCategory = 5 # maximum number of posts shown in the sidebar.
|
itemsPerCategory = 5 # maximum number of posts shown in the sidebar.
|
||||||
sidebarPosition = "right" # bio, profile component layout position
|
sidebarPosition = "right" # bio, profile component layout position
|
||||||
tocLevels = ["h2", "h3", "h4"] # minimum h2, maximum h4 in your article
|
tocLevels = ["h2", "h3", "h4"] # minimum h2, maximum h4 in your article
|
||||||
|
enableSidebarPostsByOrder = false # another lists in the sidebar
|
||||||
|
|
||||||
# footer
|
# footer
|
||||||
showPoweredBy = true # show footer text: Powered by Hugo and Zzo theme
|
showPoweredBy = true # show footer text: Powered by Hugo and Zzo theme
|
||||||
|
|
|
@ -295,6 +295,7 @@ enableTocSwitch = true # single page table of contents visibility switch
|
||||||
itemsPerCategory = 5 # maximum number of posts shown in the sidebar.
|
itemsPerCategory = 5 # maximum number of posts shown in the sidebar.
|
||||||
sidebarPosition = "right" # bio, profile component layout position
|
sidebarPosition = "right" # bio, profile component layout position
|
||||||
tocLevels = ["h2", "h3", "h4"] # minimum h2, maximum h4 in your article
|
tocLevels = ["h2", "h3", "h4"] # minimum h2, maximum h4 in your article
|
||||||
|
enableSidebarPostsByOrder = false # another lists in the sidebar
|
||||||
|
|
||||||
# footer
|
# footer
|
||||||
showPoweredBy = true # show footer text: Powered by Hugo and Zzo theme
|
showPoweredBy = true # show footer text: Powered by Hugo and Zzo theme
|
||||||
|
|
|
@ -61,6 +61,7 @@ enableTocSwitch = true
|
||||||
itemsPerCategory = 5
|
itemsPerCategory = 5
|
||||||
sidebarPosition = "right"
|
sidebarPosition = "right"
|
||||||
tocLevels = ["h2", "h3", "h4"]
|
tocLevels = ["h2", "h3", "h4"]
|
||||||
|
enableSidebarPostsByOrder = false
|
||||||
|
|
||||||
# footer
|
# footer
|
||||||
showPoweredBy = true
|
showPoweredBy = true
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
{{ if ($.Param "enableSidebarPostsByOrder" | default false) }}
|
||||||
|
{{ $filteredSections := .Site.Pages }}
|
||||||
|
{{ range $.Param "notAllowedTypesInHomeSidebar" }}
|
||||||
|
{{ $filteredSections = (where $filteredSections "Type" "!=" (lower .)) }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<div class="sidebar-recent__title p2">{{ i18n "posts-by-param" | default "TOP POSTS" }}</div>
|
||||||
|
<ul class="sidebar-recent__ul">
|
||||||
|
{{ range first ($.Param "itemsPerCategory") ($filteredSections.ByParam "order") }}
|
||||||
|
{{ if .Params.order }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .RelPermalink }}" class="sidebar-recent__a p2">{{ .Title }}</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
<hr class="hr-fade sidebar-hr" />
|
||||||
|
{{ end }}
|
|
@ -3,6 +3,7 @@
|
||||||
{{ partial "search/site-search" . }}
|
{{ partial "search/site-search" . }}
|
||||||
{{ partial "sidebar/site-bio" . }}
|
{{ partial "sidebar/site-bio" . }}
|
||||||
{{ partial "sidebar/custom-home" . }}
|
{{ partial "sidebar/custom-home" . }}
|
||||||
|
{{ partial "sidebar/list/posts-by-order" . }}
|
||||||
|
|
||||||
{{ if and ($.Param "itemsPerCategory") ($.Param "enableHomeSidebarTitles") }}
|
{{ if and ($.Param "itemsPerCategory") ($.Param "enableHomeSidebarTitles") }}
|
||||||
{{ $filteredSections := .Site.Sections }}
|
{{ $filteredSections := .Site.Sections }}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
<ul class="sidebar">
|
<ul class="sidebar">
|
||||||
{{ partial "search/site-search" . }}
|
{{ partial "search/site-search" . }}
|
||||||
{{ partial "sidebar/custom-list" . }}
|
{{ partial "sidebar/custom-list" . }}
|
||||||
|
{{ partial "sidebar/list/posts-by-order" . }}
|
||||||
|
|
||||||
{{ if and ($.Param "itemsPerCategory") ($.Param "enableListSidebarTitles") }}
|
{{ if and ($.Param "itemsPerCategory") ($.Param "enableListSidebarTitles") }}
|
||||||
{{ range first ($.Param "itemsPerCategory") .Pages }}
|
{{ range first ($.Param "itemsPerCategory") .Pages }}
|
||||||
<li class="sidebar-recent">
|
<li class="sidebar-recent">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ if $.Param "enableSidebarTags" }}
|
{{ if and ($.Param "enableSidebarTags") (ne (len .Site.Taxonomies.tags) 0) }}
|
||||||
<div class="taxo">
|
<div class="taxo">
|
||||||
<section>
|
<section>
|
||||||
<span class="title p2">
|
<span class="title p2">
|
||||||
|
|
Loading…
Reference in New Issue