Skip to content

Commit 1078201

Browse files
committed
refactor so subject-ml is not seen as a learning path
1 parent 7bbc947 commit 1078201

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

  • content/subject-ml
  • themes/arm-design-system-hugo-theme/layouts/_default
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
22
title: AI
33
slug: ml
4+
build:
5+
render: never
6+
list: never
7+
publishResources: false
48
pinned_learning_paths:
59
- learning-paths/cross-platform/kleidiai-explainer
610
- learning-paths/servers-and-cloud-computing/vllm-acceleration

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@
4040
<!-- Sort using the CalculatedDate -->
4141
{{ $sorted_paths_to_list := sort $blogs "calculated_date" "desc" }}
4242

43-
<!-- Allow taxonomy term pages to pin learning paths via term front matter.
44-
Hugo does not expose term bundle front matter on .Params here, so resolve it explicitly.
45-
Example: content/subjects/ml/_index.md
43+
<!-- Allow taxonomy term pages to pin learning paths via content-owned front matter.
44+
Prefer a single-directory helper page like content/subject-ml/index.md, and
45+
fall back to Hugo's taxonomy bundle layout content/subjects/ml/_index.md.
4646
-->
47-
{{ $term_content_page := site.GetPage (printf "/%s/%s" .Data.Plural (.Data.Term | urlize)) }}
47+
{{ $term_slug := .Data.Term | urlize }}
48+
{{ $term_page_key := printf "/%s-%s" (.Data.Singular | replace "_" "-") $term_slug }}
49+
{{ $term_content_page := site.GetPage $term_page_key }}
50+
{{ if not $term_content_page }}
51+
{{ $term_content_page = site.GetPage (printf "/%s/%s" .Data.Plural $term_slug) }}
52+
{{ end }}
4853
{{ $pinned_paths := default (slice) .Params.pinned_learning_paths }}
4954
{{ with $term_content_page }}
5055
{{ $pinned_paths = default $pinned_paths .Params.pinned_learning_paths }}

0 commit comments

Comments
 (0)