Every page now exposes page.filePath — its source path relative to your project root — so a one-line layout snippet can link readers straight to the file's GitHub editor.
page.filePath for "Edit on GitHub" links. Every page now carries
page.filePath — its source file's path relative to your project root, with
posix separators (e.g. src/markup/docs/index.md). That is exactly the path
GitHub's editor expects, so an edit link is one line in your layout:
{% set repoUrl = site.repo or package.homepage %}
{% if page.filePath and repoUrl %}
<a href="{{ repoUrl }}/edit/{{ site.branch or 'main' }}/{{ page.filePath }}">✏️ Edit this page on GitHub</a>
{% endif %}
Set repo and branch in your site data; they fall back to
package.homepage and main. The field mirrors the filePath already on
collection items, so both read the same way. You can't rebuild this path from
page.url — that's the output URL (.html, and index.md collapses to a
directory), so it never reverses to the .md source.