File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -34,4 +34,5 @@ footnotereturnlinkcontents = "↩"
3434
3535[params ]
3636 description = " A website built through Hugo and blogdown."
37+ GithubEdit = " https://github.com/yihui/hugo-xmin/edit/feature/github-edit/exampleSite/content/"
3738 footer = " © [Yihui Xie](https://yihui.name) 2017 -- 2018 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
Original file line number Diff line number Diff line change 44 < hr />
55 {{ . | markdownify }}
66 {{ end }}
7+ {{ if .File.Path }}
8+ {{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
9+ {{ if (where (readDir (print "content/" .File.Dir)) "Name" $RmdFile) }}
10+ {{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
11+ {{ else }}
12+ {{ $.Scratch.Set "FilePath" .File.Path }}
13+ {{ end }}
14+ {{ with .Site.Params.GithubEdit}}
15+ | < a href ="{{ . }}{{ $.Scratch.Get "FilePath " }}"> Edit this page</ a >
16+ {{ end }}
17+ {{ end }}
718 </ footer >
819 </ body>
920</ html>
You can’t perform that action at this time.
0 commit comments