added new shortcodes and respective docs

This commit is contained in:
Nuno Coração
2022-10-06 23:52:51 +01:00
parent 7e613a6219
commit 7ba6c3661d
7 changed files with 86 additions and 5 deletions
+9
View File
@@ -0,0 +1,9 @@
{{ $parent := .Page.RelPermalink }}
<section class="w-full mt-10 mb-10">
{{ $RelPermalink := .Get "link" }}
{{ range ( where .Site.RegularPages "RelPermalink" $RelPermalink | first 1 ) }}
{{ if not (eq .RelPermalink $parent) }}
{{ partial "article-link.html" . }}
{{ end }}
{{end}}
</section>
+21
View File
@@ -0,0 +1,21 @@
{{ $limit := .Get "limit" }}
{{ $parent := .Page.RelPermalink }}
{{ $where := .Get "where" }}
{{ $value := .Get "value" }}
<h2 class="mt-20 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
<section class="space-y-10 w-full mt-10 mb-10">
{{ if $where }}
{{ range ( where .Site.RegularPages $where $value | first 1 ) }}
{{ if not (eq .RelPermalink $parent) }}
{{ partial "article-link.html" . }}
{{ end }}
{{end}}
{{ else }}
{{ range .Site.RegularPages | first $limit }}
{{ if not (eq .RelPermalink $parent) }}
{{ partial "article-link.html" . }}
{{ end }}
{{end}}
{{ end }}
</section>