How to implement "edit this page on github"?



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?


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


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