{"id":18756478,"url":"https://github.com/octoprint/mkdocs-site-urls","last_synced_at":"2025-04-13T02:03:48.052Z","repository":{"id":184452499,"uuid":"671898746","full_name":"OctoPrint/mkdocs-site-urls","owner":"OctoPrint","description":"A MkDocs plugin that adds support for site-relative `site:` URLs.","archived":false,"fork":false,"pushed_at":"2025-01-07T08:55:35.000Z","size":23,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T01:45:40.970Z","etag":null,"topics":["mkdocs","mkdocs-plugin","mkdocs-plugins"],"latest_commit_sha":null,"homepage":"https://octoprint.github.io/mkdocs-site-urls/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OctoPrint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["foosel"],"patreon":"foosel","custom":"https://octoprint.org/support-octoprint/"}},"created_at":"2023-07-28T11:55:04.000Z","updated_at":"2025-03-14T14:08:12.000Z","dependencies_parsed_at":"2024-11-07T17:52:57.121Z","dependency_job_id":null,"html_url":"https://github.com/OctoPrint/mkdocs-site-urls","commit_stats":null,"previous_names":["octoprint/mkdocs-site-urls"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctoPrint%2Fmkdocs-site-urls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctoPrint%2Fmkdocs-site-urls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctoPrint%2Fmkdocs-site-urls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctoPrint%2Fmkdocs-site-urls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OctoPrint","download_url":"https://codeload.github.com/OctoPrint/mkdocs-site-urls/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654083,"owners_count":21140235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mkdocs","mkdocs-plugin","mkdocs-plugins"],"created_at":"2024-11-07T17:36:48.259Z","updated_at":"2025-04-13T02:03:48.017Z","avatar_url":"https://github.com/OctoPrint.png","language":"Python","funding_links":["https://github.com/sponsors/foosel","https://patreon.com/foosel","https://octoprint.org/support-octoprint/"],"categories":[],"sub_categories":[],"readme":"# MkDocs Site URLs Plugin\n\n![GitHub release](https://img.shields.io/github/v/release/OctoPrint/mkdocs-site-urls?logo=github\u0026logoColor=white)\n![PyPI](https://img.shields.io/pypi/v/mkdocs-site-urls?logo=python\u0026logoColor=white)\n![Build status](https://img.shields.io/github/actions/workflow/status/OctoPrint/mkdocs-site-urls/build.yml?branch=main)\n[![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://octoprint.org/conduct/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1)](https://pycqa.github.io/isort/)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n\nA MkDocs plugin that adds support for site-relative `site:` URLs.\n\nExample:\n\n| URL | site_url | resulting URL |\n| --- | -------- | ------------- |\n| `site:images/foo.png` | `https://example.com/` | `/images/foo.png` |\n| `site:images/foo.png` | `https://example.com/bar/` | `/bar/images/foo.png` |\n\n**Please note**: This plugin requires MkDocs 1.5 or higher.\n\n## Getting Started\n\n1. Install the plugin from PyPI\n   ```bash\n   pip install mkdocs-site-urls\n   ```\n2. Add the `site-urls` plugin to your `mkdocs.yml` plugins section:\n   ```yaml\n   plugins:\n     - site-urls\n   ```\n3. Start using site-relative URLs in your Markdown files by prefixing them with `site:`:\n   ```markdown\n   [Link to another page](site:another-page/relative/to/the/site/root)\n\n   ![Image](site:images/foo.png)\n   ```\n\n## Configuration\n\nBy default the plugin will replace URLs in `href`, `src` and `data` attributes. You can configure the attributes to replace\nby setting the `attributes` option in your `mkdocs.yml`, e.g.:\n\n```yaml\nplugins:\n  - site-urls:\n      attributes:\n        - href\n        - src\n        - data\n        - data-url\n```\n\nBe advised that in case of any customization on your part you need to include the default attributes as well if you want\nto keep them, as the default list will not be included automatically anymore.\n\n## How it works\n\nThe plugin hooks into the [`on_page_content` event](https://www.mkdocs.org/dev-guide/plugins/#on_page_content)\nand replaces all URLs in the configured attributes (by default `href`, `src` or `data`) in the rendered HTML with the corresponding site-relative URLs.\n\n## License\n\nThis project is licensed under the MIT license, see the [LICENSE](https://github.com/OctoPrint/mkdocs-site-urls/blob/main/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoprint%2Fmkdocs-site-urls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoprint%2Fmkdocs-site-urls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoprint%2Fmkdocs-site-urls/lists"}