diff --git a/README.ko.md b/README.ko.md index 786b90b..7bc119f 100644 --- a/README.ko.md +++ b/README.ko.md @@ -287,6 +287,7 @@ enableTocSwitch = true # single page table of contents visibility switch itemsPerCategory = 5 # maximum number of posts shown in the sidebar. sidebarPosition = "right" # bio, profile component layout position tocLevels = ["h2", "h3", "h4"] # minimum h2, maximum h4 in your article +enableSidebarPostsByOrder = false # another lists in the sidebar # footer showPoweredBy = true # show footer text: Powered by Hugo and Zzo theme diff --git a/README.md b/README.md index 120e68b..52b8ec6 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,7 @@ enableTocSwitch = true # single page table of contents visibility switch itemsPerCategory = 5 # maximum number of posts shown in the sidebar. sidebarPosition = "right" # bio, profile component layout position tocLevels = ["h2", "h3", "h4"] # minimum h2, maximum h4 in your article +enableSidebarPostsByOrder = false # another lists in the sidebar # footer showPoweredBy = true # show footer text: Powered by Hugo and Zzo theme diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index c23a47c..7f548e7 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -61,6 +61,7 @@ enableTocSwitch = true itemsPerCategory = 5 sidebarPosition = "right" tocLevels = ["h2", "h3", "h4"] +enableSidebarPostsByOrder = false # footer showPoweredBy = true diff --git a/layouts/partials/sidebar/list/posts-by-order.html b/layouts/partials/sidebar/list/posts-by-order.html new file mode 100644 index 0000000..7cd3866 --- /dev/null +++ b/layouts/partials/sidebar/list/posts-by-order.html @@ -0,0 +1,18 @@ +{{ if ($.Param "enableSidebarPostsByOrder" | default false) }} + {{ $filteredSections := .Site.Pages }} + {{ range $.Param "notAllowedTypesInHomeSidebar" }} + {{ $filteredSections = (where $filteredSections "Type" "!=" (lower .)) }} + {{ end }} + + + + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/sidebar/sidebar-home.html b/layouts/partials/sidebar/sidebar-home.html index 6cfb50a..71f5519 100644 --- a/layouts/partials/sidebar/sidebar-home.html +++ b/layouts/partials/sidebar/sidebar-home.html @@ -3,6 +3,7 @@ {{ partial "search/site-search" . }} {{ partial "sidebar/site-bio" . }} {{ partial "sidebar/custom-home" . }} + {{ partial "sidebar/list/posts-by-order" . }} {{ if and ($.Param "itemsPerCategory") ($.Param "enableHomeSidebarTitles") }} {{ $filteredSections := .Site.Sections }} diff --git a/layouts/partials/sidebar/sidebar-list.html b/layouts/partials/sidebar/sidebar-list.html index a89c63f..62d846d 100644 --- a/layouts/partials/sidebar/sidebar-list.html +++ b/layouts/partials/sidebar/sidebar-list.html @@ -3,6 +3,8 @@