|
18 | 18 | {{- end -}} |
19 | 19 |
|
20 | 20 | { |
21 | | - "title": {{ $p.Title | jsonify }}, |
22 | | - "description": {{ $p.Description | jsonify }}, |
23 | | - "banner": {{ $banner_url | jsonify }}, |
24 | | - "slug": {{ or $p.Slug $p.File.ContentBaseName | jsonify }}, |
25 | | - "permalink": {{ $p.Permalink | jsonify }}, |
26 | | - "level": {{ $p.Params.level | jsonify }}, |
| 21 | + |
27 | 22 | "id": {{ or $p.Params.Id (md5 $p.Permalink) | jsonify }}, |
28 | | - "orgId": {{ $uuid | jsonify }}, |
| 23 | + "level": {{ or $p.Params.level "beginner" | jsonify }}, |
| 24 | + "slug": {{ or $p.Slug $p.File.ContentBaseName | jsonify }}, |
| 25 | + "org_id": {{ $uuid | jsonify }}, |
29 | 26 | "type": {{ $p.Params.Type | jsonify }} , |
30 | | - "courses": [ |
31 | | - {{- range $j, $c := $children }} |
32 | | - {{- if $j }},{{ end }} |
33 | | - |
34 | | - {{- /* Prepend the orgId to the nested Course's banner path. */ -}} |
35 | | - {{- $course_banner_url := "" -}} |
36 | | - {{- if $c.Params.Banner -}} |
37 | | - {{- $course_banner_url = printf "%s/%s" $uuid $c.Params.Banner | absURL -}} |
38 | | - {{- end -}} |
39 | | - |
40 | | - { |
41 | | - "title": {{ $c.Title | jsonify }}, |
42 | | - "slug": {{ or $c.Slug $c.File.ContentBaseName | jsonify }}, |
43 | | - "id": {{ or $c.Params.Id $c.Permalink | jsonify }}, |
44 | | - "level": {{ $c.Params.level | jsonify }}, |
45 | | - "description": {{ $c.Description | jsonify }}, |
46 | | - "weight": {{ $c.Params.Order | jsonify}}, |
47 | | - "banner": {{ $course_banner_url | jsonify }}, |
48 | | - "permalink": {{ $c.Permalink | jsonify }} |
49 | | - } |
50 | | - {{- end }} |
51 | | - ] |
| 27 | + "visibility": {{ or $p.Params.Visibility "public" | jsonify }}, |
| 28 | + "status": {{ or $p.Params.Status "ready" | jsonify }}, |
| 29 | + |
| 30 | + {{- /* Metadata for the Learning Path */ -}} |
| 31 | + |
| 32 | + "metadata": { |
| 33 | + "title": {{ $p.Title | jsonify }}, |
| 34 | + "description": {{ $p.Description | jsonify }}, |
| 35 | + "banner": {{ $banner_url | jsonify }}, |
| 36 | + "permalink": {{ $p.Permalink | jsonify }}, |
| 37 | + "categories": {{ $p.Params.Categories | jsonify }}, |
| 38 | + "tags": {{ $p.Params.Tags | jsonify }}, |
| 39 | + "courses": [ |
| 40 | + {{- range $j, $c := $children }} |
| 41 | + {{- if $j }},{{ end }} |
| 42 | + |
| 43 | + {{- /* Prepend the orgId to the nested Course's banner path. */ -}} |
| 44 | + {{- $course_banner_url := "" -}} |
| 45 | + {{- if $c.Params.Banner -}} |
| 46 | + {{- $course_banner_url = printf "%s/%s" $uuid $c.Params.Banner | absURL -}} |
| 47 | + {{- end -}} |
| 48 | + |
| 49 | + { |
| 50 | + "title": {{ $c.Title | jsonify }}, |
| 51 | + "slug": {{ or $c.Slug $c.File.ContentBaseName | jsonify }}, |
| 52 | + "id": {{ or $c.Params.Id $c.Permalink | jsonify }}, |
| 53 | + "level": {{ $c.Params.level | jsonify }}, |
| 54 | + "description": {{ $c.Description | jsonify }}, |
| 55 | + "weight": {{ $c.Params.Order | jsonify}}, |
| 56 | + "banner": {{ $course_banner_url | jsonify }}, |
| 57 | + "permalink": {{ $c.Permalink | jsonify }} |
| 58 | + } |
| 59 | + {{- end }} |
| 60 | + ] |
| 61 | + } |
52 | 62 | } |
53 | 63 | {{- end }} |
54 | 64 | ] |
|
0 commit comments