Skip to content

Commit c6df47d

Browse files
Copilotbrunoborges
andauthored
Add feature/topic tags for improved snippet discoverability
- Add tags field to all 113 content YAML files with appropriate Java feature tags (records, sealed-classes, pattern-matching, switch, virtual-threads, streams, optional, collections, null-safety, text-blocks, var, concurrency, and more) - Update content/template.json with tags field example - Add html-generators/tags.properties mapping tag slugs to display names - Add templates/topic-page.html template for topic listing pages - Update templates/slug-template.html to render tag pills ({{tagPills}} token) - Update templates/index-card.html to include data-tags attribute for filtering - Update html-generators/generate.java to: - Parse tags from Snippet content - Include tags in snippets.json - Add data-tags attribute to index cards - Render tag pill links on snippet detail pages - Generate 43 topic pages at site/topics/{tag}.html - Update site/styles.css with tag-pill and topic-badge styles - Update site/app.js to show cards on topic pages and search by tags - Update translations/strings/en.yaml with sections.tags and topics.* keys - Update .gitignore to exclude site/topics/*.html (generated files) - Update .github/workflows/deploy.yml to regenerate on tags.properties/categories.properties changes Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent c38e9d5 commit c6df47d

124 files changed

Lines changed: 618 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
- 'site/**'
1111
- 'html-generators/generateog.java'
1212
- 'html-generators/og/**'
13+
- 'html-generators/tags.properties'
14+
- 'html-generators/categories.properties'
1315
workflow_run:
1416
workflows: ['Build Generator JARs']
1517
types: [completed]
@@ -53,7 +55,7 @@ jobs:
5355
5456
NEEDS_GENERATE=false
5557
56-
if echo "$CHANGED" | grep -qE '^(content/|translations/|templates/)'; then
58+
if echo "$CHANGED" | grep -qE '^(content/|translations/|templates/|html-generators/tags\.properties|html-generators/categories\.properties)'; then
5759
NEEDS_GENERATE=true
5860
fi
5961

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ site/security/*.html
1111
site/tooling/*.html
1212
site/enterprise/*.html
1313

14+
# Generated topic pages (built by html-generators/)
15+
site/topics/*.html
16+
1417
# Generated aggregate file (built from individual JSON sources by html-generators/)
1518
site/data/snippets.json
1619

content/collections/collectors-teeing.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ related:
4646
- "collections/copying-collections-immutably"
4747
- "collections/unmodifiable-collectors"
4848
- "collections/stream-toarray-typed"
49+
tags:
50+
- streams
51+
- collectors
4952
docs:
5053
- title: "Collectors.teeing()"
5154
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/stream/Collectors.html#teeing(java.util.stream.Collector,java.util.stream.Collector,java.util.function.BiFunction)"

content/collections/copying-collections-immutably.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ related:
4040
- "collections/immutable-set-creation"
4141
- "collections/map-entry-factory"
4242
- "collections/immutable-list-creation"
43+
tags:
44+
- collections
4345
docs:
4446
- title: "List.copyOf()"
4547
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/List.html#copyOf(java.util.Collection)"

content/collections/immutable-list-creation.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ related:
4242
- "collections/immutable-map-creation"
4343
- "collections/immutable-set-creation"
4444
- "collections/sequenced-collections"
45+
tags:
46+
- collections
4547
docs:
4648
- title: "List.of()"
4749
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/List.html#of()"

content/collections/immutable-map-creation.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ related:
4040
- "collections/copying-collections-immutably"
4141
- "collections/sequenced-collections"
4242
- "streams/stream-tolist"
43+
tags:
44+
- collections
4345
docs:
4446
- title: "Map.of()"
4547
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Map.html#of()"

content/collections/immutable-set-creation.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ related:
4141
- "collections/copying-collections-immutably"
4242
- "collections/collectors-teeing"
4343
- "streams/stream-tolist"
44+
tags:
45+
- collections
4446
docs:
4547
- title: "Set.of()"
4648
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Set.html#of()"

content/collections/map-entry-factory.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ related:
3838
- "collections/sequenced-collections"
3939
- "collections/immutable-map-creation"
4040
- "collections/immutable-list-creation"
41+
tags:
42+
- collections
4143
docs:
4244
- title: "Map.entry()"
4345
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/Map.html#entry(K,V)"

content/collections/reverse-list-iteration.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ related:
4343
- "collections/sequenced-collections"
4444
- "collections/immutable-list-creation"
4545
- "streams/stream-tolist"
46+
tags:
47+
- collections
4648
docs:
4749
- title: "SequencedCollection (Java 21)"
4850
href: "https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/SequencedCollection.html"

content/collections/sequenced-collections.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ related:
4242
- "collections/collectors-teeing"
4343
- "collections/immutable-set-creation"
4444
- "collections/immutable-map-creation"
45+
tags:
46+
- collections
4547
docs:
4648
- title: "Sequenced Collections (JEP 431)"
4749
href: "https://openjdk.org/jeps/431"

0 commit comments

Comments
 (0)