Skip to content

Commit

Permalink
also consider .Rmarkdown source files
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 29, 2017
1 parent 1f30d07 commit eb862cb
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
| <a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">Edit this page</a>
{{ 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}}
| <a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">Edit this page</a>
{{ end }}
{{ end }}
</footer>
</body>
Expand Down

0 comments on commit eb862cb

Please sign in to comment.