Merge pull request #272 from szpak/upstream/pinnedPoists
[new feature]Pinned posts
This commit is contained in:
commit
da88040751
|
@ -240,6 +240,7 @@ notAllowedTypesInHome = ["contact", "talks", "about", "showcase"] # not allowed
|
|||
notAllowedTypesInHomeSidebar = ["about", "archive", "showcase"] # not allowed page types in home page sidebar(recent post titles).
|
||||
notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page
|
||||
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
|
||||
enablePinnedPosts = true # show pinned posts first in the main view
|
||||
|
||||
viewportSize = "normal" # widest, wider, wide, normal, narrow
|
||||
enableUiAnimation = true
|
||||
|
|
|
@ -240,6 +240,7 @@ notAllowedTypesInHome = ["contact", "talks", "about", "showcase"] # not allowed
|
|||
notAllowedTypesInHomeSidebar = ["about", "archive", "showcase"] # not allowed page types in home page sidebar(recent post titles).
|
||||
notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page
|
||||
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
|
||||
enablePinnedPosts = true # show pinned posts first in the main view
|
||||
|
||||
viewportSize = "normal" # widest, wider, wide, normal, narrow
|
||||
enableUiAnimation = true
|
||||
|
|
|
@ -12,6 +12,7 @@ notAllowedTypesInHome = ["contact", "talks", "about", "showcase", "publication",
|
|||
notAllowedTypesInHomeSidebar = ["about", "archive", "showcase", "publication", "presentation", "resume"]
|
||||
notAllowedTypesInArchive = ["about", "talks", "showcase", "publication", "presentation", "resume"]
|
||||
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
|
||||
enablePinnedPosts = true
|
||||
|
||||
viewportSize = "normal" # widest, wider, wide, normal, narrow
|
||||
enableUiAnimation = true
|
||||
|
|
|
@ -8,6 +8,7 @@ enableToc: true
|
|||
enableTocContent: false
|
||||
author: Jeus
|
||||
authorEmoji: 🎅
|
||||
pinned: true
|
||||
tags:
|
||||
- hugo
|
||||
series:
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
{{ range $.Param "notAllowedTypesInHome" }}
|
||||
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
|
||||
{{ end }}
|
||||
{{ $filteredPagesPinned := slice }}
|
||||
{{ if .Site.Params.enablePinnedPosts }}
|
||||
{{ $filteredPagesPinned = (where $filteredPages "Params.pinned" "==" true) }}
|
||||
{{ end }}
|
||||
{{ $filteredPages := $filteredPages | intersect (where $filteredPages "Params.pinned" "!=" true) }}
|
||||
{{ $filteredPages := $filteredPages | union ($filteredPagesPinned) }}
|
||||
{{ $paginator := .Paginate $filteredPages }}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ .Render "summary" }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<article class="summary-card" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
||||
<header>
|
||||
<h5 class="title h5"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
|
||||
<h5 class="title h5"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}📌 {{- end -}}{{ .Title }}</a> </h5>
|
||||
<h6 class="subtitle caption">
|
||||
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅{{ .Date.Format (i18n "summary-dateformat") }} </time>
|
||||
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class="summary-classic__content">
|
||||
<header>
|
||||
<h5 class="title h5"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
|
||||
<h5 class="title h5"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}📌 {{- end -}}{{ .Title }}</a> </h5>
|
||||
<h6 class="subtitle caption">
|
||||
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅 {{ .Date.Format (i18n "summary-dateformat") }} </time>
|
||||
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{ $params := .Params }}
|
||||
<div class="summary-compact__meta">
|
||||
<header>
|
||||
<h5 class="title h6"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
|
||||
<h5 class="title h6"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}📌 {{- end -}}{{ .Title }}</a> </h5>
|
||||
<h6 class="subtitle caption">
|
||||
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅 {{ .Date.Format (i18n "summary-dateformat") }} </time>
|
||||
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||
|
|
Loading…
Reference in New Issue