Skip to content

Commit a354fc4

Browse files
committed
Chore: Merge branch 'mainframe' into new-tests
2 parents 2882cd5 + e233b60 commit a354fc4

25 files changed

+184
-251
lines changed

.github/workflows/hugo-build-test.yml

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

assets/css/v2/style.css

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ textarea:not([rows]) {
131131
:root {
132132
/* webfonts */
133133
font-family: var(--font-family);
134-
font-feature-settings:
135-
"liga" on,
136-
"calt" on;
134+
font-feature-settings: "liga" on, "calt" on;
137135

138136
/* fallback to slightly thinner font on browsers without variable 'wght' support */
139137
font-weight: 350;
@@ -143,9 +141,9 @@ textarea:not([rows]) {
143141

144142
/* MARK: Variables
145143
*/
146-
--font-family:
147-
"Inter var", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
148-
Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
144+
--font-family: "Inter var", system-ui, -apple-system, BlinkMacSystemFont,
145+
"Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
146+
sans-serif;
149147
--color-brand: 56.6% 0.194 147.7;
150148
--color-brand-300: 0.84 0.0699 157.51;
151149
--color-brand-200: 0.91 0.0406 157.72;
@@ -263,10 +261,9 @@ textarea:not([rows]) {
263261

264262
@supports (font-variation-settings: normal) {
265263
:root {
266-
--font-family:
267-
InterVariable, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
268-
Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
269-
sans-serif;
264+
--font-family: InterVariable, system-ui, -apple-system, BlinkMacSystemFont,
265+
"Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
266+
"Helvetica Neue", sans-serif;
270267
}
271268

272269
h1,
@@ -442,6 +439,7 @@ ol li:last-child {
442439
}
443440

444441
.header__search {
442+
display: block;
445443
width: 14rem;
446444
/* This is a horrible hack to stop coveo overflowing 3500px for no reason. :sad */
447445
transform: translateY(0);
@@ -569,6 +567,12 @@ ol li:last-child {
569567
display: flex;
570568
align-self: center;
571569
}
570+
571+
.header {
572+
.header__logo-small {
573+
display: unset;
574+
}
575+
}
572576
}
573577

574578
/* sidebar layout */
@@ -633,6 +637,10 @@ ol li:last-child {
633637
scrollbar-gutter: stable;
634638
}
635639
}
640+
641+
.sidebar__search {
642+
display: none;
643+
}
636644
}
637645

638646
/* This is our "mobile" or no sidebar breakpoint */
@@ -641,10 +649,24 @@ ol li:last-child {
641649
.sidebar {
642650
/* Above search */
643651
z-index: 11;
644-
display: unset;
652+
display: block;
645653
transform: translateX(0);
646654
border-bottom: 1px solid oklch(var(--color-divider));
647-
height: fit-content;
655+
656+
position: fixed;
657+
top: 0;
658+
left: 0;
659+
660+
.sidebar__content__wrapper {
661+
display: flex;
662+
flex-direction: column;
663+
}
664+
665+
.sidebar__search {
666+
display: unset;
667+
width: calc(var(--sidebar-width) - 4rem);
668+
margin-left: 1rem;
669+
}
648670
}
649671
}
650672

@@ -655,6 +677,11 @@ ol li:last-child {
655677
margin: 0;
656678
}
657679
}
680+
.header-container {
681+
.header__search {
682+
display: none;
683+
}
684+
}
658685
}
659686

660687
.header__product-selector {
@@ -945,6 +972,10 @@ main {
945972
--atomic-border-radius-md: 0;
946973
--atomic-border-radius: 0;
947974
--atomic-font-family: var(--font-family);
975+
976+
atomic-search-box {
977+
z-index: 0;
978+
}
948979
}
949980

950981
atomic-search-interface {
@@ -1203,9 +1234,7 @@ nav.sidebar.sidebar__mobile-open {
12031234
border-radius: 5px 0 0 5px;
12041235
color: oklch(0 0 0 / 0.75);
12051236
text-decoration: none;
1206-
transition:
1207-
background-color 0.2s ease,
1208-
color 0.2s ease;
1237+
transition: background-color 0.2s ease, color 0.2s ease;
12091238

12101239
&:hover {
12111240
background-color: oklch(var(--color-brand) / 0.08);

assets/js/coveo.js

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ async function atomicCoveo() {
3636
/* Initialize the interfaces with credentials */
3737
const searchPageInterface = document.querySelector('#search-v2');
3838
const searchBarHeader = document.querySelector('#search-standalone-header');
39+
const searchBarSidebar = document.querySelector('#search-standalone-sidebar');
3940

4041
if (searchPageInterface) {
4142
await searchPageInterface.initialize({
@@ -53,21 +54,41 @@ async function atomicCoveo() {
5354
await searchPageInterface.executeFirstSearch();
5455
}
5556

56-
/* Initialize the header searchbar*/
57-
await searchBarHeader.initialize({
58-
accessToken: token,
59-
organizationId: org_id,
60-
analytics: { analyticsMode: 'legacy' },
61-
preprocessRequest: (request) => {
62-
const body = JSON.parse(request.body);
63-
body.q = `<@- ${body.q} -@>`;
64-
request.body = JSON.stringify(body);
57+
/* Initialize the header searchbar */
58+
if (searchBarHeader) {
59+
await searchBarHeader.initialize({
60+
accessToken: token,
61+
organizationId: org_id,
62+
analytics: { analyticsMode: 'legacy' },
63+
preprocessRequest: (request) => {
64+
const body = JSON.parse(request.body);
65+
body.q = `<@- ${body.q} -@>`;
66+
request.body = JSON.stringify(body);
6567

66-
return request;
67-
},
68-
});
68+
return request;
69+
},
70+
});
6971

70-
await searchBarHeader.executeFirstSearch();
72+
await searchBarHeader.executeFirstSearch();
73+
}
74+
75+
/* Initialize the sidebar searchbar */
76+
if (searchBarSidebar) {
77+
await searchBarSidebar.initialize({
78+
accessToken: token,
79+
organizationId: org_id,
80+
analytics: { analyticsMode: 'legacy' },
81+
preprocessRequest: (request) => {
82+
const body = JSON.parse(request.body);
83+
body.q = `<@- ${body.q} -@>`;
84+
request.body = JSON.stringify(body);
85+
86+
return request;
87+
},
88+
});
89+
90+
await searchBarSidebar.executeFirstSearch();
91+
}
7192
}
7293

7394
document.addEventListener('DOMContentLoaded', async () => {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{<banner "caution" "Under development">}}
2+
<br>
3+
This product on our example site is under development and changes are being added frequently.
4+
<br>
5+
Please reach out to <strong>#friends-of-the-docs</strong> on Slack to ask questions.
6+
{{</banner>}}

exampleSite/content/test-product/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ nd-content-type: landing-page
1313
# Intended for internal catalogue and search, case sensitive:
1414
# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit
1515
nd-product:
16+
cascade:
17+
nd-banner:
18+
enabled: true
19+
start-date: 2025-01-01
20+
md: /_banners/test-product-intro.md
1621
---
1722

1823
## About

exampleSite/content/test-product/call-out/call-out-param-types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ The callout shortcode aims to support both, but **not** in the same shortcode in
1313
## The two callouts below using **unnamed** params
1414

1515
{{<call-out "" "Custom title" "fa fa-check-circle" "true">}}
16-
This callout uses the icon check-circle. **This should be an inline callout.**
16+
This callout uses the icon check-circle. **This should be an sideline callout.**
1717
{{</call-out>}}
1818

1919
{{<call-out "" "Custom title" "fa fa-check-circle" "false">}}
20-
This callout uses the icon check-circle. **This should be an sideline callout.**
20+
This callout uses the icon check-circle. **This should be an inline callout.**
2121
{{</call-out>}}
2222

2323
## The two callouts below using **named** params
2424
This should work exactly the same as the two callouts above
2525

26-
{{<call-out title="Custom title" icon="fa fa-check-circle" inline="true">}}
27-
This callout uses the icon check-circle. **This should be an inline callout.**
26+
{{<call-out title="Custom title" icon="fa fa-check-circle" sideline="true">}}
27+
This callout uses the icon check-circle. **This should be an sideline callout.**
2828
{{</call-out>}}
2929

30-
{{<call-out title="Custom title" icon="fa fa-check-circle" inline="asdas">}}
30+
{{<call-out title="Custom title" icon="fa fa-check-circle" sideline="true">}}
3131
This callout uses the icon check-circle. **This should be an sideline callout.**
3232
{{</call-out>}}

exampleSite/content/test-product/call-out/call-out-side.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ This assumes the callout text is shorter than the text in the callout.
4646
If the text in the paragraph is shorter than the callout, it's likely
4747
the content needs to be re-written.
4848

49-
{{<call-out "tip inline-callout" "Tip for Automated Reporting" >}}
49+
{{<call-out "tip" "Tip for Automated Reporting" >}}
5050
I am some call out text. Look at me go!
5151
{{</call-out>}}

layouts/partials/callout.html

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,48 @@
22
{{ $class := .class | default "" }}
33
{{ $title := .title | default "" }}
44
{{ $icon := .icon | default "" }}
5-
{{ $inlineParam := .inline | default "false" | lower }}
5+
{{ $sidelineParam := .sideline | default "false" | lower }}
66

7-
{{ if not (in (slice "true" "false") $inlineParam) }}
8-
{{ errorf "Invalid parameter 'inline'='%s' passed to blockquote partial from '%s'. Allowed values: true, false" $inlineParam .Page.Path }}
7+
{{ if not (in (slice "true" "false") $sidelineParam) }}
8+
{{ errorf "Invalid parameter 'sideline'='%s' passed to blockquote partial from '%s'. Allowed values: true, false" $sidelineParam .Page.Path }}
99
{{ end }}
1010

1111
{{/* Figure out inline/side and set class accordingly */}}
12-
{{ $inline := eq $inlineParam "true" }}
12+
{{ $sideline := eq $sidelineParam "true" }}
1313
{{ $sideOption := "side-callout" }}
1414
{{ $inlineOption := "inline-callout" }}
1515

16-
{{ if $inline }}
16+
{{ if $sideline }}
1717
{{ $class = printf "%s %s" $class $sideOption }}
1818
{{ else }}
1919
{{ $class = printf "%s %s" $class $inlineOption }}
2020
{{ end }}
2121

2222
{{/* Render a different block, if "loud" callouts are used */}}
23+
{{ $type := (index (split $class " ") 0) | strings.FirstUpper }}
2324
{{ $specialTitles := slice "Caution" "Warning" "Deprecated" "Important" }}
2425
{{ $specialTitleIcons := dict
2526
"Caution" "alert-triangle"
2627
"Warning" "alert-octagon"
2728
"Deprecated" "alert-octagon"
2829
"Important" "arrow-right-circle"
2930
}}
30-
{{ $icon := index $specialTitleIcons $title | default "" }}
31+
{{ $icon := index $specialTitleIcons $type | default "" }}
3132

32-
{{ $isSpecialTitle := in $specialTitles $title }}
33+
{{ $isSpecialTitle := in $specialTitles $type }}
3334
{{ if $isSpecialTitle }}
34-
{{/* Loud callouts */}}
35+
{{/* Loud callouts */}}
36+
<blockquote class="{{ $class }}">
3537
<div>
36-
<blockquote class="{{ $class }}">
37-
<div>
38-
<div class="call-out-type">
39-
{{ partial "feather" (dict "context" . "icon" $icon) .}}
40-
{{ $title }}
41-
</div>
42-
<div class="callout-content">
43-
{{ .content | markdownify }}
44-
</div>
38+
<div class="call-out-type">
39+
{{ partial "feather" (dict "context" . "icon" $icon) .}}
40+
{{ $title }}
4541
</div>
46-
</blockquote>
47-
</div>
42+
<div class="callout-content">
43+
{{ .content | markdownify }}
44+
</div>
45+
</div>
46+
</blockquote>
4847

4948
{{ else }}
5049

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Get the product name -->
2+
{{ $productUrl := .Page.Permalink }}
3+
{{ $baseUrl := .Site.BaseURL }}
4+
{{ $linkSplit := split (replace $productUrl $baseUrl "") "/" }}
5+
{{ $productName := index $linkSplit 0 }}
6+
<!-- Get the content -->
7+
{{ $changelogContent := readFile (printf "content/%s/changelog.md" $productName) }}
8+
{{ $maxNumLogs := 3 }}
9+
{{ $headings := first $maxNumLogs (findRE `(?m)^##\s(.+)$` $changelogContent) }}
10+
11+
<ul>
12+
{{ if gt (len $headings) 0 }}
13+
{{ range $headings }}
14+
{{ $title := replaceRE "^##\\s" "" . }}
15+
<li><a href="{{ absURL (print $productName "/changelog/#" (urlize $title)) }}">{{ $title }}</a></li>
16+
{{ end }}
17+
<li><a href="{{ absURL (print $productName "/changelog/")}}">Older...</a></li>
18+
{{ else }}
19+
<li><p>No changelog found...</p></li>
20+
{{ end }}
21+
</ul>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{ $redirectionUrl := .redirectionUrl | default "/search.html" }}
2-
<atomic-search-interface id="search-standalone-header">
2+
{{ $id := .id | default "search-standalone-header"}}
3+
<atomic-search-interface id={{ $id }}>
34
<atomic-search-box redirection-url={{ $redirectionUrl }} class="header-search-box">
45
</atomic-search-box>
5-
</atomic-search-interface>
6+
</atomic-search-interface>

0 commit comments

Comments
 (0)