Skip to content

Fix issues with double render #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
25 changes: 4 additions & 21 deletions exampleSite/content/test-product/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,10 @@
description: Test pages for nginx-hugo-theme
title: Test pages
weight: 100
hasCustomContent: true
nd-landing-page: true
---

## About

[//]: # "Give a short 1-2 sentence summary of what the product does and its value to a customer."
This is a compilation of all our shortcodes to show how they look, function, respond, and coded.

## Featured Content

[//]: # "Maximum of three cards available to display."
[//]: # "Each card should be less than 10 words for a description."
[//]: # "If more than three cards are placed here, they are not displayed."
[//]: # "If there is one card, it will take full width and be the only card in the row."
[//]: # "If there is two cards, one card will take half width and there will be two cards in a row."
[//]: # "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."
<!-- <card-layout> - Available params: title (required: string)-->
{{<card-layout >}}
<!-- <card-section> - Available params: title (required: string), showAsCards (optional: boolean, default "false"), isFeaturedSection (optional: boolean, default "false") -->
<!-- If there is no "title" for <card-section>, it is implied it is the main content section and not a new content section -->
{{<card-section showAsCards="true" isFeaturedSection="true">}}
{{<card-layout>}}
{{<card-section showAsCards="true">}}
{{<card title="Everything" titleUrl="everything" icon="circle-dot-dashed">}}
All shortcodes in one page.
{{</card >}}
Expand All @@ -39,7 +22,7 @@ This is a compilation of all our shortcodes to show how they look, function, res
## Other Content

[//]: # "Provide any sort of additional supporting content you may want customers to see as well (e.g. more cards, diagrams, changelogs, etc.)"
{{<card-layout >}}
{{<card-layout>}}
{{<card-section title="NGINX" showAsCards="true" >}}
{{<card title="NGINX Plus" titleUrl="/nginx/" brandIcon="NGINX-Plus-product-icon-RGB" >}}
Installing NGINX
Expand Down
25 changes: 0 additions & 25 deletions layouts/partials/list-main.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,6 @@ <h1 class="bd-title">
{{ partial "banner" .}}
{{ $hasCustomContent := index .Params "nd-landing-page" | default false }}
{{ if $hasCustomContent }}
{{ $cards := .Page.Scratch.Get "cards" }}
<section data-mf="false">
<div class="row">
<div class="card-deck">
{{ range .Pages.GroupBy "Section" }}
{{ range .Pages.ByWeight }}
{{ $title := .Title }}
<div class="col-md-5 card">
<div class="card-body">
<h3 class="card-title" style="display: flex; align-items: center; gap: 5px;">
<i class="fas fa-{{if eq .Kind "page"}}file-alt{{else}}book{{end}} fa-lg card-img-top"></i>
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a>
</h3>
{{ range $cards }}
{{ if eq .title $title }}
<p>{{ .content }}</p>
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
</div>
</div>
</section>
{{ .Content }}
{{ else }}
<section data-mf="false">
Expand Down
2 changes: 2 additions & 0 deletions layouts/shortcodes/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ <h2 class="card-title">{{- $title -}}</h2>
<h3 class="card-title" style="display: flex; align-items: center; gap: 5px;">
{{- if $brandIcon -}}
<img class="card-img-top" src="{{ .Site.BaseURL }}/images/icons/{{ $brandIcon }}.png"/>
{{- else -}}
<i class="fas fa-file-alt fa-lg card-img-top"></i>
{{- end -}}
{{- if ($title) -}}
<a href="{{- $titleUrl -}}">{{- $title -}}</a>
Expand Down
Loading