mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-18 15:33:10 +00:00
Add option to force show articles button
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $pages := slice }}
|
{{ $pages := slice }}
|
||||||
{{ $pages = partial "assets/live-pages.html" (dict
|
{{ $result := partial "assets/live-pages.html" (dict
|
||||||
"page" $args.page
|
"page" $args.page
|
||||||
"section" $args.input.section
|
"section" $args.input.section
|
||||||
"nested" $args.input.nested
|
"nested" $args.input.nested
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
"sort" $args.input.sort
|
"sort" $args.input.sort
|
||||||
"reverse" $args.input.reverse
|
"reverse" $args.input.reverse
|
||||||
)}}
|
)}}
|
||||||
|
{{ $pages = $result.pages }}
|
||||||
|
|
||||||
<!-- Add style definitions -->
|
<!-- Add style definitions -->
|
||||||
{{ $styles := slice
|
{{ $styles := slice
|
||||||
@@ -73,6 +74,7 @@
|
|||||||
"icon-rounded" $args.iconRounded
|
"icon-rounded" $args.iconRounded
|
||||||
"href" (cond $moreButton $moreLink "")
|
"href" (cond $moreButton $moreLink "")
|
||||||
"href-title" (cond $moreButton $moreTitle "")
|
"href-title" (cond $moreButton $moreTitle "")
|
||||||
|
"href-force" (gt $result.total (len $result.pages))
|
||||||
)}}
|
)}}
|
||||||
|
|
||||||
{{ if $args.scroll }}
|
{{ if $args.scroll }}
|
||||||
|
@@ -32,6 +32,9 @@ arguments:
|
|||||||
group: partial
|
group: partial
|
||||||
href-title:
|
href-title:
|
||||||
release: v1.0.0
|
release: v1.0.0
|
||||||
|
href-force:
|
||||||
|
release: v1.0.0
|
||||||
|
group: partial
|
||||||
separator:
|
separator:
|
||||||
loading:
|
loading:
|
||||||
ratio:
|
ratio:
|
||||||
|
@@ -31,6 +31,7 @@ content_blocks:
|
|||||||
section: blog
|
section: blog
|
||||||
reverse: true
|
reverse: true
|
||||||
sort: date
|
sort: date
|
||||||
|
keywords: featured
|
||||||
hide-empty: false
|
hide-empty: false
|
||||||
more:
|
more:
|
||||||
title: More Posts
|
title: More Posts
|
||||||
|
@@ -4,6 +4,7 @@ title: Bootstrap elements
|
|||||||
date: 2023-08-12
|
date: 2023-08-12
|
||||||
description: Use shortcodes to add common Bootstrap elements with ease.
|
description: Use shortcodes to add common Bootstrap elements with ease.
|
||||||
tags: ["bootstrap", "shortcode"]
|
tags: ["bootstrap", "shortcode"]
|
||||||
|
keywords: featured
|
||||||
thumbnail:
|
thumbnail:
|
||||||
url: img/boots.jpg
|
url: img/boots.jpg
|
||||||
author: Nathan Dumlao
|
author: Nathan Dumlao
|
||||||
|
@@ -4,6 +4,7 @@ title: Components
|
|||||||
date: 2023-09-23
|
date: 2023-09-23
|
||||||
description: Use shortcodes to add predefined components powered by external libraries.
|
description: Use shortcodes to add predefined components powered by external libraries.
|
||||||
tags: ["bootstrap", "shortcode"]
|
tags: ["bootstrap", "shortcode"]
|
||||||
|
keywords: ["featured"]
|
||||||
thumbnail:
|
thumbnail:
|
||||||
url: img/puzzle.jpg
|
url: img/puzzle.jpg
|
||||||
author: Ryoji Iwata
|
author: Ryoji Iwata
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
---
|
---
|
||||||
author: Mark Dumay
|
author: Mark Dumay
|
||||||
title: Content blocks
|
title: Content blocks
|
||||||
date: 2025-05-13
|
date: 2025-06-07
|
||||||
description: Quickly edit your webpages using reusable content blocks.
|
description: Quickly edit your webpages using reusable content blocks.
|
||||||
tags: ["bookshop", "blocks"]
|
tags: ["bookshop", "blocks"]
|
||||||
|
keywords: ["featured"]
|
||||||
thumbnail:
|
thumbnail:
|
||||||
url: img/pj-accetturo-XpD6Dkui-yg-unsplash.jpg
|
url: img/pj-accetturo-XpD6Dkui-yg-unsplash.jpg
|
||||||
author: Pj Accetturo
|
author: Pj Accetturo
|
||||||
|
@@ -189,7 +189,7 @@
|
|||||||
<div class="pt-3">{{- partial "assets/pagination.html" (dict "page" $args.page "format" "terse") -}}</div>
|
<div class="pt-3">{{- partial "assets/pagination.html" (dict "page" $args.page "format" "terse") -}}</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- if and (gt $count $max) $args.hrefTitle -}}
|
{{- if or (and (gt $count $max) $args.hrefTitle) (and $args.hrefForce $args.hrefTitle) -}}
|
||||||
{{- $href := $args.href -}}
|
{{- $href := $args.href -}}
|
||||||
{{- if and $pretty (not (hasSuffix $href "/" )) (not (strings.Contains $href "#")) -}}
|
{{- if and $pretty (not (hasSuffix $href "/" )) (not (strings.Contains $href "#")) -}}
|
||||||
{{- $href = printf "%s/" $href -}}
|
{{- $href = printf "%s/" $href -}}
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
{{/* Initialize local arguments */}}
|
{{/* Initialize local arguments */}}
|
||||||
{{ $pages := slice }}
|
{{ $pages := slice }}
|
||||||
|
{{ $total := 0 }}
|
||||||
|
|
||||||
{{/* Main code */}}
|
{{/* Main code */}}
|
||||||
{{ if not $args.err }}
|
{{ if not $args.err }}
|
||||||
@@ -48,15 +49,18 @@
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $pages = where site.Pages (printf ".Params.%s" $args.section) "!=" nil }}
|
{{ $pages = where site.Pages (printf ".Params.%s" $args.section) "!=" nil }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ $total = len $pages }}
|
||||||
{{ else if eq $args.kind "related" }}
|
{{ else if eq $args.kind "related" }}
|
||||||
{{ if $sectionPage.Keywords}}
|
{{ if $sectionPage.Keywords }}
|
||||||
{{ $keywords := keyVals "tags" $sectionPage.Keywords }}
|
{{ $keywords := keyVals "tags" $sectionPage.Keywords }}
|
||||||
{{ $opts := dict "namedSlices" (slice $keywords) }}
|
{{ $opts := dict "namedSlices" (slice $keywords) }}
|
||||||
{{ $pages = site.RegularPages.Related $opts }}
|
{{ $pages = site.RegularPages.Related $opts }}
|
||||||
|
{{ $total = len $pages }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{/* Retrieve the immediate or all related pages (recursively), optionally filtering by tag or keyword */}}
|
{{/* Retrieve the immediate or all related pages (recursively), optionally filtering by tag or keyword */}}
|
||||||
{{ if $args.nested }}{{ $pages = $sectionPage.RegularPagesRecursive }}{{ else }}{{ $pages = $sectionPage.Pages }}{{ end }}
|
{{ if $args.nested }}{{ $pages = $sectionPage.RegularPagesRecursive }}{{ else }}{{ $pages = $sectionPage.Pages }}{{ end }}
|
||||||
|
{{ $total = len $pages }}
|
||||||
|
|
||||||
{{ if and $args.tags (gt (len $args.tags) 0) }}
|
{{ if and $args.tags (gt (len $args.tags) 0) }}
|
||||||
{{ $pages = where $pages "Params.tags" "intersect" $args.tags }}
|
{{ $pages = where $pages "Params.tags" "intersect" $args.tags }}
|
||||||
@@ -77,4 +81,4 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ return $pages }}
|
{{ return (dict "pages" $pages "total" $total) }}
|
Reference in New Issue
Block a user