Skip to content

Commit 0b40579

Browse files
committed
.File may be nil, in which case .File.Path will error
1 parent 1cafaca commit 0b40579

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

layouts/_partials/footer.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
<hr/>
55
{{ replace . "{Year}" now.Year | markdownify }}
66
{{ end }}
7-
{{ if .File.Path }}
8-
{{ $.Scratch.Set "FilePath" .File.Path }}
9-
{{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
10-
{{ $Files := readDir (print "content/" .File.Dir) }}
7+
{{ with .File }}
8+
{{ $.Scratch.Set "FilePath" .Path }}
9+
{{ $RmdFile := (print .BaseFileName ".Rmd") }}
10+
{{ $Files := readDir (print "content/" .Dir) }}
1111
{{ if (where $Files "Name" $RmdFile) }}
12-
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
12+
{{ $.Scratch.Set "FilePath" (print .Dir $RmdFile) }}
1313
{{ else }}
14-
{{ $RmdFile := (print .File.BaseFileName ".Rmarkdown") }}
14+
{{ $RmdFile := (print .BaseFileName ".Rmarkdown") }}
1515
{{ if (where $Files "Name" $RmdFile) }}
16-
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
16+
{{ $.Scratch.Set "FilePath" (print .Dir $RmdFile) }}
1717
{{ end }}
1818
{{ end }}
1919
{{ with .Site.Params.GithubEdit}}

0 commit comments

Comments
 (0)