lm-pelican-engrave


Namelm-pelican-engrave JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA plugin for generating and embedding QR codes in your blogpost
upload_time2024-09-03 13:13:40
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.8.1
licenseMIT
keywords pelican plugin qrcode qr blog url
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Engrave: QR Codes for Pages and Articles

[![Build Status](https://img.shields.io/github/actions/workflow/status/lmuenter/pelican-engrave/main.yml?branch=main)](https://github.com/lmuenter/pelican-engrave/actions)
[![PyPI Version](https://img.shields.io/pypi/v/lm-pelican-engrave)](https://pypi.org/project/lm-pelican-engrave/)
[![Downloads](https://img.shields.io/pypi/dm/lm-pelican-engrave)](https://pypi.org/project/lm-pelican-engrave/)
![License](https://img.shields.io/pypi/l/lm-pelican-engrave?color=blue)

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

## Installation

This plugin can be installed via:

```bash
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](https://docs.getpelican.com/en/latest/plugins.html#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:

```html
<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:

```python
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.

[existing issues]: https://github.com/lmuenter/pelican-engrave/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html

### 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
```

2. Install dependencies
```
python -m pip install -r requirements.txt
```

## License

This project is licensed under the MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lm-pelican-engrave",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "pelican, plugin, qrcode, qr, blog, url",
    "author": null,
    "author_email": "Lukas Muenter <lukas.muenter@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/7b/d0/cf49bca00397ed59a10a83b5591d01d20e659cac7fd0304c5d84f9ea3fd4/lm_pelican_engrave-0.1.1.tar.gz",
    "platform": null,
    "description": "# Engrave: QR Codes for Pages and Articles\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/lmuenter/pelican-engrave/main.yml?branch=main)](https://github.com/lmuenter/pelican-engrave/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/lm-pelican-engrave)](https://pypi.org/project/lm-pelican-engrave/)\n[![Downloads](https://img.shields.io/pypi/dm/lm-pelican-engrave)](https://pypi.org/project/lm-pelican-engrave/)\n![License](https://img.shields.io/pypi/l/lm-pelican-engrave?color=blue)\n\n**Engrave** is a generates QR codes for the URLs of your Pelican posts and pages.\n\n## Installation\n\nThis plugin can be installed via:\n\n```bash\npip install lm-pelican-engrave\n```\n\nAs 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](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.\n\n## Usage\n\nEngrave 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.\n\n### Accessing QR Codes in Templates\n\nThe 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:\n\n```html\n<img src=\"{{ content.engrave_qrcode }}\">\n```\n\n### Engrave Directory Cleanup\n\nBefore 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.\n\n### Schema Validation\n\nEngrave 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.\n\n### Setting Allowed Schemas\n\nTo specify allowed URL schemas for QR code generation, use the `ENGRAVE_ALLOWED_SCHEMES` setting in your Pelican configuration file (`pelicanconf.py`). For example:\n\n```python\nENGRAVE_ALLOWED_SCHEMES = [\"https\", \"http\"]\n```\n\n### Required Settings\n\n- **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.\n\n## Contributing\n\nContributions 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][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.\n\n[existing issues]: https://github.com/lmuenter/pelican-engrave/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n\n### Development\n\nTo set up a development environment for Engrave, follow these steps.\n\n1. Create and activate the venv:\n```\npython -m venv venv\nsource venv/bin/activate\n```\n\n2. Install dependencies\n```\npython -m pip install -r requirements.txt\n```\n\n## License\n\nThis project is licensed under the MIT license.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A plugin for generating and embedding QR codes in your blogpost",
    "version": "0.1.1",
    "project_urls": {
        "Funding": "https://donate.getpelican.com/",
        "Homepage": "https://github.com/lmuenter/pelican-engrave",
        "Issue tracker": "https://github.com/lmuenter/pelican-engrave/issues"
    },
    "split_keywords": [
        "pelican",
        " plugin",
        " qrcode",
        " qr",
        " blog",
        " url"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94d41d260837f5e9f437c48364ddc5a691de94df0a0b645f0766b70452656c8b",
                "md5": "2f7825f4cc0c04d34f3f3e85796e49e0",
                "sha256": "908c7bc44102d2dd0b3b5e4d5ca42c865f7ac2b8addf6ad057624a0121a589ef"
            },
            "downloads": -1,
            "filename": "lm_pelican_engrave-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f7825f4cc0c04d34f3f3e85796e49e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 10097,
            "upload_time": "2024-09-03T13:13:38",
            "upload_time_iso_8601": "2024-09-03T13:13:38.964775Z",
            "url": "https://files.pythonhosted.org/packages/94/d4/1d260837f5e9f437c48364ddc5a691de94df0a0b645f0766b70452656c8b/lm_pelican_engrave-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7bd0cf49bca00397ed59a10a83b5591d01d20e659cac7fd0304c5d84f9ea3fd4",
                "md5": "89a5e144159099a2196b2703c22eb902",
                "sha256": "5b18614a18e70b8bae2f3bf4ffbc2cbe8d3b771dcbb54c3e937a5566af9e3482"
            },
            "downloads": -1,
            "filename": "lm_pelican_engrave-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "89a5e144159099a2196b2703c22eb902",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 8804,
            "upload_time": "2024-09-03T13:13:40",
            "upload_time_iso_8601": "2024-09-03T13:13:40.495300Z",
            "url": "https://files.pythonhosted.org/packages/7b/d0/cf49bca00397ed59a10a83b5591d01d20e659cac7fd0304c5d84f9ea3fd4/lm_pelican_engrave-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-03 13:13:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lmuenter",
    "github_project": "pelican-engrave",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "lm-pelican-engrave"
}
        
Elapsed time: 0.30853s