Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@
{{ end }}
</section>
<h1>{{ .Title }}</h1>
{{ .Content }}

{{ partial "banner" . }}

{{ if (lt .WordCount 1) }}
{{ .Content }}
{{ range .Pages.ByWeight }}
<h2>
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a>
</h2>
{{ end }}
{{ else }}
{{ partial "custom-landing-page" . }}
{{end}}

<hr>
Expand Down
13 changes: 13 additions & 0 deletions layouts/partials/custom-landing-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ $cards := .Scratch.Get "cards" }}
{{ range .Pages.ByWeight }}
{{ $title := .Title }}
<h2>
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ $title }}</a>
</h2>
{{ range $cards }}
{{ if eq .title $title }}
<p style="margin-left: 1rem;">{{ .content }}</p>
{{ end }}
{{ end }}
{{ end }}
{{ .Content }}
1 change: 1 addition & 0 deletions layouts/shortcodes/card-layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div data-mf="true" style="display: none">{{- .Inner | markdownify -}}</div>
7 changes: 7 additions & 0 deletions layouts/shortcodes/card-section.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="card-section">
{{- if .Get "title" -}}
<strong>{{- .Get "title" -}}</strong>
<div style="padding-left: 1rem;">{{- .Inner -}}</div>
{{ end }}
</div>
<br><br>
12 changes: 12 additions & 0 deletions layouts/shortcodes/card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- $current := .Page.Scratch.Get "cards" | default (slice) -}}
{{- $newCard := dict "title" (.Get "title") "content" (.Inner) -}}
{{- .Page.Scratch.Set "cards" ($current | append $newCard) -}}

{{- if .Get "title" -}}
{{- if .Get "titleUrl" -}}
<h2 style="padding: 0;"><a href="{{- .Get "titleUrl" -}}">{{- .Get "title" -}}</a></h2>
{{- else -}}
<h2 style="padding: 0;">{{- .Get "title" -}}</h2>
{{- end -}}
{{ end }}
<p>{{- .Inner -}}</p>
Loading