Skip to content

Commit ea5f1c4

Browse files
committed
Landing: Fix issues with double render
1 parent 28f9d22 commit ea5f1c4

File tree

4 files changed

+11
-26
lines changed

4 files changed

+11
-26
lines changed

exampleSite/content/test-product/_index.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,10 @@
22
description: Test pages for nginx-hugo-theme
33
title: Test pages
44
weight: 100
5-
hasCustomContent: true
5+
nd-landing-page: true
66
---
7-
8-
## About
9-
10-
[//]: # "Give a short 1-2 sentence summary of what the product does and its value to a customer."
11-
This is a compilation of all our shortcodes to show how they look, function, respond, and coded.
12-
13-
## Featured Content
14-
15-
[//]: # "Maximum of three cards available to display."
16-
[//]: # "Each card should be less than 10 words for a description."
17-
[//]: # "If more than three cards are placed here, they are not displayed."
18-
[//]: # "If there is one card, it will take full width and be the only card in the row."
19-
[//]: # "If there is two cards, one card will take half width and there will be two cards in a row."
20-
[//]: # "If there is three cards, there will be two rows, where first row has two equal-sized cards, and second row will have a full width card. Can we inversed in order to feature content."
21-
<!-- <card-layout> - Available params: title (required: string)-->
22-
{{<card-layout >}}
23-
<!-- <card-section> - Available params: title (required: string), showAsCards (optional: boolean, default "false"), isFeaturedSection (optional: boolean, default "false") -->
24-
<!-- If there is no "title" for <card-section>, it is implied it is the main content section and not a new content section -->
25-
{{<card-section showAsCards="true" isFeaturedSection="true">}}
7+
{{<card-layout>}}
8+
{{<card-section showAsCards="true">}}
269
{{<card title="Everything" titleUrl="everything" icon="circle-dot-dashed">}}
2710
All shortcodes in one page.
2811
{{</card >}}
@@ -39,7 +22,7 @@ This is a compilation of all our shortcodes to show how they look, function, res
3922
## Other Content
4023

4124
[//]: # "Provide any sort of additional supporting content you may want customers to see as well (e.g. more cards, diagrams, changelogs, etc.)"
42-
{{<card-layout >}}
25+
{{<card-layout>}}
4326
{{<card-section title="NGINX" showAsCards="true" >}}
4427
{{<card title="NGINX Plus" titleUrl="/nginx/" brandIcon="NGINX-Plus-product-icon-RGB" >}}
4528
Installing NGINX

layouts/partials/list-main.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ <h3 class="card-title" style="display: flex; align-items: center; gap: 5px;">
2626
<i class="fas fa-{{if eq .Kind "page"}}file-alt{{else}}book{{end}} fa-lg card-img-top"></i>
2727
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a>
2828
</h3>
29-
{{ range $cards }}
30-
{{ if eq .title $title }}
31-
<p>{{ .content }}</p>
29+
{{ with $cards }}
30+
{{ range . }}
31+
{{ if eq (index . "title") $title }}
32+
<p>{{ index . "content" }}</p>
33+
{{ end }}
3234
{{ end }}
3335
{{ end }}
3436
</div>

layouts/shortcodes/card-section.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
{{- if $title -}}
3030
<strong class="card-section-title">{{- $title -}}</strong>
3131
<div class="card-section-content{{ if eq $showAsCards "true" }} {{ $class }} {{ end }} card-deck">{{- .Inner -}}</div>
32-
{{- else -}}
33-
<div class="card-section-content{{ if eq $showAsCards "true" }} {{ $class }} {{ end }} card-deck">{{- .Inner -}}</div>
3432
{{ end }}
3533
</div>
3634
{{ else }}

layouts/shortcodes/card.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ <h2 class="card-title">{{- $title -}}</h2>
3939
<h3 class="card-title" style="display: flex; align-items: center; gap: 5px;">
4040
{{- if $brandIcon -}}
4141
<img class="card-img-top" src="{{ .Site.BaseURL }}/images/icons/{{ $brandIcon }}.png"/>
42+
{{- else -}}
43+
<i class="fas fa-file-alt fa-lg card-img-top"></i>
4244
{{- end -}}
4345
{{- if ($title) -}}
4446
<a href="{{- $titleUrl -}}">{{- $title -}}</a>

0 commit comments

Comments
 (0)