Skip to content

Commit 66df923

Browse files
Merge pull request #1047 from zachlasiuk/add-csp-filter
CSP term page added
2 parents 8b1243a + 7ead014 commit 66df923

File tree

6 files changed

+88
-18
lines changed

6 files changed

+88
-18
lines changed

config.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ cloudFrontDistributionID = "E2VDQ2CYZATMO9"
3232
tools_software_languages = "/tag/:slug/"
3333
operatingsystems = "/tag/:slug/"
3434
subjects = "/tag/:slug/"
35+
cloud_service_providers = "/tag/:slug/"
3536
armips = "/tag/:slug/"
3637

3738
[related]
@@ -40,15 +41,15 @@ cloudFrontDistributionID = "E2VDQ2CYZATMO9"
4041
toLower = false
4142

4243
[[related.indices]]
43-
name = "software"
44+
name = "cloud_service_providers"
4445
weight = 100
4546

4647
[[related.indices]]
47-
name = "tools"
48+
name = "tools_software_languages"
4849
weight = 80
4950

5051
[[related.indices]]
51-
name = "armips"
52+
name = "subjects"
5253
weight = 50
5354

5455
[params]

content/learning-paths/microcontrollers/avh_ppocr/_index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ armips:
2626
operatingsystems:
2727
- Baremetal
2828
tools_software_languages:
29-
- AWS
3029
- Arm Virtual Hardware
3130
- Coding
3231
- GCC

themes/arm-design-system-hugo-theme/layouts/_default/term.html

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,28 @@
3232
<div class="c-row md:is-collapsed u-gap-1-1/2 u-flex-nowrap u-padding-top-1 u-padding-bottom-2-1/2">
3333
<!-- Filter bar on left -->
3434
<div class="c-col filter-column-div u-hide lg:u-display-block u-flex-shrink-0">
35-
<h3 class="u-margin-top-0">Filter</h3>
36-
{{ partial "filter-search-sort/filter-definition.html" (dict "context" . "page_type" "learning-path-term")}}
35+
{{if eq "cloud_service_provider" .Data.Singular}}
36+
<h3 class="u-margin-top-0">{{.Data.Term}} Learning Paths</h3>
37+
<p>
38+
This page lists all Learning Paths focused on {{.Data.Term}} in the Server and Cloud Computing category.
39+
</p>
40+
{{else}}
41+
<h3 class="u-margin-top-0">Filter</h3>
42+
{{ partial "filter-search-sort/filter-definition.html" (dict "context" . "page_type" "learning-path-term")}}
43+
{{end}}
3744
</div>
3845

3946
<!-- Search & Results on Right -->
4047
<div class="c-col">
41-
<!-- Mobile: Search & Filter -->
42-
{{ partial "filter-search-sort/mobile-search-and-filter.html" (dict "context" . "page_type" "learning-path-term")}}
43-
44-
<!-- Bars: Active Filters, # content displayed, sort by. -->
45-
{{ partial "filter-search-sort/active-filter-and-sort-bar.html" (dict "content_to_list" $paths_to_list "page_type" "learning paths")}}
48+
49+
{{if eq "cloud_service_provider" .Data.Singular}}
50+
{{ partial "filter-search-sort/csp-term-page.html" (dict "context" . "content_to_list" $paths_to_list "page_type" "learning paths")}}
51+
{{else}}
52+
<!-- Mobile: Search & Filter -->
53+
{{ partial "filter-search-sort/mobile-search-and-filter.html" (dict "context" . "page_type" "learning-path-term")}}
54+
<!-- Bars: Active Filters, # content displayed, sort by. -->
55+
{{ partial "filter-search-sort/active-filter-and-sort-bar.html" (dict "content_to_list" $paths_to_list "page_type" "learning paths")}}
56+
{{end}}
4657

4758
<!-- List of learning paths on right -->
4859
<div class="c-row">
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{/*
2+
Displays the search status under the search bar: how many results are displaying.
3+
4+
Where it is used:
5+
- term list page
6+
7+
Called from:
8+
- _default/term.html
9+
*/}}
10+
11+
12+
13+
14+
<!-- Search (no filtering) -->
15+
<div class="u-flex u-justify-content-between c-col c-col-12 u-flex u-position-relative u-width-100% lg:u-width-auto u-margin-bottom-0">
16+
<ads-search id="search-box" class="u-margin-top-0 u-width-100%" has-search-button="" placeholder="Search by Learning Path name"></ads-search>
17+
</div>
18+
19+
<!-- Current results & sorting bar -->
20+
<div id="result-sort-div">
21+
<div id="results-status-bar">
22+
<!-- Automatically updates the currently shown number span based on dynamic filtering -->
23+
Displaying
24+
<span id="currently-shown-number" class="num-of-paths-text">{{len .content_to_list }}</span>
25+
of
26+
<span id="total-shown-number" class="num-of-paths-text">{{len .content_to_list }}</span>
27+
{{.page_type}}.
28+
</div>
29+
30+
<!-- Sorting display -->
31+
{{- if ne .page_type "tools" -}}
32+
<div id="sorting-bar">
33+
<span class="sorting-criteria active">Date</span>
34+
</div>
35+
{{- end -}}
36+
</div>
37+
38+

