Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yihui/hugo-xmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYihui Xie <xie@yihui.name>2017-08-09 19:12:17 +0300
committerYihui Xie <xie@yihui.name>2022-06-15 06:49:29 +0300
commit0bf14ae25bbdd1ea6ce80a6f3275439fb9d8868b (patch)
tree785118443f7cbd997f1360bf487005593e9a1001
parent913b6e16b96ae6cb1c88d4273e19ee715ea808ba (diff)
also consider .Rmarkdown source filesfeature/github-edit
-rw-r--r--layouts/partials/footer.html21
1 files changed, 13 insertions, 8 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index fbef91c..0689dd3 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -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>