summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/shortcodes/list.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/blowfish/layouts/shortcodes/list.html')
-rw-r--r--themes/blowfish/layouts/shortcodes/list.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/themes/blowfish/layouts/shortcodes/list.html b/themes/blowfish/layouts/shortcodes/list.html
new file mode 100644
index 0000000..f46e96e
--- /dev/null
+++ b/themes/blowfish/layouts/shortcodes/list.html
@@ -0,0 +1,47 @@
+
+{{ $limit := .Get "limit" | default 1 }}
+{{ $title := .Get "title" | default (i18n "shortcode.recent_articles" | emojify) }}
+{{ $parent := .Page.RelPermalink }}
+{{ $cardView := .Get "cardView" }}
+{{ $where := .Get "where" }}
+{{ $value := .Get "value" }}
+<h2 class="mt-20 text-2xl font-extrabold mb-10">{{ $title }}</h2>
+
+
+{{ if $cardView | default false}}
+
+<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
+ {{ if $where }}
+ {{ range ( where .Site.RegularPages $where $value | first $limit ) }}
+ {{ if not (eq .RelPermalink $parent) }}
+ {{ partial "article-link/card.html" . }}
+ {{ end }}
+ {{end}}
+ {{ else }}
+ {{ range .Site.RegularPages | first $limit }}
+ {{ if not (eq .RelPermalink $parent) }}
+ {{ partial "article-link/card.html" . }}
+ {{ end }}
+ {{end}}
+ {{ end }}
+</section>
+
+{{ else }}
+
+<section class="space-y-10 w-full mt-10 mb-10">
+ {{ if $where }}
+ {{ range ( where .Site.RegularPages $where $value | first $limit ) }}
+ {{ if not (eq .RelPermalink $parent) }}
+ {{ partial "article-link/simple.html" . }}
+ {{ end }}
+ {{end}}
+ {{ else }}
+ {{ range .Site.RegularPages | first $limit }}
+ {{ if not (eq .RelPermalink $parent) }}
+ {{ partial "article-link/simple.html" . }}
+ {{ end }}
+ {{end}}
+ {{ end }}
+</section>
+
+{{ end }}