File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1919 {{ $error = $args.err }}
2020{{ end }}
2121
22+ {{ $download := "" }}
2223{{ if not $error }}
23- {{/* Initialize local arguments */}}
24- {{- $title := $args.title -}}
25- {{- $download := partial "utilities/GetTargetPath.html" (dict "path" $args.download "page" page) -}}
24+ {{- $download = partial "utilities/GetTargetPath.html" (dict "path" $args.download "page" page) -}}
2625 {{- if and $download (not (fileExists (path.Join "static" $download))) -}}
27- {{- errorf "Cannot find download file for page '%s': %s" page.File.Path $download -}}
26+ {{ if page }}
27+ {{- errorf "Cannot find download file for page '%s': %s" page.File.Path $download -}}
28+ {{ else }}
29+ {{- errorf "Cannot find download file: %s" $download -}}
30+ {{ end }}
2831 {{- $error = true }}
2932 {{- end -}}
33+ {{- end -}}
3034
35+ {{ if not $error }}
36+ {{- $title := $args.title -}}
3137 {{ if not $title }}
3238 {{ if not $args.minimal }}{{ $title = (T "download" ) }}{{ end }}
3339 {{ $lang := strings.TrimPrefix "." (path.Ext (path.BaseName $download)) }}
You can’t perform that action at this time.
0 commit comments