A MkDocs plugin that adds support for site-relative URLs
Project description
MkDocs Site URLs
A MkDocs plugin that adds support for site-relative site:
URLs.
Example:
URL | site_url | resulting URL |
---|---|---|
site:images/foo.png |
https://example.com/ |
/images/foo.png |
site:images/foo.png |
https://example.com/bar/ |
/bar/images/foo.png |
Usage
- Install the plugin from PyPI
pip install mkdocs-site-urls
- Add the
site-urls
plugin to yourmkdocs.yml
plugins section:plugins: - site-urls
There are no configuration options. - Start using site-relative URLs in your Markdown files by prefixing them with
site:
:[Link to another page](site:another-page/relative/to/the/site/root) ![Image](site:images/foo.png)
How it works
The plugin hooks into the on_page_content
event
and replaces all URLs in href
or src
attributes in the rendered HTML with the corresponding site-relative URLs.
License
This project is licensed under the MIT license, see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mkdocs-site-urls-0.1.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for mkdocs_site_urls-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94b992f0cba992e7f4c244965e252abc8bcc21e14a88396075d5c72f2ce88277 |
|
MD5 | 9915baef721d83144dcf65805f50fd09 |
|
BLAKE2b-256 | 41c55dc54a8e5b6879cf3e0bb37829cdd2742a6dbb393121205f1affc15b0162 |