Skip to content

Commit d994ad5

Browse files
committed
also consider .Rmarkdown source files
1 parent 02c0a8d commit d994ad5

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

layouts/partials/footer.html

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
{{ . | markdownify }}
66
{{ end }}
77
{{ if .File.Path }}
8-
{{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
9-
{{ if (where (readDir (print "content/" .File.Dir)) "Name" $RmdFile) }}
10-
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
11-
{{ else }}
128
{{ $.Scratch.Set "FilePath" .File.Path }}
13-
{{ end }}
14-
{{ with .Site.Params.GithubEdit}}
15-
| <a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">Edit this page</a>
16-
{{ end }}
9+
{{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
10+
{{ $Files := readDir (print "content/" .File.Dir) }}
11+
{{ if (where $Files "Name" $RmdFile) }}
12+
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
13+
{{ else }}
14+
{{ $RmdFile := (print .File.BaseFileName ".Rmarkdown") }}
15+
{{ if (where $Files "Name" $RmdFile) }}
16+
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
17+
{{ end }}
18+
{{ end }}
19+
{{ with .Site.Params.GithubEdit}}
20+
| <a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">Edit this page</a>
21+
{{ end }}
1722
{{ end }}
1823
</footer>
1924
</body>

0 commit comments

Comments
 (0)