Redirect pages using meta http-equiv tags
Project description
Pelican Redirect: A Plugin for Pelican
Redirect pages using meta http-equiv tags
Installation
This plugin can be installed via:
python -m pip install pelican-redirect
After the plugin is installed via pip, add pelican_redirect to your PLUGINS list in pelicanconf.py
PLUGINS = ['pelican_redirect', ...]
Usage
Once this plugin is installed, you can add a key to the frontmatter of the file called original_url. The plugin will generate an HTML page at that location that redirects to the new location of the post/page. Example:
Title: A sample title
original_url: blog-posts/2021/07/21/a-sample-title.html
Content here
Assuming this file is now going to be served from blog-posts/a-simple-title.html, a file will be written to blog-posts/2021/07/21/a-sample-title.html that redirects to the new URL.
If original_url does not have a file extension, or the file extension is something other than .htm or .html, then original_url is assumed to be a directory and index.html is appended to the URL.
Bulk Usage
To perform a page-wide redirect, you can use the CONTENT_REDIRECT_CONFIGURATION setting, which allows you to configure an original URL using page metadata. The structure of this configuration key looks like so:
CONTENT_REDIRECT_CONFIGURATION = [
{
"ARTICLE_URL": "old/layout/{slug}.html",
"PAGE_URL": "old/pages/{slug}.html",
}
]
For any entry in that list, if there is no key for the content type (for example, one configuration may only have ARTICLE_URL, another might only have PAGE_URL), the redirect will only be generated for the keys that are specified and the others will be skipped.
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.
License
This project is licensed under the BSD-3-Clause license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pelican_redirect-2.1.0.tar.gz.
File metadata
- Download URL: pelican_redirect-2.1.0.tar.gz
- Upload date:
- Size: 38.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
311a18e17d4b5324a1363b0d2ccd42ef785a12f2ac7b6e5e753737942dfb6fb2
|
|
| MD5 |
9ebf39f9837986ec8e8c98a866cc5b09
|
|
| BLAKE2b-256 |
84a31c9c0e0871172c0b9c4624b7e9d18270a41924e764ac5bee8a8aec6fc6a7
|
Provenance
The following attestation bundles were made for pelican_redirect-2.1.0.tar.gz:
Publisher:
release.yml on bryanwweber/pelican-redirect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pelican_redirect-2.1.0.tar.gz -
Subject digest:
311a18e17d4b5324a1363b0d2ccd42ef785a12f2ac7b6e5e753737942dfb6fb2 - Sigstore transparency entry: 214517173
- Sigstore integration time:
-
Permalink:
bryanwweber/pelican-redirect@9474c561674b75f36fc9177c0d9adbe1f4fae85a -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/bryanwweber
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9474c561674b75f36fc9177c0d9adbe1f4fae85a -
Trigger Event:
release
-
Statement type:
File details
Details for the file pelican_redirect-2.1.0-py3-none-any.whl.
File metadata
- Download URL: pelican_redirect-2.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13e2916539c18248fa9008377caeea6ef5070c0e77fabd52a1acf221f0205f77
|
|
| MD5 |
d54327d3ad0c2c32737d4d06dc5bfbde
|
|
| BLAKE2b-256 |
366477b2b7a7328f63f1854fb59c8fab612587a7ff9ec499a4eaf6054d2f7a73
|
Provenance
The following attestation bundles were made for pelican_redirect-2.1.0-py3-none-any.whl:
Publisher:
release.yml on bryanwweber/pelican-redirect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pelican_redirect-2.1.0-py3-none-any.whl -
Subject digest:
13e2916539c18248fa9008377caeea6ef5070c0e77fabd52a1acf221f0205f77 - Sigstore transparency entry: 214517174
- Sigstore integration time:
-
Permalink:
bryanwweber/pelican-redirect@9474c561674b75f36fc9177c0d9adbe1f4fae85a -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/bryanwweber
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9474c561674b75f36fc9177c0d9adbe1f4fae85a -
Trigger Event:
release
-
Statement type: