Skip to content

Commit 3ffd1d2

Browse files
committed
Card: Fixed build error on card-layout due to Scratch
1 parent e3f9270 commit 3ffd1d2

File tree

4 files changed

+1
-50
lines changed

4 files changed

+1
-50
lines changed

exampleSite/content/test-product/_index.md

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,4 @@
22
description: Test pages for nginx-hugo-theme
33
title: Test pages
44
weight: 100
5-
hasCustomContent: true
6-
---
7-
<!-- <card-layout> - Available params: title (required: string)-->
8-
{{< card-layout >}}
9-
<!-- <card-section> - Available params: title (required: string), showAsCards (optional: boolean, default false) -->
10-
<!-- If there is no "title" for <card-section>, it is implied it is the main content section and not a new content section -->
11-
{{< card-section >}}
12-
{{< 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)) -->
14-
Examples for call-out shortcode
15-
{{</ card >}}
16-
{{< card title="Code Block usages" >}}
17-
Examples for codeblock shortcode
18-
{{</ card >}}
19-
{{</ card-section >}}
20-
# Other Products on ExampleSite
21-
{{< card-section title="NGINX" showAsCards="true" >}}
22-
{{< card title="NGINX Plus" titleUrl="/nginx/" >}}
23-
Installing NGINX
24-
{{</ card >}}
25-
{{</ card-section >}}
26-
{{</ card-layout >}}
5+
---

layouts/_default/list.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ <h1>{{ .Title }}</h1>
1717

1818
{{ $hasCustomContent := .Params.hasCustomContent | default false }}
1919
{{ if $hasCustomContent }}
20-
{{ .Page.Scratch.Set "custom-landing-page-file-name" "custom-landing-page.html" }}
21-
{{ .Page.Scratch.Set "custom-landing-page-context" . }}
2220
{{ .Content }}
2321
{{ else }}
24-
{{ .Content }}
2522
{{ range .Pages.ByWeight }}
2623
<h2>
2724
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a>

layouts/partials/custom-landing-page.html

Lines changed: 0 additions & 22 deletions
This file was deleted.

layouts/shortcodes/card-layout.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
<!-- Render the main content first with modifications, then render the custom content -->
2-
{{ $customLandingPageFileName := .Page.Scratch.Get "custom-landing-page-file-name" }}
3-
{{ $customLandingPageContext := .Page.Scratch.Get "custom-landing-page-context" }}
4-
{{ partial $customLandingPageFileName $customLandingPageContext }}
52
<div class="card-layout">{{- .Inner | markdownify -}}</div>

0 commit comments

Comments
 (0)