mirror of
https://github.com/yihui/hugo-xmin.git
synced 2024-11-23 00:49:19 +02:00
implement the Github edit link
This commit is contained in:
parent
b76b60eb94
commit
9ca7243b8e
|
@ -31,6 +31,7 @@ menu:
|
||||||
params:
|
params:
|
||||||
description: "A website built through Hugo and blogdown."
|
description: "A website built through Hugo and blogdown."
|
||||||
footer: "© [Yihui Xie](https://yihui.org) 2017 -- {Year} | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
|
footer: "© [Yihui Xie](https://yihui.org) 2017 -- {Year} | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
|
||||||
|
GithubEdit: "https://github.com/yihui/hugo-xmin/edit/feature/github-edit/exampleSite/content/"
|
||||||
|
|
||||||
markup:
|
markup:
|
||||||
highlight:
|
highlight:
|
||||||
|
|
|
@ -4,6 +4,17 @@
|
||||||
<hr/>
|
<hr/>
|
||||||
{{ replace . "{Year}" now.Year | markdownify}}
|
{{ replace . "{Year}" now.Year | markdownify}}
|
||||||
{{ end }}
|
{{ 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 }}
|
||||||
|
{{ end }}
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue