mirror of
https://github.com/yihui/hugo-xmin.git
synced 2024-12-25 14:43:32 +02:00
also consider .Rmarkdown source files
This commit is contained in:
parent
958cd758b8
commit
ecd6b76dd1
1 changed files with 13 additions and 8 deletions
|
@ -5,15 +5,20 @@
|
|||
{{ replace . "{Year}" now.Year | 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>
|
||||
|
|
Loading…
Reference in a new issue