Skip to main content

mkdocs-vwidalias

mkdocs-vwidalias is a tiny MkDocs plugin that generates root-level alias URLs based on a page’s front-matter ID.

  • Front-matter:
  ---
  id: SV-OVERVIEW
  title: Services Overview
  ---
  • Build output:
  site/SV-OVERVIEW.html
  • When opened, it redirects to the canonical page (by default appending #SV-OVERVIEW):
  /path/to/page/#SV-OVERVIEW

Now you can share short links like:

https://yoursite/SV-OVERVIEW/

Features

  • Reads a configurable front-matter field (id_field, default id)
  • Emits alias pages at /<ID>.html (or /prefix/<ID>.html)
  • Optional alias_prefix (e.g., /id/SV-OVERVIEW.html)
  • Optional url_prefix (e.g., safe/ to produce safe/services/#ID)
  • Optional #ID appended to the target (append_hash: true)
  • Duplicate ID detection (warn or fail)
  • Verbose logging for easy debugging

Install

pip install mkdocs-vwidalias

Configure (mkdocs.yml)

plugins:
  - search
  - vwidalias:
      id_field: "id"          # front-matter key
      alias_prefix: ""        # "" => /<ID>.html ; "id" => /id/<ID>.html
      url_prefix: ""          # prepend to redirect target (e.g., "safe/")
      append_hash: true       # append '#<ID>' to target URL
      fail_on_duplicate: false

Author pages

---
id: SV-OVERVIEW
title: Services Overview
---

# Services Overview
Hello!

Build the site and you’ll get:

  • Alias: site/SV-OVERVIEW.html
  • Redirect target: /services/overview/#SV-OVERVIEW (default) or safe/services/overview/#SV-OVERVIEW when url_prefix: "safe/"

Debugging

Run with verbose logs:

mkdocs build -v
# or
mkdocs serve -v

You should see:

[mkdocs_vwidalias] Aliases to emit: 1
[mkdocs_vwidalias] Emitted 1 alias pages. Prefix=''

Notes

  • Keep id values unique across pages.
  • Works best with MkDocs pretty URLs (default).
  • Alias pages include a canonical link to the target for SEO.

Release files for mkdocs-vwidalias 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-vwidalias 0.1.5
File Size Uploaded
mkdocs-vwidalias-0.1.5.tar.gz 4.7 kB Details

Release files / mkdocs-vwidalias-0.1.5.tar.gz

Download URL mkdocs-vwidalias-0.1.5.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e569cbec7a49e2d0b709046a1f7c76f58992239387fcf6d04630496bb98b860a
BLAKE2b-256 checksum
How to use checksums
f7405c60b406aca36dc4a81bc1bac7ffd8eab6569303351d47d1212855ad043c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.5 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page