Avoid passing in .Site-variables to geturl.html
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
{{- $siteSourceUrl := site.Params.siteSourceUrl -}}
|
||||
{{- $submoduleLinks := site.Data.submodules -}}
|
||||
{{- $scratch := .scratch -}}
|
||||
{{- $scratch.Set "bestLength" -1 -}}
|
||||
{{- $scratch.Set "bestUrl" (printf "%s/code/%s" .siteSourceUrl .path) -}}
|
||||
{{- $scratch.Set "bestUrl" (printf "%s/code/%s" $siteSourceUrl .path) -}}
|
||||
{{- $scratch.Set "bestPath" "" -}}
|
||||
{{- $filePath := .path -}}
|
||||
{{- range $path, $url := .submoduleLinks -}}
|
||||
{{- range $path, $url := $submoduleLinks -}}
|
||||
{{- $bestLength := $scratch.Get "bestLength" -}}
|
||||
{{- if and (le $bestLength (len $path)) (hasPrefix $filePath $path) -}}
|
||||
{{- $scratch.Set "bestLength" (len $path) -}}
|
||||
|
||||
Reference in New Issue
Block a user