Skip to content

Latest commit

 

History

History
executable file
·
37 lines (23 loc) · 1.04 KB

README.md

File metadata and controls

executable file
·
37 lines (23 loc) · 1.04 KB

GitHub edit URL

A Pelican plugin that adds a github_edit_url attribute to articles and pages, similar to Read the Docs pages.

Installation

  1. Download this plugin
  2. Place it in your plugins directory
  3. Add pelican-github-edit to PLUGINS in your settings file.

Or see the general Plugin installation instructions.

Usage

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 slash

This 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>

LICENSE

LICENSE