File tree Expand file tree Collapse file tree 4 files changed +87
-0
lines changed
Expand file tree Collapse file tree 4 files changed +87
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ jobs:
153153 .filter(d => d.status != "removed")
154154 .filter(d => !d.filename.includes("/generated/"))
155155 .filter(d => !d.filename.includes("/raw/"))
156+ .filter(d => !d.filename.startsWith("templates/"))
156157 .map(d => d.filename);
157158 - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
158159 - uses : errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ mise vale:branch # Run Vale linter only
7474mise vale:version-urls # Run version URL checker only
7575```
7676
77+ #### Creating new resource docs
78+
79+ To create a new resource reference doc from template:
80+
81+ ``` sh
82+ mise new:resource MeshService
83+ ```
84+
85+ This creates ` app/_src/resources/meshservice.md ` from the template. Update the nav file after creation.
86+
7787#### Page metadata
7888
7989All documentation pages should include frontmatter metadata for SEO and search:
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ yarn = "1.22.22"
88vale = " 3.13.0"
99shellcheck = " 0.10.0"
1010"go:github.com/raviqqe/muffet/v2" = " v2.11.0"
11+ "go:github.com/hairyhenderson/gomplate/v4/cmd/gomplate" = " v4.3.0"
1112shellspec = " 0.28.1"
1213
1314[tasks .install ]
@@ -106,6 +107,7 @@ git diff --name-only --diff-filter=d origin/master...HEAD | \
106107 grep -E '\\ .(md|markdown)$' | \
107108 grep -v '/generated/' | \
108109 grep -v '/raw/' | \
110+ grep -v '^templates/' | \
109111 xargs -r vale
110112"""
111113
@@ -128,3 +130,20 @@ run = "shellcheck tools/*.sh"
128130[tasks .check ]
129131description = " Run necessary checks"
130132depends = [" vale:branch" , " vale:version-urls" , " frontmatter:validate" ]
133+
134+ [tasks ."new:resource" ]
135+ description = " Create new resource reference doc"
136+ run = '''
137+ RESOURCE_NAME={{arg(name="resource")}}
138+ LOWERCASE=$(echo "$RESOURCE_NAME" | tr '[:upper:]' '[:lower:]')
139+ OUTPUT="app/_src/resources/${LOWERCASE}.md"
140+ if [ -f "$OUTPUT" ]; then
141+ echo "Error: $OUTPUT already exists" >&2
142+ exit 1
143+ fi
144+ mkdir -p app/_src/resources
145+ export RESOURCE_NAME
146+ gomplate -f templates/resource.md -o "$OUTPUT"
147+ echo "Created $OUTPUT"
148+ echo "TODO: Update nav in latest app/_data/docs_nav_kuma_2.x.x.yml"
149+ '''
Original file line number Diff line number Diff line change 1+ ---
2+ title : {{ .Env.RESOURCE_NAME }}
3+ description : TODO: Add description
4+ # Use exactly 3 keywords for optimal Algolia search performance
5+ keywords :
6+ - {{ .Env.RESOURCE_NAME }}
7+ - resource
8+ - reference
9+ content_type : reference
10+ ---
11+
12+ TODO: Add introduction
13+
14+ ## Spec fields
15+
16+ <!-- Document each spec field with:
17+ ### fieldName
18+
19+ Description of field purpose and behavior.
20+
21+ **Type:** `type` | **Required:** Yes/No | **Default:** `value`
22+
23+ #### nestedField (if applicable)
24+ -->
25+
26+ ## Examples
27+
28+ ### Basic {{ .Env.RESOURCE_NAME }}
29+
30+ {% tabs %}
31+ {% tab Kubernetes %}
32+
33+ ``` yaml
34+ apiVersion : kuma.io/v1alpha1
35+ kind : {{ .Env.RESOURCE_NAME }}
36+ metadata :
37+ name : example
38+ ` ` `
39+
40+ {% endtab %}
41+ {% tab Universal %}
42+
43+ ` ` ` yaml
44+ type : {{ .Env.RESOURCE_NAME }}
45+ name : example
46+ ` ` `
47+
48+ {% endtab %}
49+ {% endtabs %}
50+
51+ ## See also
52+
53+ - [Related doc](/docs/{{ "{{" }} page.release {{ "}}" }}/path)
54+
55+ ## All options
56+
57+ {% json_schema {{ .Env.RESOURCE_NAME }} type=proto %}
You can’t perform that action at this time.
0 commit comments