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
+4 -4
View File
@@ -41,7 +41,7 @@
<div class="{{ $articleInnerClasses }}">
<h3 class="items-center text-xl font-semibold">
<div class="items-center text-xl font-semibold">
{{ with .Params.externalUrl }}
<div>
<div
@@ -55,8 +55,8 @@
</div>
{{ else }}
<p class="text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">{{ .Title | emojify }}</p>
<div class="text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">{{ .Title | emojify }}</div>
{{ end }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<div class=" ltr:ml-2 rtl:mr-2">
@@ -66,7 +66,7 @@
{{ if templates.Exists "partials/extend-article-link.html" }}
{{ partial "extend-article-link.html" . }}
{{ end }}
</h3>
</div>
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta.html" . }}
</div>
+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>