Skip to content

Commit 8490071

Browse files
committed
Cards: Added back data-mf to fix old theme
1 parent a783d99 commit 8490071

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

layouts/partials/list-main.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,31 @@ <h1 class="bd-title">
1313
{{ partial "banner" .}}
1414
{{ $hasCustomContent := index .Params "nd-landing-page" | default false }}
1515
{{ if $hasCustomContent }}
16+
{{ $cards := .Page.Scratch.Get "cards" }}
17+
<section data-mf="false">
18+
<div class="row">
19+
<div class="card-deck">
20+
{{ range .Pages.GroupBy "Section" }}
21+
{{ range .Pages.ByWeight }}
22+
{{ $title := .Title }}
23+
<div class="col-md-5 card">
24+
<div class="card-body">
25+
<h3 class="card-title" style="display: flex; align-items: center; gap: 5px;">
26+
<i class="fas fa-{{if eq .Kind "page"}}file-alt{{else}}book{{end}} fa-lg card-img-top"></i>
27+
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a>
28+
</h3>
29+
{{ range $cards }}
30+
{{ if eq .title $title }}
31+
<p>{{ .content }}</p>
32+
{{ end }}
33+
{{ end }}
34+
</div>
35+
</div>
36+
{{ end }}
37+
{{ end }}
38+
</div>
39+
</div>
40+
</section>
1641
{{ .Content }}
1742
{{ else }}
1843
<section data-mf="false">

layouts/shortcodes/card-section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{{- $class := "card-grid" -}}
1818
{{- /* Validate that the parent is card-layout */ -}}
1919
{{ if eq .Parent.Name "card-layout"}}
20-
<div class="card-section {{if eq $isFeaturedSection "true"}}featured-section{{ end }}">
20+
<div class="card-section {{if eq $isFeaturedSection "true"}}featured-section{{ end }}" data-mf="true" style="display: none;">
2121
{{- if $title -}}
2222
<strong class="card-section-title">{{- $title -}}</strong>
2323
<div class="card-section-content{{ if eq $showAsCards "true" }} {{ $class }} {{ end }}">{{- .Inner -}}</div>

layouts/shortcodes/card.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{{- .Page.Scratch.Set "cards" ($current | append $newCard) -}}
1414
{{- /* Validate that the parent is card-section and under 3 cards */ -}}
1515
{{- if (eq .Parent.Name "card-section") -}}
16-
<div class="card-container {{ if eq $isFeatured "true" }}featured-card{{ end }}">
16+
<div class="card-container {{ if eq $isFeatured "true" }}featured-card{{ end }}" data-mf="true" style="display: none;">
1717
{{- if $title -}}
1818
<div class="card-header">
1919
{{- if $brandIcon -}}
@@ -37,8 +37,8 @@ <h2 class="card-title">{{- $title -}}</h2>
3737
<div class="col-md-5 card" data-mf="false">
3838
<div class="card-body">
3939
<h3 class="card-title" style="display: flex; align-items: center; gap: 5px;">
40-
{{- if $icon -}}
41-
<img class="card-img-top" src="{{ .Site.BaseURL }}/images/icons/{{ $icon }}.png"/>
40+
{{- if $brandIcon -}}
41+
<img class="card-img-top" src="{{ .Site.BaseURL }}/images/icons/{{ $brandIcon }}.png"/>
4242
{{- end -}}
4343
{{- if ($title) -}}
4444
<a href="{{- $titleUrl -}}">{{- $title -}}</a>

0 commit comments

Comments
 (0)