Skip to content

Commit f722a2e

Browse files
Improve documentation discovery with categorisation and filtering (#242)
* Improve documentation discovery with visual categorisation and filtering Added icons, badges, and client-side filtering to documentation index pages to help visitors quickly find relevant guides as the guide count grows. - Filter buttons (All, Proxy, Filters, Kubernetes, Developer) with counts - Category icons in card headers using Bootstrap Icons (cpu, puzzle, boxes, code-slash, shield-lock) - Visible tag badges at bottom of cards - Subtle category-specific border colours on cards - Vanilla JavaScript for client-side filtering with progressive enhancement - Cards reflow properly when filtered (no gaps in grid layout) Added two new filter categories to better organise documentation: - Security: for encryption, authentication, and authorisation guides - Governance: for compliance and validation guides Changes: - Added 'security' tag to: Proxy guide, Record Encryption quickstart/guide, OAuth Bearer Validation, SASL Inspection, and Authorization guides - Added 'governance' tag to: Record Validation Guide - Removed overly-specific 'record-encryption' and 'encryption-at-rest' tags - Added Security and Governance filter buttons with shield-lock and check-square-fill icons respectively - Updated icon mapping and CSS border styles for new categories - Applied changes to versions 0.16.0 through 0.19.0 Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Tom Bentley <tbentley@redhat.com>
1 parent f87a609 commit f722a2e

9 files changed

Lines changed: 254 additions & 14 deletions

File tree

CLAUDE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,51 @@ Instead, issues for the website are held in the main Kroxylicious repo `https://
2020
So if you need to interact with website issues you can use the `-R kroxylicious/kroxylicious` option, for example: `gh issue list -R kroxylicious/kroxylicious`.
2121

2222
When making commits, use the `Assisted-by:` trailer to attribute changes to AI tooling, rather than `Coauthored-by:`.
23+
24+
## Documentation Filtering System
25+
26+
The documentation index pages (`/documentation/` and `/documentation/{version}/`) use client-side filtering to help visitors find relevant guides.
27+
28+
### Structure
29+
30+
1. **Metadata**: Each version has a YAML file in `_data/documentation/` (e.g., `0_19_0.yaml`) containing guide metadata:
31+
- `title`, `description`, `path`: Basic guide information
32+
- `tags`: Array of category tags (e.g., `[filter, security]`)
33+
- `rank`: String to control sort order (e.g., '000', '010')
34+
35+
2. **Layout**: `_layouts/released-documentation.html` renders:
36+
- Filter buttons (All, Proxy, Filters, Kubernetes, Developer, Security, Governance)
37+
- Card grid with icons and tag badges
38+
- Cards include a `data-categories` attribute for JavaScript filtering
39+
40+
3. **Filtering**: `assets/scripts/doc-filter.js` provides vanilla JavaScript filtering
41+
- Progressive enhancement: works without JavaScript
42+
- Filters by matching tags in the `data-categories` attribute
43+
44+
4. **Styling**: `_sass/kroxylicious.scss` provides:
45+
- Filter button styles with active states
46+
- Category-specific border colours on cards
47+
- Icon and badge styling
48+
49+
### Current Filter Categories
50+
51+
- **proxy**: Core proxy functionality and configuration
52+
- **filter**: Filter plugins (encryption, validation, multi-tenancy, OAuth, SASL, authorization)
53+
- **kubernetes**: Kubernetes operator and deployment
54+
- **developer**: Development tools, guides, and API documentation
55+
- **security**: Security features (encryption, authentication, authorization)
56+
- **governance**: Compliance and validation
57+
58+
### Adding New Categories
59+
60+
To add a new filter category:
61+
62+
1. Update YAML files in `_data/documentation/` for relevant versions
63+
2. Add filter button in `_layouts/released-documentation.html` with Bootstrap Icon
64+
3. Add icon mapping for card headers (same file)
65+
4. Add category border style in `_sass/kroxylicious.scss`
66+
5. No JavaScript changes needed (handles tags dynamically)
67+
68+
### Version Scope Convention
69+
70+
When updating documentation tags, typically update only recent versions (e.g., 0.16.0+) rather than all historical versions, to balance consistency with maintenance effort.

_data/documentation/0_16_0.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ docs:
99
description: "Covers using the proxy, including configuration, security and operation."
1010
tags:
1111
- proxy
12+
- security
1213
rank: '010'
1314
path: html/kroxylicious-proxy
1415
- title: Record Encryption quickstart
1516
description: Shows how to use the proxy to provide an encryption at rest solution
1617
for Apache Kafka
1718
tags:
18-
- record-encryption
19-
- encryption-at-rest
19+
- security
2020
rank: '011'
2121
path: html/record-encryption-quickstart
2222
- title: Kroxylicious Operator for Kubernetes
@@ -31,12 +31,14 @@ docs:
3131
\ security and operation."
3232
tags:
3333
- filter
34+
- security
3435
rank: '020'
3536
path: html/record-encryption-guide
3637
- title: Record Validation Guide
3738
description: Covers using the record validation filter.
3839
tags:
3940
- filter
41+
- governance
4042
rank: '021'
4143
path: html/record-validation-guide
4244
- title: Multi-tenancy Guide
@@ -49,6 +51,7 @@ docs:
4951
description: Covers using the Oauth Bearer validation filter.
5052
tags:
5153
- filter
54+
- security
5255
rank: '023'
5356
path: html/oauth-bearer-validation
5457
- title: Developer Quick Start

_data/documentation/0_17_0.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ docs:
99
description: "Covers using the proxy, including configuration, security and operation."
1010
tags:
1111
- proxy
12+
- security
1213
rank: '010'
1314
path: html/kroxylicious-proxy
1415
- title: Record Encryption quickstart
1516
description: Shows how to use the proxy to provide an encryption at rest solution
1617
for Apache Kafka
1718
tags:
18-
- record-encryption
19-
- encryption-at-rest
19+
- security
2020
rank: '011'
2121
path: html/record-encryption-quickstart
2222
- title: Kroxylicious Operator for Kubernetes
@@ -31,12 +31,14 @@ docs:
3131
\ security and operation."
3232
tags:
3333
- filter
34+
- security
3435
rank: '020'
3536
path: html/record-encryption-guide
3637
- title: Record Validation Guide
3738
description: Covers using the record validation filter.
3839
tags:
3940
- filter
41+
- governance
4042
rank: '021'
4143
path: html/record-validation-guide
4244
- title: Multi-tenancy Guide
@@ -49,12 +51,14 @@ docs:
4951
description: Covers using the SASL Inspection filter.
5052
tags:
5153
- filter
54+
- security
5255
rank: '023'
5356
path: html/sasl-inspection-guide
5457
- title: Oauth Bearer Validation Guide
5558
description: Covers using the Oauth Bearer validation filter.
5659
tags:
5760
- filter
61+
- security
5862
rank: '023'
5963
path: html/oauth-bearer-validation
6064
- title: Developer Quick Start

_data/documentation/0_17_1.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ docs:
99
description: "Covers using the proxy, including configuration, security and operation."
1010
tags:
1111
- proxy
12+
- security
1213
rank: '010'
1314
path: html/kroxylicious-proxy
1415
- title: Record Encryption quickstart
1516
description: Shows how to use the proxy to provide an encryption at rest solution
1617
for Apache Kafka
1718
tags:
18-
- record-encryption
19-
- encryption-at-rest
19+
- security
2020
rank: '011'
2121
path: html/record-encryption-quickstart
2222
- title: Kroxylicious Operator for Kubernetes
@@ -31,12 +31,14 @@ docs:
3131
\ security and operation."
3232
tags:
3333
- filter
34+
- security
3435
rank: '020'
3536
path: html/record-encryption-guide
3637
- title: Record Validation Guide
3738
description: Covers using the record validation filter.
3839
tags:
3940
- filter
41+
- governance
4042
rank: '021'
4143
path: html/record-validation-guide
4244
- title: Multi-tenancy Guide
@@ -49,12 +51,14 @@ docs:
4951
description: Covers using the SASL Inspection filter.
5052
tags:
5153
- filter
54+
- security
5255
rank: '023'
5356
path: html/sasl-inspection-guide
5457
- title: Oauth Bearer Validation Guide
5558
description: Covers using the Oauth Bearer validation filter.
5659
tags:
5760
- filter
61+
- security
5862
rank: '023'
5963
path: html/oauth-bearer-validation
6064
- title: Developer Quick Start

_data/documentation/0_18_0.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ docs:
99
description: "Covers using the proxy, including configuration, security and operation."
1010
tags:
1111
- proxy
12+
- security
1213
rank: '010'
1314
path: html/kroxylicious-proxy
1415
- title: Record Encryption quickstart
1516
description: Shows how to use the proxy to provide an encryption at rest solution
1617
for Apache Kafka
1718
tags:
18-
- record-encryption
19-
- encryption-at-rest
19+
- security
2020
rank: '011'
2121
path: html/record-encryption-quickstart
2222
- title: Kroxylicious Operator for Kubernetes
@@ -31,12 +31,14 @@ docs:
3131
\ security and operation."
3232
tags:
3333
- filter
34+
- security
3435
rank: '020'
3536
path: html/record-encryption-guide
3637
- title: Record Validation Guide
3738
description: Covers using the record validation filter.
3839
tags:
3940
- filter
41+
- governance
4042
rank: '021'
4143
path: html/record-validation-guide
4244
- title: Multi-tenancy Guide
@@ -49,12 +51,14 @@ docs:
4951
description: Covers using the SASL Inspection filter.
5052
tags:
5153
- filter
54+
- security
5255
rank: '023'
5356
path: html/sasl-inspection-guide
5457
- title: Oauth Bearer Validation Guide
5558
description: Covers using the Oauth Bearer validation filter.
5659
tags:
5760
- filter
61+
- security
5862
rank: '023'
5963
path: html/oauth-bearer-validation
6064
- title: Developer Quick Start

_data/documentation/0_19_0.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ docs:
99
description: "Covers using the proxy, including configuration, security and operation."
1010
tags:
1111
- proxy
12+
- security
1213
rank: '010'
1314
path: html/kroxylicious-proxy
1415
- title: Record Encryption quickstart
1516
description: Shows how to use the proxy to provide an encryption at rest solution
1617
for Apache Kafka
1718
tags:
18-
- record-encryption
19-
- encryption-at-rest
19+
- security
2020
rank: '011'
2121
path: html/record-encryption-quickstart
2222
- title: Kroxylicious Operator for Kubernetes
@@ -31,12 +31,14 @@ docs:
3131
\ security and operation."
3232
tags:
3333
- filter
34+
- security
3435
rank: '020'
3536
path: html/record-encryption-guide
3637
- title: Record Validation Guide
3738
description: Covers using the record validation filter.
3839
tags:
3940
- filter
41+
- governance
4042
rank: '021'
4143
path: html/record-validation-guide
4244
- title: Multi-tenancy Guide
@@ -49,18 +51,21 @@ docs:
4951
description: Covers using the Oauth Bearer validation filter.
5052
tags:
5153
- filter
54+
- security
5255
rank: '023'
5356
path: html/oauth-bearer-validation
5457
- title: SASL Inspection Guide
5558
description: Covers using the SASL Inspection filter.
5659
tags:
5760
- filter
61+
- security
5862
rank: '023'
5963
path: html/sasl-inspection-guide
6064
- title: Authorization Guide
6165
description: Covers using the Authorization filter.
6266
tags:
6367
- filter
68+
- security
6469
rank: '024'
6570
path: html/authorization-guide
6671
- title: Developer Quick Start

_layouts/released-documentation.html

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,32 @@ <h1 id="page-title" class="fs-3">{{ version }} Documentation</h1>
3535
</div>
3636
</div>
3737
<div class="col-lg-6" role="main">
38-
<div class="row row-cols-1 row-cols-md-2 g-4">
3938
{%- assign docs_for_release = site.data.documentation[underscored_version].docs | sort: "rank" -%}
39+
<!-- Documentation filters -->
40+
<div class="doc-filters mb-4" role="toolbar" aria-label="Documentation filters">
41+
<button class="btn btn-sm btn-outline-secondary active" data-filter="all">
42+
All
43+
</button>
44+
<button class="btn btn-sm btn-outline-secondary" data-filter="proxy">
45+
<i class="bi bi-cpu"></i> Proxy
46+
</button>
47+
<button class="btn btn-sm btn-outline-secondary" data-filter="filter">
48+
<i class="bi bi-puzzle"></i> Filters
49+
</button>
50+
<button class="btn btn-sm btn-outline-secondary" data-filter="kubernetes">
51+
<i class="bi bi-boxes"></i> Kubernetes
52+
</button>
53+
<button class="btn btn-sm btn-outline-secondary" data-filter="developer">
54+
<i class="bi bi-code-slash"></i> Developer
55+
</button>
56+
<button class="btn btn-sm btn-outline-secondary" data-filter="security">
57+
<i class="bi bi-shield-lock"></i> Security
58+
</button>
59+
<button class="btn btn-sm btn-outline-secondary" data-filter="governance">
60+
<i class="bi bi-check-square-fill"></i> Governance
61+
</button>
62+
</div>
63+
<div class="row row-cols-1 row-cols-md-2 g-4">
4064
{%- for doc in docs_for_release -%}
4165
{%- assign first1 = doc.path | slice: 0, 1 -%}
4266
{%- assign first7 = doc.path | slice: 0, 7 -%}
@@ -49,12 +73,21 @@ <h1 id="page-title" class="fs-3">{{ version }} Documentation</h1>
4973
{%- assign linkTemplate = "/documentation/" | append: version | append: "/" | append: doc.path | absolute_url -%}
5074
{%- endif -%}
5175
<div class="col">
52-
<div class="card shadow mb-2 h-100 mx-2 {%- for tag in doc.tags %} doctag-{{tag}}{%- endfor -%}">
53-
<div class="card-header">
54-
<h2 class="card-title fs-4"><a href='{{ linkTemplate | replace: "$(VERSION)", version}}'>{{ doc.title }}</a></h2>
76+
<div class="card shadow mb-2 h-100 mx-2 doc-card{%- for tag in doc.tags %} doctag-{{tag}}{%- endfor -%}" data-categories="{{ doc.tags | join: ' ' }}">
77+
<div class="card-header d-flex align-items-center justify-content-between">
78+
<h2 class="card-title fs-4 mb-0 flex-grow-1">
79+
<a href='{{ linkTemplate | replace: "$(VERSION)", version}}'>{{ doc.title }}</a>
80+
</h2>
81+
{%- assign primary_tag = doc.tags[0] -%}
82+
<i class="bi bi-{% if primary_tag == 'proxy' %}cpu{% elsif primary_tag == 'filter' %}puzzle{% elsif primary_tag == 'kubernetes' %}boxes{% elsif primary_tag == 'developer' %}code-slash{% elsif primary_tag == 'security' %}shield-lock{% elsif primary_tag == 'governance' %}check-square-fill{% else %}file-text{% endif %} text-secondary ms-2" aria-hidden="true"></i>
5583
</div>
5684
<div class="card-body mx-3 my-2">
5785
{{ doc.description }}
86+
<div class="mt-2">
87+
{%- for tag in doc.tags -%}
88+
<span class="badge bg-light text-dark border me-1">{{ tag }}</span>
89+
{%- endfor -%}
90+
</div>
5891
</div>
5992
</div>
6093
</div>
@@ -63,3 +96,4 @@ <h2 class="card-title fs-4"><a href='{{ linkTemplate | replace: "$(VERSION)", ve
6396
</div>
6497
</div>
6598

99+
<script src="{{ '/assets/scripts/doc-filter.js' | absolute_url }}"></script>

0 commit comments

Comments
 (0)