File tree Expand file tree Collapse file tree 5 files changed +24
-16
lines changed
Expand file tree Collapse file tree 5 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 11{{- $b := .badge -}}
22{{- $contentId := .curriculaId -}}
3- {{- $orgId := .orgId | default "" -}}
3+ {{- $page_ctx := .page -}}
44
5- {{- $svg := cond (partial "is-url.html" $b.svg) $b.svg (partial "banner-url .html" (dict "uuid " $orgId "banner " $b.svg )) -}}
6- {{- $png := cond (partial "is-url.html" $b.png) $b.png (partial "banner-url .html" (dict "uuid " $orgId "banner " $b.svg )) -}}
5+ {{- $svg := cond (partial "is-url.html" $b.svg) $b.svg (partial "resolve-local-resource .html" (dict "page " $page_ctx "path " $b.svg)) -}}
6+ {{- $png := cond (partial "is-url.html" $b.png) $b.png (partial "resolve-local-resource .html" (dict "page " $page_ctx "path " $b.png )) -}}
77
88{{- $badge := "nil" -}}
99
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11
22{{- $page := .page -}}
3- {{- $uuid := .uuid -}}
43{{- $type := or $page.Params.Type "default" -}}
5- {{- $banner_url := partial "banner-url .html" (dict "uuid" $uuid "banner" $ page.Params.Banner) -}}
4+ {{- $banner_url := partial "resolve-local-resource .html" (dict "page" .page "path" . page.Params.Banner) -}}
65{{- $id := partial "id.html" .page -}}
76
8-
9-
107"title": {{ $page.Title | jsonify }},
118"slug": {{ or $page.Slug $page.File.ContentBaseName | jsonify }},
129"id": {{ $id | jsonify }},
Original file line number Diff line number Diff line change 33{{- $ctx := partial "resolve-tenant.html" . -}}
44{{- $uuid := $ctx.uuid -}}
55{{- $level := partial "validate-level.html" . -}}
6- {{- $banner_url := partial "banner-url .html" (dict "uuid" $uuid "banner " .Params.Banner) -}}
6+ {{- $banner_url := partial "resolve-local-resource .html" (dict "page" . "path " .Params.Banner) -}}
77{{- $id := partial "id.html" . -}}
88
99
2727 "title": {{ .Title | jsonify }},
2828 "description": {{ .Description | jsonify }},
2929 "banner": {{ $banner_url | jsonify }},
30- "badge": {{ partial "badge.html" (dict "badge" .Params.badge "curriculaId" $id "orgId" $uuid ) | jsonify }},
30+ "badge": {{ partial "badge.html" (dict "page" . " badge" .Params.badge "curriculaId" $id ) | jsonify }},
3131 "certificate": {{ .Params.certificate | jsonify }},
3232 "permalink": {{ .Permalink | jsonify }},
3333 "categories": {{ .Params.Categories | jsonify }},
Original file line number Diff line number Diff line change 1+ {{/*
2+ //revice a page and a path, return the final url of the resource in the page bundle.
3+ @param {dict} . - A dictionary containing:
4+ - "page" {page}: The current page context.
5+ - "path" {string}: The filename of the resource.
6+ */}}
7+ {{- $page_ctx := .page -}}
8+ {{- $resource_path := .path -}}
9+
10+ {{- $resolved_url := "" -}}
11+
12+ {{- if and $page_ctx $resource_path -}}
13+ {{- with $page_ctx.Resources.GetMatch $resource_path -}}
14+ {{- $resolved_url = .Permalink -}}
15+ {{- end -}}
16+ {{- end -}}
17+
18+ {{- return $resolved_url -}}
You can’t perform that action at this time.
0 commit comments