How to implement "edit this page on github"?


#1

Hi,

migrating from jekyll, I would like to implement a “edit on github” button. all I need is the file path.

I have filename in the config file when I define permallink. but I can’t seem to find anything in variables.

{{ .Site.Files }} comes empty and {{ .Site.Pages }} results in “panic” message.

How can I implement this feature?

Thanks,
Guy.


#2
{{ if .IsPage }}
{{ .File.Path }}
{{ end }}

#3

Was trying to do the same thing. Thanks for this!
Would be nice to have this in the docs.
Did I miss something there?