File tree Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 7
7
8
8
9
9
10
- "title": {{ $page.Title | jsonify }},
10
+ "title": {{ partial "title.html" $page | jsonify }},
11
11
"slug": {{ or $page.Slug $page.File.ContentBaseName | jsonify }},
12
12
"id": {{ $id | jsonify }},
13
13
"level": {{ $page.Params.level | jsonify }},
Original file line number Diff line number Diff line change
1
+ {{- $current := . -}}
2
+
3
+ {{- $pages := where $current.Parent.Pages "Type" $current.Type -}}
4
+
5
+ {{- $index := 1 -}}
6
+ {{- range $i, $p := $pages -}}
7
+ {{- if eq $p.RelPermalink $current.RelPermalink -}}
8
+ {{- $index = $i -}}
9
+ {{- end -}}
10
+ {{- end -}}
11
+
12
+ {{- return $index -}}
Original file line number Diff line number Diff line change 27
27
"categories": {{ .Params.Categories | jsonify }},
28
28
"tags": {{ .Params.Tags | jsonify }},
29
29
"total_courses": {{ len (where .Pages "Type" "course") }},
30
+ "total_tests": {{ len (where .Pages "Type" "test") }},
31
+ "total_modules": {{ len (where .Pages "Type" "module") }},
32
+ "total_pages": {{ len (where .Pages "Type" "page") }},
30
33
31
- "courses ": [
34
+ "children ": [
32
35
{{- range $j, $c := .Pages }}
33
36
{{- if $j }},{{ end }}
34
37
{{ partial "course.json.html" (dict "page" $c "uuid" $uuid) }}
Original file line number Diff line number Diff line change 1
1
{{- $title := "" -}}
2
2
{{- $page := . -}}
3
- {{- $weight := or $ page.Params.weight $page.Params.Order "" -}}
3
+ {{- $index := add 1 (partial "index-of- page.html" $page) -}}
4
4
{{- $parentType := "" -}}
5
+ {{- $isFinal := partial "test/is-final.html" $page -}}
5
6
6
7
{{- with $page.Parent -}}
7
8
{{- $parentType = .Params.Type -}}
8
9
{{- end -}}
9
10
10
- {{- if partial "test/is-final.html" $page -}}
11
- {{- $title = printf "%sFinal " $title -}}
11
+ {{- if $isFinal -}}
12
+ {{- $title = printf "%sFinal" $title -}}
12
13
{{- end -}}
13
14
14
15
{{- if $page.Params.is_optional -}}
15
- {{- $title = printf "%sOptional " $title -}}
16
+ {{- $title = printf "%sOptional" $title -}}
16
17
{{- end -}}
17
18
18
19
{{- if eq $parentType "course" -}}
19
- {{- $title = printf "%sTest %s " $title $weight -}}
20
+ {{- $title = printf "%s Test " $title -}}
20
21
{{- end -}}
21
22
22
23
{{- if eq $parentType "module" -}}
23
- {{- $title = printf "%sQuiz %s " $title $weight -}}
24
+ {{- $title = printf "%s Quiz " $title -}}
24
25
{{- end -}}
25
26
26
27
{{- if or (eq $parentType "learning-path") (eq $parentType "challenge") (eq $parentType "certification") -}}
27
- {{- $title = printf "%sExam %s " $title $weight -}}
28
+ {{- $title = printf "%s Exam " $title -}}
28
29
{{- end -}}
29
30
31
+ {{- if not $isFinal -}}
32
+ {{- $title = printf "%s - %d" $title $index -}}
33
+ {{- end -}}
30
34
31
35
{{- return $title -}}
Original file line number Diff line number Diff line change
1
+ {{- $page := . -}}
2
+
3
+ {{- $title := $page.Title -}}
4
+
5
+ {{- if eq $page.Type "test" -}}
6
+ {{- $title = partial "test/title.html" $page -}}
7
+ {{- end -}}
8
+
9
+ {{- return $title -}}
You can’t perform that action at this time.
0 commit comments