From d994ad582a07a4760b86c6a8f32f31db06c1ceb0 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Wed, 9 Aug 2017 11:12:17 -0500 Subject: [PATCH] also consider .Rmarkdown source files --- layouts/partials/footer.html | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 6a6687c..1eb88ab 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,15 +5,20 @@ {{ . | markdownify }} {{ end }} {{ if .File.Path }} - {{ $RmdFile := (print .File.BaseFileName ".Rmd") }} - {{ if (where (readDir (print "content/" .File.Dir)) "Name" $RmdFile) }} - {{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }} - {{ else }} {{ $.Scratch.Set "FilePath" .File.Path }} - {{ end }} - {{ with .Site.Params.GithubEdit}} - | Edit this page - {{ end }} + {{ $RmdFile := (print .File.BaseFileName ".Rmd") }} + {{ $Files := readDir (print "content/" .File.Dir) }} + {{ if (where $Files "Name" $RmdFile) }} + {{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }} + {{ else }} + {{ $RmdFile := (print .File.BaseFileName ".Rmarkdown") }} + {{ if (where $Files "Name" $RmdFile) }} + {{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }} + {{ end }} + {{ end }} + {{ with .Site.Params.GithubEdit}} + | Edit this page + {{ end }} {{ end }}