Skip to main content

Engrave: QR Codes for Pages and Articles

Build Status PyPI Version Downloads License

Engrave is a generates QR codes for the URLs of your Pelican posts and pages.

Installation

This plugin can be installed via:

pip install lm-pelican-engrave

As long as you have not explicitly added a PLUGINS setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add engrave to your existing PLUGINS list. For more information, please see the How to Use Plugins documentation.

Usage

Engrave automatically generates QR codes for all articles and pages in your Pelican site. These QR codes are saved as SVG images in the engrave/ directory within the OUTPUT_PATH defined in your Pelican settings.

Accessing QR Codes in Templates

The generated QR code is available in the context of the content as content.engrave_qrcode. You can embed the QR code in your templates using the following syntax:

<img src="{{ content.engrave_qrcode }}">

Engrave Directory Cleanup

Before generating new QR codes, Engrave clears the engrave/ directory to ensure that no legacy QR codes remain. This aims at maintaining security and consistency. Only by latest codes are available this way.

Schema Validation

Engrave validates URL schemas to ensure security. By default, it only allows URLs with the https schema. If your site uses another schema (e.g., http or even ftp), you should add it to the allowed schemas in your Pelican settings.

Setting Allowed Schemas

To specify allowed URL schemas for QR code generation, use the ENGRAVE_ALLOWED_SCHEMES setting in your Pelican configuration file (pelicanconf.py). For example:

ENGRAVE_ALLOWED_SCHEMES = ["https", "http"]

Required Settings

  • SITEURL: Ensure that SITEURL is set in your Pelican configuration file. This setting is crucial as it forms the basis of the URLs used for QR code generation. Be sure to synchronize ENGRAVE_ALLOWED_SCHEMES with your SITEURL setting to avoid any discrepancies.

Contributing

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.

To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.

Development

To set up a development environment for Engrave, follow these steps.

  1. Create and activate the venv:
python -m venv venv
source venv/bin/activate
  1. Install dependencies
python -m pip install -r requirements.txt

License

This project is licensed under the MIT license.

Release files for lm-pelican-engrave 0.1.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 lm-pelican-engrave 0.1.1
File Size Uploaded
lm_pelican_engrave-0.1.1.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lm-pelican-engrave 0.1.1
File Interpreter ABI Platform
lm_pelican_engrave-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / lm_pelican_engrave-0.1.1.tar.gz

Download URL lm_pelican_engrave-0.1.1.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5b18614a18e70b8bae2f3bf4ffbc2cbe8d3b771dcbb54c3e937a5566af9e3482
BLAKE2b-256 checksum
How to use checksums
7bd0cf49bca00397ed59a10a83b5591d01d20e659cac7fd0304c5d84f9ea3fd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / lm_pelican_engrave-0.1.1-py3-none-any.whl

Download URL lm_pelican_engrave-0.1.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
908c7bc44102d2dd0b3b5e4d5ca42c865f7ac2b8addf6ad057624a0121a589ef
BLAKE2b-256 checksum
How to use checksums
94d41d260837f5e9f437c48364ddc5a691de94df0a0b645f0766b70452656c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

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