Skip to content

Commit 84fa71d

Browse files
committed
Chore: Merge branch 'main' into mainframe
2 parents 8c23ad0 + 88f2a47 commit 84fa71d

File tree

14 files changed

+224
-143
lines changed

14 files changed

+224
-143
lines changed

.github/workflows/build-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
jobs:
1313
deploy-example-site:
14-
uses: nginxinc/docs-actions/.github/workflows/docs-build-push.yml@9c59fab05a8131f4d691ba6ea2b6a119f3ef832a # v1.0.7
14+
uses: nginxinc/docs-actions/.github/workflows/docs-build-push.yml@285440f02d9967b62aeb1b7e0b5c2c70d4f950cf # v1.0.10
1515
with:
1616
production_url_path: "/nginx-hugo-theme"
1717
preview_url_path: "/previews/nginx-hugo-theme"

assets/css/v2/style.css

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,31 +1200,88 @@ h6:has(a):hover {
12001200
}
12011201

12021202
/* Landing page cards */
1203-
12041203
.text-content .card-layout {
1205-
grid-column: 1 / -1;
1204+
grid-column: 1;
12061205

12071206
.card-section {
1208-
margin-bottom: 1rem;
1207+
display: flex;
1208+
flex-direction: column;
1209+
gap: 1rem;
12091210

12101211
strong {
12111212
font-weight: 500;
12121213
}
1214+
1215+
/* Hide all the cards past 3 if it is a featured card section */
1216+
&.featured-section {
1217+
.card-section-content.card-grid > *:nth-child(n + 4) {
1218+
display: none;
1219+
}
1220+
}
12131221
}
12141222
}
12151223

12161224
/* Optional grid layout */
12171225
.card-grid {
12181226
display: grid;
1219-
grid-template-columns: repeat(auto-fit, minmax(120px, 500px));
1227+
grid-template-columns: repeat(auto-fit, minmax(33%, 1fr));
12201228
gap: 1.5rem;
1221-
margin-top: 1rem;
12221229

12231230
.card-container {
12241231
border: 1px solid oklch(var(--color-codeblock-border));
12251232
box-shadow: 3px 3px 0px oklch(var(--color-shadow));
1226-
padding: 1rem 2rem 2rem 2rem;
1227-
margin-bottom: 1.5rem;
1233+
padding: 1rem;
1234+
1235+
&.featured-card {
1236+
/* If there is a featured card, only the featured card should be full length */
1237+
grid-column: 1 / -1;
1238+
1239+
/* If there is a featured card AND two cards, the last one should be full length */
1240+
~ .card-container:nth-child(2n):last-child {
1241+
grid-column: 1 / -1;
1242+
}
1243+
}
1244+
}
1245+
1246+
/* If there is no featured card, last card that is the 3rd one should be full width */
1247+
&:not(:has(.featured-card)) .card-container:nth-child(3n):last-child {
1248+
grid-column: 1 / -1;
1249+
}
1250+
}
1251+
1252+
.card-container {
1253+
display: flex;
1254+
flex-direction: column;
1255+
gap: 0.5rem;
1256+
margin-bottom: 1rem;
1257+
1258+
.card-header {
1259+
display: flex;
1260+
flex-direction: row;
1261+
gap: 0.5rem;
1262+
1263+
.card-brand-icon {
1264+
height: 20px;
1265+
width: auto;
1266+
}
1267+
1268+
h2 {
1269+
padding: 0;
1270+
margin: 0;
1271+
font-size: 1rem;
1272+
}
1273+
}
1274+
}
1275+
1276+
.list-header-container {
1277+
display: flex;
1278+
gap: 1.5rem;
1279+
align-items: center;
1280+
justify-content: start;
1281+
1282+
img {
1283+
width: auto;
1284+
height: 3.5rem;
12281285
}
12291286
}
12301287

