A Pelican plugin that adds a github_edit_url attribute to articles and pages, similar to Read the Docs pages.
- Download this plugin
- Place it in your plugins directory
- Add
pelican-github-edittoPLUGINSin your settings file.
Or see the general Plugin installation instructions.
Add the URL of your public website repository (including the path to the content directory) to your settings file:
GITHUB_CONTENT_URL = "https://github.com/your_user_name/your_website_repo/blob/master/your_content_dir" # No trailing slashThis will activate the github_edit_url attribute for all articles and pages, which you can use in templates as follows:
Article template:
<a href="{{ article.github_edit_url }}">Edit on GitHub</a>Page template:
<a href="{{ page.github_edit_url }}">Edit on GitHub</a>