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).
|
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
|
notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page
|
||||||
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
|
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
|
viewportSize = "normal" # widest, wider, wide, normal, narrow
|
||||||
enableUiAnimation = true
|
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).
|
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
|
notAllowedTypesInArchive = ["about", "talks", "showcase"] # not allowed page types in archive page
|
||||||
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
|
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
|
viewportSize = "normal" # widest, wider, wide, normal, narrow
|
||||||
enableUiAnimation = true
|
enableUiAnimation = true
|
||||||
|
|
|
@ -12,6 +12,7 @@ notAllowedTypesInHome = ["contact", "talks", "about", "showcase", "publication",
|
||||||
notAllowedTypesInHomeSidebar = ["about", "archive", "showcase", "publication", "presentation", "resume"]
|
notAllowedTypesInHomeSidebar = ["about", "archive", "showcase", "publication", "presentation", "resume"]
|
||||||
notAllowedTypesInArchive = ["about", "talks", "showcase", "publication", "presentation", "resume"]
|
notAllowedTypesInArchive = ["about", "talks", "showcase", "publication", "presentation", "resume"]
|
||||||
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
|
notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase", "publication", "presentation", "resume", "gallery"]
|
||||||
|
enablePinnedPosts = true
|
||||||
|
|
||||||
viewportSize = "normal" # widest, wider, wide, normal, narrow
|
viewportSize = "normal" # widest, wider, wide, normal, narrow
|
||||||
enableUiAnimation = true
|
enableUiAnimation = true
|
||||||
|
|
|
@ -8,6 +8,7 @@ enableToc: true
|
||||||
enableTocContent: false
|
enableTocContent: false
|
||||||
author: Jeus
|
author: Jeus
|
||||||
authorEmoji: 🎅
|
authorEmoji: 🎅
|
||||||
|
pinned: true
|
||||||
tags:
|
tags:
|
||||||
- hugo
|
- hugo
|
||||||
series:
|
series:
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
{{ range $.Param "notAllowedTypesInHome" }}
|
{{ range $.Param "notAllowedTypesInHome" }}
|
||||||
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
|
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
|
||||||
{{ end }}
|
{{ 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 }}
|
{{ $paginator := .Paginate $filteredPages }}
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<article class="summary-card" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
<article class="summary-card" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
||||||
<header>
|
<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">
|
<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>
|
<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")) }}
|
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<div class="summary-classic__content">
|
<div class="summary-classic__content">
|
||||||
<header>
|
<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">
|
<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>
|
<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")) }}
|
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{ $params := .Params }}
|
{{ $params := .Params }}
|
||||||
<div class="summary-compact__meta">
|
<div class="summary-compact__meta">
|
||||||
<header>
|
<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">
|
<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>
|
<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")) }}
|
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||||
|
|
Loading…
Reference in New Issue