Project description
These are the bare minimum yet possibly over-explained steps for creating a Pelican plugin.
Steps
Please let us know in an issue if we forgot anything!
Copy Plugin Base
Fork thedropin.
Change all dir names and references to this project’s name[1]_.
Dependencies
See instructions for installing Pipenv. Then run pipenv install --dev.
Developing Your Plugin
This is now where you get to get 🎨 creative! Good luck, have fun.
ETC
This is wading into dangerous territory to start recommending text-editor practices, but if you open your editor from inside the Pipenv shell, that may help your editor loading the proper environment-specific dependencies.
Sharing
Two great ways to share your code with the community.
Publishing to PyPI
This is probably the hardest part, and is why I’d wager there are so few Pelican projects registered on PyPI[2]_. Begin with the manual steps. Afterwards, add support for the automated steps as soon as possible while everything is fresh in your head.
First Time
Your first time uploading a project to PyPI requires using Twine. All of the below commands can be found in the Pipfile [scripts] section for your convenience.
pipenv shell Enter your dev environment where twine will be accessible.
python setup.py sdist bdist_wheel Create a normal distribution.
Register on PyPI.
Think hard on your project name once more before uploading. Short lowercase 1 word names are best.
Optionally, you can do some checks on your distribution before attempting an official upload.
Also register on TestPyPI if you intend to test your distribution before making it official.
twine check dist/* Check the distribution you made in the second step.
twine upload --repository testpypi dist/* Run a test of the upload. Preview at https://test.pypi.org/project/thedropin.
Back to the official upload steps..
twine upload dist/* Upload your project to PyPI.
Continue below before you’re tired!
Automated Release to PyPI
Visit https://pypi.org/manage/account/token/ to get your API token.
Create a project-scoped token.
gem install travis Install the Travis CLI.
travis login Log into the CLI app. Use --com if you’ve opted into the https://travis-ci.com/ beta.
travis encrypt -a deploy.password "your-api-token" --com Override the token in this repo. Travis is migrating to Travis travis-ci.com.
python ./release.py Save your changes and bump the version.
Try bumping the version and tags again using the release script. After you’ve found your groove with this, give yourself a pat on the back. Job well done!
Installation
pipenv install --dev thedropin
update your pelicanconf.py’s plugins settings to include the following.
import thedropin
PLUGINS = [thedropin]
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution