Skip to content

Commit e120fb5

Browse files
committed
move json views to theme
Signed-off-by: Aabid Sofi <[email protected]>
1 parent 5c1b949 commit e120fb5

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
{
3+
"total": {{ len .Pages }},
4+
"data": [
5+
{{- $pages := .Pages -}}
6+
{{- range $i, $p := $pages }}
7+
{{- if $i }},{{ end }}
8+
9+
{{- $ctx := partial "resolve-tenant.html" $p -}}
10+
{{- $uuid := $ctx.uuid -}}
11+
12+
{{- $children := $p.Pages }}
13+
14+
{
15+
"title": {{ $p.Title | jsonify }},
16+
"description": {{ $p.Description | jsonify }},
17+
"banner": {{ $p.Params.Banner | absURL | jsonify }},
18+
"permalink": {{ $p.Permalink | jsonify }},
19+
"orgId": {{ $uuid | jsonify }},
20+
"courses": [
21+
{{- range $j, $c := $children }}
22+
{{- if $j }},{{ end }}
23+
{
24+
"title": {{ $c.Title | jsonify }},
25+
"description": {{ $c.Description | jsonify }},
26+
"order": {{ $c.Params.Order | jsonify}},
27+
"banner": {{ $c.Params.Banner | absURL | jsonify }},
28+
"permalink": {{ $c.Permalink | jsonify }}
29+
}
30+
{{- end }}
31+
]
32+
}
33+
{{- end }}
34+
]
35+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)