Easily embed GitHub Gists in your Pelican articles.
Project description
Pelican Gist Tag is a library to make it easy to GitHub Gists in your Pelican blogs.
Installation
To install pelican-gist, simply:
$ pip install pelican-gist
Then add a bit of code to your blog configuration:
PLUGINS = [
# ...
'pelican_gist',
# ...
]
Usage
In your articles, just add lines to your posts that look like:
[gist:id=3254906,file=brew-update-notifier.sh]
This will tell the plugin to insert gist id 3254906 and choose the file brew-update-notifier.sh into your post. The resulting HTML will look like:
<div class="gist">
<script src='https://gist.github.com/3254906.js?file=brew-update-notifier.sh'></script>
<noscript>
<pre><code>#!/bin/bash ...</code></pre>
</noscript>
</div>
If your gist has only a single file, you can also specify the gist like so:
[gist:id=3254906]
Notice it is using the id only. The resulting HTML will look like:
<div class="gist">
<script src='https://gist.github.com/3254906.js'></script>
<noscript>
<pre><code>#!/bin/bash ...</code></pre>
</noscript>
</div>
There is also support for private gists where they have the gist id that looks like e34db4c532a6cfa1f711.
Settings
GIST_CACHE_ENABLED - Specifies whether to cache the gist on disk or not. Default is True. (Optional)
Changelog
0.3.0 - Added Python 3 support
License
Uses the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pelican-gist-0.3.0.tar.gz.
File metadata
- Download URL: pelican-gist-0.3.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a567cdbd9c549c3f3bc6fe95d07ae66946f796791ee6d5621b16f6cb70b6b97
|
|
| MD5 |
194c258c37bd0de971b1e41ec024eb91
|
|
| BLAKE2b-256 |
7f5912c72db30fa0ed47a725e8920821e90e0537132fd4bb4f98c482ff4a1b03
|