How to implement "edit this page on github"?

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.

1 Like
{{ if .IsPage }}
{{ .File.Path }}
{{ end }}
2 Likes

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