Skip to content

Commit c73beaa

Browse files
committed
Landing: Added extra doc to exampleSite
1 parent 40bf3e5 commit c73beaa

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

exampleSite/content/test-product/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ title: Test pages
44
weight: 100
55
hasCustomContent: true
66
---
7+
<!-- <card-layout> - Available params: title (required: string)-->
78
{{< card-layout >}}
9+
<!-- <card-section> - Available params: title (required: string), showAsCards (optional: boolean, default false) -->
810
<!-- If there is no "title" for <card-section>, it is implied it is the main content section and not a new content section -->
911
{{< card-section >}}
1012
{{< card title="Call Out usages" >}}
13+
<!-- <card> - Available params: title (required: string), titleUrl (optional: string, relative path or absolute URL (e.g. https://google.com)) -->
1114
Examples for call-out shortcode
1215
{{</ card >}}
1316
{{< card title="Code Block usages" >}}

layouts/shortcodes/card.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ <h2 class="card-title"><a href="{{- .Get "titleUrl" -}}">{{- .Get "title" -}}</a
1010
{{- else -}}
1111
<h2 class="card-title">{{- .Get "title" -}}</h2>
1212
{{- end -}}
13-
{{ end }}
13+
{{- else -}}
14+
{{ errorf "Missing param 'title'" }}
15+
{{- end -}}
1416
<p>{{- .Inner -}}</p>
1517
</div>
1618
<div class="col-md-5 card" data-mf="false">
@@ -19,7 +21,11 @@ <h3 class="card-title" style="display: flex; align-items: center; gap: 5px;">
1921
{{- if .Get "icon" -}}
2022
<img class="card-img-top" src="{{ .Site.BaseURL }}/images/icons/{{ .Get "icon" }}.png"/>
2123
{{- end -}}
22-
<a href="{{- .Get "titleUrl" -}}">{{- .Get "title" -}}</a>
24+
{{- if and (.Get "title") (.Get "titleUrl") -}}
25+
<a href="{{- .Get "titleUrl" -}}">{{- .Get "title" -}}</a>
26+
{{- else -}}
27+
{{ errorf "Missing either params 'titleUrl' or 'title'" }}
28+
{{- end -}}
2329
</h3>
2430
<p>{{- .Inner -}}</p>
2531
</div>

0 commit comments

Comments
 (0)