Skip to content

Commit 4531071

Browse files
committed
Docs: Proposal interfaces for agnostic theming
1 parent 03bc483 commit 4531071

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Agnostic Theming - Proposal Interfaces (9/16/25)
2+
3+
This document contains proposal interfaces fulfilling the requirements and criteria
4+
laid out in [docs-platform/629](https://github.com/nginxinc/docs-platform/issues/620).
5+
6+
Nothing in this document should be considered final and is subject to change.
7+
8+
### Site Config
9+
10+
```yaml
11+
params:
12+
# Collection of product groups or false to disable the product-selector
13+
productSelector: <false | ProductGroup[]>
14+
- groupLabel: <string>
15+
items: <Product[]>
16+
# Product Group Label
17+
- title: <string>
18+
# The URL prefix used for the section (Ex. 'nginx' for NGINX+)
19+
url: <string>
20+
# Whether this link is external to the site
21+
extUrl: <bool | undefined>
22+
header:
23+
# Header Nav items
24+
navItems: <NavItem[]>
25+
- title: <string>
26+
url: <string>
27+
extUrl: <bool>
28+
# Items in the "F5 Sites" dropdown
29+
f5Sites: <F5Site[]>
30+
- title: <string>
31+
description: <string>
32+
url: <string>
33+
brand:
34+
# String ID for the icon set (defaults to 'lucide' if not provided)
35+
iconSet: <string | undefined>
36+
# Favicon path (default './favicon.ico')
37+
favicon: <string | undefined>
38+
# Path for standard logo (located in mounted asset folder)
39+
logo: <string | undefined>
40+
# Path for icon logo (Used in small width contexts), fallback to "logo" if not defined
41+
iconLogo: <string | undefined>
42+
primary: <string | undefined>
43+
secondary: <string | undefined>
44+
# Replicates the interface for .Site.params.brand, minus iconSet and favicon
45+
dark:
46+
logo: <string>
47+
iconLogo: <string>
48+
primary: <string>
49+
secondary: <string>
50+
footer:
51+
# Default to &copy;{currentYear} F5, Inc. All rights reserved
52+
copyrightText: <string | undefined>
53+
items: <NavItem[]>
54+
- title: <string>
55+
# Item URL
56+
href: <string>
57+
extUrl: <boolean>
58+
59+
```
60+
61+
### F5 Sites
62+
63+
Collection of F5Site types. Used to define items for the "F5 Sites" dropdown.
64+
65+
Config location: `.Site.Params.header.f5Sites`
66+
67+
```yaml
68+
params:
69+
header:
70+
f5Sites: <F5Site[]>
71+
- title: <string>
72+
description: <string>
73+
url: <string>
74+
```
75+
76+
### Product Selector
77+
78+
Defined in Hugo config as this applies sitewide. Optionally, keep `data/` files as source
79+
instead of defined in `hugo.yaml` but less explicit.
80+
81+
```yaml
82+
params:
83+
productSelector: ProductGroup[]
84+
- productGroup: <string>
85+
products: Product[]
86+
# Product Group Label (Product[])
87+
- title: <string>
88+
# The URL prefix used for the section (Ex. 'nginx' for NGINX+). Definition not required if extUrl
89+
url: <string | undefined>
90+
# Whether the URL is external to the site (opens a new tab if true)
91+
extUrl: <bool | undefined>
92+
```
93+
94+
### Icon Partial
95+
96+
| Param | Type | Note |
97+
|---------------|------------------------|--------------------------------------------------------------------------------------------------------------|
98+
| `size` | `"sm" \| "md" \| "lg"` | Size of rendered icon (defaults to "md"). Maps to "rem" enum |
99+
| `set` | `string \| undefined` | A valid string ID for an icon set (defaults to `.Site.Params.brand.iconSet`) |
100+
| `icon` | `string` | A string ID for the icon-set |
101+
| `_iconDirect` | `string \| undefined` | A direct path for the icon resource to render. If supplied, `set` and `icon` params are ignored in handling. |
102+
103+
```go-template
104+
{{ partial "icon.html" set="lucide" size="md" icon="test-icon-id" _iconDirect="" . }}
105+
```
106+
107+
### Additional Notes
108+
109+
* Style variables defined in Hugo config may be detrimental to IDE integrations that read values for color display
110+
* Optionally, require theme consumers to set variables directly in a CSS file rather than config.
111+
* Some of these new schemas are breaking but given the low-level of current consumers, this is the best time to make schema adjustments before wider rollout.
112+
113+
### Optional Collection Definition Pattern
114+
115+
Several of the schemas above utilize an optional collection pattern that can be broken down into the following:
116+
117+
```yaml
118+
f5Sites: <false | Collection[]>
119+
```
120+
121+
When a collection is provided, the feature is toggled on. If a collection is not provided or the value is falsy, the feature is disabled.

0 commit comments

Comments
 (0)