blob: bc18c10918a6cf7155d6c2159eaad338ef570472 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
{{ if not .Params.widget.sidebar.position }}
<h2 class=" font-bold text-3xl my-4">{{ .Params.Title }}</h2>
{{ end }}
{{ if eq .Params.style "plain" }}
{{ partial "widgets/pages-plain" . }}
{{ else if eq .Params.style "masonry" }}
{{ partial "widgets/pages-masonry" . }}
{{ else }}
{{ partial "widgets/pages-card" . }}
{{ end }}
{{ define "partials/widgets/pages-get" }}
{{- $section := .Site.GetPage .Params.section }}
{{ $pages := $section.Pages }}
{{ $count := .Params.count | default 5 }}
{{ with $count }}
{{ $pages = first $count $pages }}
{{ end }}
{{ return $pages }}
{{ end }}
{{ define "partials/widgets/pages-plain" }}
{{ $pages := partial "widgets/pages-get" . }}
{{ partial "components/summary-list-plain" $pages }}
<div class="pt-2 hover:text-eureka">
{{ partial "widgets/pages-readmore" . }}
</div>
{{ end }}
{{ define "partials/widgets/pages-card" }}
{{ $pages := partial "widgets/pages-get" . }}
<div class="overflow-hidden">
{{ partial "components/summary-list-card" $pages }}
<div class="px-8 pt-2 hover:text-eureka">
{{ partial "widgets/pages-readmore" . }}
</div>
</div>
{{ end }}
{{ define "partials/widgets/pages-masonry" }}
<div class="pb-2 text-right hover:text-eureka">
{{ partial "widgets/pages-readmore" . }}
</div>
{{ $pages := partial "widgets/pages-get" . }}
{{ partial "components/summary-list-masonry" $pages }}
{{ end }}
{{ define "partials/widgets/pages-readmore" }}
{{- $section := .Site.GetPage .Params.section }}
<a href="{{ $section.Permalink }}" class="font-semibold">{{ i18n "readMore" }}</a>
<i class='fas {{ cond (eq .Site.Language.LanguageDirection "rtl") "fa-caret-left" "fa-caret-right" }} ms-1'></i>
{{ end }}
|