Skip to content

Commit 71f0e64

Browse files
authored
Landing: Fix issues with double render (#288)
1 parent 28f9d22 commit 71f0e64

File tree

3 files changed

+6
-46
lines changed

3 files changed

+6
-46
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: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,6 @@ <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>
4116
{{ .Content }}
4217
{{ else }}
4318
<section data-mf="false">

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)