themes/arm-design-system-hugo-theme/layouts/partials/general-formatting/metadata-table.html

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,18 @@ <h2 id="about-marker">{{$page_h2}}</h2>
273273
<td id="tags-for-content" class="td-metadata-value">
274274
<span>
275275
{{ if .Params.subjects}}
276-
<ads-tag href='{{ "/" | relLangURL}}tag/{{.Params.subjects | urlize}}' style="margin-bottom: 4px;">
277-
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">
278-
<span class="fa-solid fa-tag"></span>
279-
{{ .Params.subjects }}
280-
</ads-tag>
276+
<ads-tag href='{{ "/" | relLangURL}}tag/{{.Params.subjects | urlize}}' style="margin-bottom: 4px;">
277+
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">
278+
<span class="fa-solid fa-tag"></span>
279+
{{ .Params.subjects }}
280+
</ads-tag>
281+
{{end}}
282+
{{ if .Params.cloud_service_providers }}
283+
<ads-tag href='{{ "/" | relLangURL}}tag/{{.Params.cloud_service_providers | urlize}}' style="margin-bottom: 4px;">
284+
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">
285+
<span class="fa-solid fa-tag"></span>
286+
{{ .Params.cloud_service_providers }}
287+
</ads-tag>
281288
{{end}}
282289
{{ range .Params.operatingsystems }}
283290
<ads-tag href='{{ "/" | relLangURL}}tag/{{. | urlize}}' style="margin-bottom: 4px;">
@@ -375,13 +382,20 @@ <h2 id="about-marker">{{$page_h2}}</h2>
375382
<tr>
376383
<td id="tags-for-content" class="td-metadata-value margin-l-0">
377384
<span>
378-
{{ if .Params.subjects}}
385+
{{ if .Params.subjects}}
379386
<ads-tag href='{{ "/" | relLangURL}}tag/{{.Params.subjects | urlize}}' style="margin-bottom: 4px;">
380387
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">
381388
<span class="fa-solid fa-tag"></span>
382389
{{ .Params.subjects }}
383390
</ads-tag>
384-
{{end}}
391+
{{end}}
392+
{{ if .Params.cloud_service_providers }}
393+
<ads-tag href='{{ "/" | relLangURL}}tag/{{.Params.cloud_service_providers | urlize}}' style="margin-bottom: 4px;">
394+
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">
395+
<span class="fa-solid fa-tag"></span>
396+
{{ .Params.cloud_service_providers }}
397+
</ads-tag>
398+
{{end}}
385399
{{ range .Params.operatingsystems }}
386400
<ads-tag href='{{ "/" | relLangURL}}tag/{{. | urlize}}' style="margin-bottom: 4px;">
387401
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">

themes/arm-design-system-hugo-theme/layouts/partials/learning-paths/next-steps.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ <h4>Explore Tags</h4>
7272
<span class="fa-solid fa-tag"></span>
7373
{{ (index .learningpathfiles 0).Params.subjects }}
7474
</ads-tag>
75+
{{ if (index .learningpathfiles 0).Params.cloud_service_providers }}
76+
<ads-tag href='{{ "/" | relLangURL}}tag/{{(index .learningpathfiles 0).Params.cloud_service_providers | urlize}}' style="margin-bottom: 4px;">
77+
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">
78+
<span class="fa-solid fa-tag"></span>
79+
{{ (index .learningpathfiles 0).Params.cloud_service_providers }}
80+
</ads-tag>
81+
{{end}}
7582
{{ range (index .learningpathfiles 0).Params.armips }}
7683
<ads-tag href='{{ "/" | relLangURL}}tag/{{. | urlize}}' style="margin-bottom: 4px;">
7784
<span class="u-flex u-flex-row u-align-items-center u-gap-1/2">

0 commit comments

Comments
 (0)