Skip to content

Commit 55b71e6

Browse files
authored
Merge pull request #102 from layer5io/exam
fix slug and description
2 parents 4dade1c + 630ead4 commit 55b71e6

File tree

6 files changed

+10
-48
lines changed

6 files changed

+10
-48
lines changed

layouts/partials/common-curricula-properties.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99

10-
"title": {{ partial "title.html" $page | jsonify }},
10+
"title": {{ $page.Title | jsonify }},
1111
"slug": {{ or $page.Slug $page.File.ContentBaseName | jsonify }},
1212
"id": {{ $id | jsonify }},
1313
"level": {{ $page.Params.level | jsonify }},

layouts/partials/learning-path.json.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
{{- $banner_url := partial "banner-url.html" (dict "uuid" $uuid "banner" .Params.Banner) -}}
77
{{- $id := partial "id.html" . -}}
88

9+
10+
{{- $urlParts := split (trim .RelPermalink "/") "/" -}}
11+
{{- $slug := index $urlParts (sub (len $urlParts) 1) -}}
12+
913
{{/*
1014
This file is used to generate the JSON representation of a learning path.
1115
It includes metadata such as title, description, banner, and courses.
@@ -14,7 +18,7 @@
1418
{
1519
"id": {{ $id | jsonify }},
1620
"level": {{ (trim $level " \n\r\t") | jsonify }},
17-
"slug": {{ or .Slug .File.ContentBaseName | jsonify }},
21+
"slug": {{ $slug | jsonify }},
1822
"org_id": {{ $uuid | jsonify }},
1923
"type": {{ .Params.Type | jsonify }},
2024
"visibility": {{ or .Params.Visibility "public" | jsonify }},

layouts/partials/test/title.html

Lines changed: 0 additions & 31 deletions
This file was deleted.

layouts/partials/title.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

layouts/test/single.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
}
234234
</style>
235235

236-
{{ $title := partial "test/title.html" . }}
236+
{{ $title := .Title }}
237237

238238

239239
<div class="container">
@@ -243,7 +243,7 @@
243243
<p class="text-blue-600 hover:underline" id="go-back"> Back</a>
244244
</div>
245245
<h1>{{ $title }}</h1>
246-
<p>{{ .Content | default "Please answer the questions below to complete the quiz." }}</p>
246+
<p>{{ .Content | default "Please answer the questions below to complete the test." }}</p>
247247
</div>
248248

249249
<div class="form-container">

layouts/test/single.json.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
{
88
"id": {{ partial "id.html" . | jsonify }},
9-
"title": {{ partial "test/title.html" . | jsonify }},
9+
"title": {{ .Title | jsonify }},
1010
"org_id": {{ $orgId | jsonify }},
1111
"final": {{ partial "test/is-final.html" . | jsonify }},
12-
"description": {{ .Content | plainify | jsonify }},
12+
"description": {{ .Content | safeHTML | jsonify }},
1313
"slug": {{ .Slug | jsonify }},
1414
"relPermalink": {{ .RelPermalink | jsonify }},
1515
"permalink": {{ .Permalink | jsonify }},

0 commit comments

Comments
 (0)