mirror of
https://github.com/yihui/hugo-xmin.git
synced 2024-11-25 09:49:20 +02:00
also consider .Rmarkdown source files
This commit is contained in:
parent
958cd758b8
commit
ecd6b76dd1
|
@ -5,11 +5,16 @@
|
||||||
{{ replace . "{Year}" now.Year | markdownify}}
|
{{ replace . "{Year}" now.Year | markdownify}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .File.Path }}
|
{{ if .File.Path }}
|
||||||
|
{{ $.Scratch.Set "FilePath" .File.Path }}
|
||||||
{{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
|
{{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
|
||||||
{{ if (where (readDir (print "content/" .File.Dir)) "Name" $RmdFile) }}
|
{{ $Files := readDir (print "content/" .File.Dir) }}
|
||||||
|
{{ if (where $Files "Name" $RmdFile) }}
|
||||||
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
|
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $.Scratch.Set "FilePath" .File.Path }}
|
{{ $RmdFile := (print .File.BaseFileName ".Rmarkdown") }}
|
||||||
|
{{ if (where $Files "Name" $RmdFile) }}
|
||||||
|
{{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Site.Params.GithubEdit}}
|
{{ with .Site.Params.GithubEdit}}
|
||||||
| <a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">Edit this page</a>
|
| <a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">Edit this page</a>
|
||||||
|
|
Loading…
Reference in New Issue