Skip to content

Commit 87a565f

Browse files
Auto-generation of JSON file for all pattern params (#452)
Have enabled a JSON file for the patterns browser. This is the first step in enhancing the patterns browser page, including better filtering and sorting mechanisms.
1 parent 71fb3c9 commit 87a565f

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ taxonomies:
3030
rh_product: 'rh_products'
3131
other_product: 'other_products'
3232
blog_tag: 'blog_tags'
33+
34+
mediaTypes:
35+
application/json:
36+
suffixes:
37+
- json
38+
39+
outputFormats:
40+
patterns:
41+
mediatype: application/json

content/patterns/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ menu:
44
main:
55
weight: 10
66
name: Patterns
7+
outputs:
8+
- html
9+
- json
710
---
811

912
Browse through available patterns and their respective documentation for deployment and operation. Filter patterns by type, industry, and product.

layouts/patterns/list.json.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- if (eq .RelPermalink "/patterns/") }}
2+
{{- $patterns := where $.Pages "Section" "patterns"}}
3+
{{- $patterns_len := $patterns | len }}
4+
{{- $pattern_list := slice }}
5+
{{- range $index, $pattern := $patterns.ByTitle }}
6+
{{- $pattern_list = $pattern_list | append (dict $pattern.Title $pattern.Params) }}
7+
{{- end }}
8+
{{- $pattern_list | jsonify }}
9+
{{- end }}

0 commit comments

Comments
 (0)