blob: c154c90c10afaf84b30e48e6b9182c1c9d9a3aa7 (
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
|
{{- if or $.Site.Params.debug (findRE `\bhtml-comment\b` $.Site.Params.traceFlags) }}
{{ `<!-- partials/front.recent_posts.html -->` | safeHTML }}
{{- end}}
{{- if isset $.Site.Params (lower `recentPosts` ) }}
{{- if $.Site.Params.recentPosts.enableFront }}
<section id="recentPosts" class="w3-theme">
<div class='w3-container {{ default `w3-theme-l3` ($.Site.Param `colorFrontRecentPostsContainer`)}} '>
<div class='w3-card-4 w3-center w3-round-xxlarge w3-margin-bottom {{ default `w3-theme-l2` ($.Site.Param `colorFrontRecentPostsTitleCard`)}} '>
<h2 id="recent_posts_title">{{ $.Site.Params.recentPosts.title }}</h2>
<div class="w3-small">
{{- $.Site.Params.recentPosts.subtitle | markdownify }}
</div>
</div> <!-- w3-card -->
<div class="w3-row">
{{- if or $.Site.Params.debug (findRE `\bhtml-comment\b` $.Site.Params.traceFlags) }}
{{ `<!-- range first 3 .Site.RegularPages "Section" "blog" -->` | safeHTML }}
{{- end}}
{{/*- range $index, $element := first (default 3 ($.Site.Params.recentPosts.recentNumOfPosts)) (where .Site.RegularPages `Section` `blog`) */}}
{{- range $index, $element := first 3 (where .Site.RegularPages `Section` `blog`) }}
<div class="w3-third">
<div class='w3-card-4 w3-margin w3-round w3-hover-shadow w3-opacity-min w3-hover-opacity-off {{ default `w3-theme-l4` ($.Site.Param `colorFrontRecentPostsCard`)}} '>
<a class="no-decoration" href='{{ $element.RelPermalink }}'>
{{- $myImgClass := `w3-image w3-left w3-round w3-hover-opacity` }}
{{- $myImgStyle := `max-width:150px; max-height:150px; width: auto; height: auto; margin: 0px 8px 16px 0px;` }}
{{- $myImg := $element.Param `resImgTeaser` }} {{/* case insensitive */}}
{{- $myImgCmd := $element.Param `resImgTeaserCmd` | default `Resize` }}
{{- $myImgOpt := $element.Param `resImgTeaserOpt` | default `150x` }}
{{ partial `resource.image.html` (dict `page` $element `class` $myImgClass `style` $myImgStyle `img` $myImg `cmd` $myImgCmd `opt` $myImgOpt ) }}
<h3>{{- $element.Title | markdownify | emojify }}</h3>
<div class="">
{{- or .Description .Summary | markdownify | truncate ( or $.Site.Params.teaserTruncateSummary 160) | replaceRE `<.?p>` `` | safeHTML }}
</div>
</a>
<div class="w3-container w3-center">
<a href='{{ .RelPermalink }}' class='w3-button {{ default `w3-theme-l4` ($.Site.Param `colorFrontRecentPostsCardButton`)}}'>{{ default `more` (i18n `continueReading`) }}</a>
</div>
</div> <!-- w3-container -->
</div> <!-- w3-third -->
{{- end }} {{/* range */}}
</div> <!-- w3-row -->
</div> <!-- w3-container -->
</section>
{{- end }} {{/* if isset */}}
{{- end }} {{/* if recentPosts.enableFront */}}
|