Skip to main content
travis-link codecov-link pypi-link

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

  1. Fork thedropin.

  2. 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.

Tests

  1. pipenv run tests

Linting

  1. pipenv run lints

Sharing

Two great ways to share your code with the community.

Pelican Plugins Community Repo

See Contributing a plugin and Using Git and Github about adding a plugin to the pelican-plugins repo.

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.

  1. pipenv shell Enter your dev environment where twine will be accessible.

  2. python setup.py sdist bdist_wheel Create a normal distribution.

  3. Register on PyPI.

  4. 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.

  1. Also register on TestPyPI if you intend to test your distribution before making it official.

  2. twine check dist/* Check the distribution you made in the second step.

  3. 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..

  1. twine upload dist/* Upload your project to PyPI.

Continue below before you’re tired!

Automated Release to PyPI
  1. Visit https://pypi.org/manage/account/token/ to get your API token.

  2. Create a project-scoped token.

  3. gem install travis Install the Travis CLI.

  4. travis login Log into the CLI app. Use --com if you’ve opted into the https://travis-ci.com/ beta.

  5. travis encrypt "your-api-token" --com Override the token in this repo. Travis is migrating to Travis travis-ci.com.

  6. 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

The installation instructions for your new plugin will now be the following.

  1. pipenv install --dev thedropin

  2. update your pelicanconf.py’s plugins settings to include the following.

    import thedropin
    PLUGINS = [thedropin]

You can now include {{ article.emoji }} or {{ page.emoji }} in your templates. This can be overridden in the article, or page’s, metadata. For example, :emoji: 🧙.

References

License

MIT

Release files for thedropin 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thedropin 1.0.1
File Size Uploaded
thedropin-1.0.1.tar.gz 5.0 kB Details

Release files / thedropin-1.0.1.tar.gz

Download URL thedropin-1.0.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ca8efd552025156c59307bbe2e975d0a0aa6c3c08e7c14e2c9274c381d03e96c
BLAKE2b-256 checksum
How to use checksums
851c97626384d56650d27da71dccd2a126c4a753b578021cc685c6edd9f81f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

1 release file

0.0.22

1 release file

0.0.21

1 release file

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page