exampleSite/content/test-product/_index.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,45 @@ title: Test pages
44
weight: 100
55
hasCustomContent: 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."
721
<!-- <card-layout> - Available params: title (required: string)-->
8-
{{< card-layout >}}
9-
<!-- <card-section> - Available params: title (required: string), showAsCards (optional: boolean, default false) -->
22+
{{<card-layout >}}
23+
<!-- <card-section> - Available params: title (required: string), showAsCards (optional: boolean, default "false"), isFeaturedSection (optional: boolean, default "false") -->
1024
<!-- 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)) -->
25+
{{<card-section showAsCards="true" isFeaturedSection="true">}}
26+
{{<card title="Everything" titleUrl="everything" icon="circle-dot-dashed">}}
27+
All shortcodes in one page.
28+
{{</card >}}
29+
{{<card title="Call Out usages" titleUrl="call-out/all-callouts/" icon="message-square">}}
30+
<!-- <card> - Available params: title (required: string), titleUrl (optional: string, relative path or absolute URL (e.g. https://google.com)), icon (optional: string, pulled from lucide), brandIcon (optional: string, takes priority over icon if provided) -->
1431
Examples for call-out shortcode
15-
{{</ card >}}
16-
{{< card title="Code Block usages" >}}
32+
{{</card >}}
33+
{{<card title="Code Block usages" titleUrl="code-blocks/code-blocks-highlighting/" icon="code">}}
1734
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/" >}}
35+
{{</card >}}
36+
{{</card-section>}}
37+
{{</card-layout >}}
38+
39+
## Other Content
40+
41+
[//]: # "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 >}}
43+
{{<card-section title="NGINX" showAsCards="true" >}}
44+
{{<card title="NGINX Plus" titleUrl="/nginx/" brandIcon="NGINX-Plus-product-icon-RGB" >}}
2345
Installing NGINX
24-
{{</ card >}}
25-
{{</ card-section >}}
26-
{{</ card-layout >}}
46+
{{</card >}}
47+
{{</card-section >}}
48+
{{</card-layout >}}

layouts/_default/docs.html

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

layouts/_default/list.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@
1818
{{ end }}
1919
{{ end }}
2020
</section>
21-
<h1>{{ .Title }}</h1>
21+
<div class="list-header-container">
22+
<img src="/images/icons/{{ .Params.logo | default "NGINX-product-icon.svg" }}">
23+
<div class="list-header-title">
24+
<h1>{{ .Title }}</h1>
25+
{{ if index .Params "nd-subtitle" }}
26+
<p>{{ index .Params "nd-subtitle" | markdownify }}</p>
27+
{{ end }}
28+
</div>
29+
</div>
2230

2331
{{ partial "banner" . }}
24-
25-
{{ $hasCustomContent := .Params.hasCustomContent | default false }}
32+
{{ $hasCustomContent := index .Params "nd-landing-page" | default false }}
2633
{{ if $hasCustomContent }}
27-
{{ .Page.Scratch.Set "custom-landing-page-file-name" "custom-landing-page.html" }}
28-
{{ .Page.Scratch.Set "custom-landing-page-context" . }}
2934
{{ .Content }}
3035
{{ else }}
31-
{{ .Content }}
3236
{{ range .Pages.ByWeight }}
3337
<h2>
3438
<a href="{{ if .Params.url}}{{ .Params.url}}{{else}}{{ .Permalink }}{{end}}">{{ .Title }}</a>

layouts/_default/single.html

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,72 @@
1-
{{ .Render "docs" }}
1+
{{ define "main" }}
2+
<div class="docs-container row override-sidebar-collapse">
3+
<nav id="sidebar" class="sidenav overflow-auto col-md-3 d-none d-xl-block d-print-none align-top">
4+
{{ partial "sidebar.html" . }}
5+
</nav>
26

7+
<!-- Replace icons -->
8+
{{ $content := partial "icon-replacement.html" (dict "content" .Content) }}
9+
10+
{{if (.Params.catalog) }}
11+
<main class="content content-has-toc" role="main">
12+
{{ else if and (gt .WordCount 200 ) (.Params.toc) }}
13+
<main class="content col d-block align-top content-has-toc" role="main">
14+
{{ else }}
15+
<main class="content col d-block align-top content-no-toc" role="main">
16+
{{ end }}
17+
18+
<section class="main-layout">
19+
<div class="sidebar-layout" id="sidebar-layout">
20+
<button class="sidebar__mobile__toggle" aria-expanded="false" data-mf="true">{{ partial "lucide" (dict "context" . "icon" "x")}}Close</button>
21+
<nav data-mf="true" id="sidebar-v2" class="sidebar">
22+
{{ partial "sidebar-v2.html" . }}
23+
</nav>
24+
</div>
25+
26+
<section id="maincontent" class="content-layout">
27+
<div data-cms-edit="content" class="text-content">
28+
<section class="breadcrumb-layout wide" data-mf="true" style="display: none;">
29+
{{ if not .IsHome }}
30+
{{ if not (in .Params.display_breadcrumb "false" ) }}
31+
{{ partial "breadcrumb" .}}
32+
{{ end }}
33+
{{ end }}
34+
</section>
35+
{{ partial "banner" .}}
36+
<h1>{{ .Title }}</h1>
37+
{{ $content | safeHTML }}
38+
{{ if eq .Page.Draft true }}{{ partial "draft-badge.html" . }}{{ end }}
39+
{{ if in .Params.doctypes "beta" }}{{ partial "beta-badge" . }}{{ end }}
40+
41+
<hr>
42+
43+
{{ if .Page.Lastmod }}
44+
<div class="last-modified">
45+
{{ partial "page-meta-links" . }}
46+
</div>
47+
{{ end }}
48+
49+
{{ partial "version-list" . }}
50+
{{ partial "qualtrics-feedback.html" }}
51+
52+
{{ partial "previous-next-links-in-section-with-title.html" . }}
53+
</main>
54+
{{ if and (gt .WordCount 200 ) (.Params.toc) }}
55+
{{ if (add (len (findRE "<h3" .Content)) (len (findRE "<h2" .Content))) }}
56+
<div id="toc" class="col-md-3 d-none d-xl-block d-print-none nginx-toc align-top">
57+
{{ partial "toc.html" . }}
58+
</div>
59+
{{ end }}
60+
{{ end }}
61+
62+
</div>
63+
</section>
64+
</section>
65+
</div>
66+
<!-- If there is a script defined in the page metadata, load it -->
67+
{{if .Params.script}}
68+
{{ $script := (delimit (slice "scripts" .Params.script) "/")}}
69+
{{ partial (string $script) .}}
70+
{{end }}
71+
72+
{{ end }}

layouts/partials/banner.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- with .Params.banner -}}
1+
{{- with index .Params "nd-banner" -}}
22
{{- if .enabled -}}
33
<!-- Gather the dates and default to beginning or end of time if frontmatter is not provided -->
44
{{- $currentDate := now | dateFormat "2006-01-02" -}}

layouts/partials/custom-landing-page.html

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

layouts/shortcodes/card-layout.html

Lines changed: 1 addition & 4 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 }}
5-
<div class="card-layout">{{- .Inner | markdownify -}}</div>
2+
<div class="card-layout">{{ .Inner | markdownify }}</div>

0 commit comments

Comments
 (0)