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 @@ -33,4 +33,5 @@ footnotereturnlinkcontents = "↩"
33
33
34
34
[params ]
35
35
description = " A website built through Hugo and blogdown."
36
+ GithubEdit = " https://github.com/yihui/hugo-xmin/edit/feature/github-edit/exampleSite/content/"
36
37
footer = " © [Yihui Xie](https://yihui.name) 2017 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
Original file line number Diff line number Diff line change 4
4
< hr />
5
5
{{ . | markdownify }}
6
6
{{ 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 }}
7
18
</ footer >
8
19
</ body>
9
20
</ html>
You can’t perform that action at this time.
0 commit comments