Skip to main content

Easily embed Github files in your Pelican articles.

Project description

Pelican Git is a library that makes it easy to embed GitHub files in your Pelican blogs using simple syntax.

Installation

To install pelican-git, simply use pip:

$ pip install pelican-git

Then add a bit of code to your pelican configuration file:

PLUGINS = [
    # ...
    'pelican_git',
    # ...
]

Usage

In your articles, add lines to your posts that look like:

[git:repo=yourname/yourrepo,file=somefile,branch=master,hash=xxxxxxx]

branch and hash are optional. If you don’t specify branch, it will be master. If you specify hash it will overwrite the branch setting.

The generated code will embed css and html content directly into a div and replace the original tag. This is faster and cleaner than using javascript to rewrite the page content like what gist_it does.

Settings

GIT_CACHE_ENABLED - Specifies whether to cache the git files on disk or not. Default is False. (Optional)

Testing

$ make install
$ make test

Authors

Ha.Minh

Inspired by pelican_gist

Changelog

0.1.13

Fixed

  • Fixed error when fetching github HTML

Changed

  • Support Python 3.6

0.1.8

Fixed

  • Fix link to original repo

0.1.0

dded

  • Initial version

License

Uses the MIT license.

Bitdeli badge

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pelican-git, version 0.1.13
Filename, size File type Python version Upload date Hashes
Filename, size pelican_git-0.1.13-py2.py3-none-any.whl (8.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size pelican-git-0.1.13.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page