Get module source from page?

is there any way I can get the source module from a page?
my site is built up from multiple modules, all from git and I want an “edit in GitHub” button on each page.
to do that, I need to know which module the page was generated from.

is there any way to do that?

1 Like

A roundabout way, maybe …

{{ with .File }}
{{ .Filename }}
{{ end }}

The Filename above will in your situation be rather long, but it should contain the GitHub path in there …

That said, we should do better. Could you create a GitHub issue to remind me?

thanks! that will do for now…
on a very related issue, is there any way of getting the .GitInfo from content pulled in from a module? it doesn’t seem to work
I’ll create a GitHub issue for both

No…

See https://github.com/gohugoio/hugo/issues/6848