Docums Redirects
Plugin for docums to create page redirects (e.g. for moved/renamed pages).
Installing
Note: This package requires Docums version 1.0.0 or higher.
Install with pip:
pip install docums-redirects
Using
To use this plugin, specify your desired redirects in the plugin's redirect_maps setting in your docums.yml:
plugins:
- redirects:
redirect_maps:
'old.md': 'new.md'
'old/file.md': 'new/file.md'
'some_file.md': 'http://external.url.com/foobar'
Note: don't forget that specifying the plugins setting will override the defaults if you didn't already have it set! See this page for more information.
The redirects map should take the form of a key/value pair:
- The key of each redirect is the original markdown doc (relative to the
docs_dirpath).- This plugin will handle the filename resolution during the
docums buildprocess. This should be set to what the original markdown doc's filename was (or what it would be if it existed), not the final HTML file rendered by Docums
- This plugin will handle the filename resolution during the
- The value is the redirect target. This can take the following forms:
- Path of the markdown doc you wish to be redirected to (relative to
docs_dir)- This plugin will handle the filename resolution during the
docums buildprocess. This should be set to what the markdown doc's filename is, not the final HTML file rendered by Docums
- This plugin will handle the filename resolution during the
- External URL (e.g.
http://example.com)
- Path of the markdown doc you wish to be redirected to (relative to
During the docums build process, this plugin will create .html files in site_dir for each of the "old" file that redirects to the "new" path.
It will produce a warning if any problems are encountered or of the redirect target doesn't actually exist (useful if you have strict: true set).
use_directory_urls
If you have use_directory_urls: true set (which is the default), this plugin will modify the redirect targets to the directory URL, not the actual index.html filename.
However, it will create the index.html file for each target in the correct place so URL resolution works.
For example, a redirect map of 'old/dir/README.md': 'new/dir/README.md' will result in an HTML file created at $site_dir/old/dir/index.html which redirects to /new/dir/.
Additionally, a redirect map of 'old/dir/doc_name.md': 'new/dir/doc_name.md' will result in $site_dir/old/dir/doc_name/index.html redirecting to /new/dir/doc_name/.
This mimics the behavior of how Docums builds the site dir without this plugin.
Contributing
- Pull Requests are welcome.
- File bugs and suggestions in the GitHub Issues.
Releasing
make release
It will prompt you for your PyPI user and password.
See:
Metadata
Release files for docums-redirects 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| docums-redirects-1.0.0.tar.gz | 4.9 kB | Without provenance | Details |
Release files / docums-redirects-1.0.0.tar.gz
| Download URL | docums-redirects-1.0.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c2e41ad153471eb7720868c034ed047068f88f6bb78ebc7c2a9d18d8b6936d2
|
|
BLAKE2b-256 checksum How to use checksums |
5612f3f566e562821b787e6e2c62e3cf3322f57bb30ad6a754edbd06de6fe71b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.4
|
Security for docums-redirects 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.