Functions
path_to_slug
2
str
▼
Convert relative path to URL-friendly slug.
**Handles:**
- Extension removal (…
path_to_slug
2
str
▼
def path_to_slug(rel_path: Path | str, *, handle_index: bool = True) -> str
Convert relative path to URL-friendly slug.
Handles:
- Extension removal (.md, .markdown, etc.)
- Path separator normalization (backslash → forward slash)
- Index file handling (path/index → path)
Parameters
| Name | Type | Description |
|---|---|---|
rel_path |
Path | str |
Path relative to content directory |
handle_index |
bool |
If True, strip trailing /index from slugs Default:True
|
Returns
str
title_to_slug
1
str
▼
Convert title string to URL-friendly slug.
**Handles:**
- Lowercasing
- Removi…
title_to_slug
1
str
▼
def title_to_slug(title: str) -> str
Convert title string to URL-friendly slug.
Handles:
- Lowercasing
- Removing special characters
- Replacing spaces with hyphens
- Collapsing multiple hyphens
Parameters
| Name | Type | Description |
|---|---|---|
title |
str |
Page or document title |
Returns
str