fix: wikilinks normalization and various slugging fixes

This commit is contained in:
saberzero1
2026-04-17 00:35:28 +02:00
parent 6def58c0d0
commit 85563ffaab
7 changed files with 89 additions and 82 deletions

View File

@@ -20,6 +20,7 @@ This plugin accepts the following configuration options:
- `openLinksInNewTab`: If `true`, configures external links to open in a new tab. Defaults to `false`.
- `lazyLoad`: If `true`, adds lazy loading to resource elements (`img`, `video`, etc.) to improve page load performance. Defaults to `false`.
- `externalLinkIcon`: Adds an icon next to external links when `true` (default) to visually distinguishing them from internal links.
- `disableBrokenWikilinks`: If `true`, internal links whose resolved slug is not present in the site (i.e. no matching file under `markdownLinkResolution`) gain an additional `broken` CSS class alongside `internal`, so they can be styled distinctly. Defaults to `false`. Applies to both wikilinks and regular Markdown links, since both are indistinguishable `<a>` elements by the time this plugin runs.
> [!warning]
> Removing this plugin is _not_ recommended and will likely break the page.

View File

@@ -52,7 +52,7 @@ This plugin accepts the following configuration options:
When enabled, this plugin renders a collapsible "Properties" panel before the page body. The panel displays selected frontmatter fields in a table with automatic type rendering:
- **Strings** are shown as plain text. [[Wikilinks]] and [markdown links](https://example.com) within strings are rendered as clickable links.
- **Strings** are shown as plain text. [[Wikilinks]] and [markdown links](https://example.com) within strings are rendered as clickable links. Wikilink targets are slugified the same way as body-content links (e.g. `[[My Note]]` resolves to `my-note`) and matching is case-insensitive to mirror Obsidian's behavior, so `[[MyNote]]`, `[[mynote]]`, and `[[MYNOTE]]` all point to the same page.
- **Arrays** are rendered as comma-separated lists.
- **Booleans** are rendered as disabled checkboxes.
- **Numbers** are rendered in a monospace font.
@@ -81,24 +81,24 @@ quartz-properties-collapse: false
Quartz supports the following frontmatter fields. Where multiple keys are listed, they are aliases — the first matching key is used.
| Field | Keys | Description |
| ------------------ | ------------------------------------------------- | ------------------------------------------------------------------ |
| Title | `title` | Page title. Falls back to filename if empty. |
| Description | `description` | Page description for metadata and search. |
| Tags | `tags`, `tag` | Categorization tags. Automatically slugified. |
| Aliases | `aliases`, `alias` | Alternative names for the page, used for link resolution. |
| Permalink | `permalink` | Custom URL slug. Also added to aliases. |
| CSS classes | `cssclasses`, `cssclass` | CSS classes applied to the page body. |
| Social image | `socialImage`, `image`, `cover` | Image used for social media previews. |
| Social description | `socialDescription` | Description used specifically for social media previews. |
| Created date | `created`, `date` | When the note was created. |
| Modified date | `modified`, `lastmod`, `updated`, `last-modified` | When the note was last modified. Falls back to `created` if unset. |
| Published date | `published`, `publishDate`, `date` | When the note was published. |
| Publish | `publish` | Whether the note should be published. |
| Draft | `draft` | Whether the note is a draft. |
| Comments | `comments` | Whether comments are enabled for the note. |
| Language | `lang` | Language code for the note. |
| Enable TOC | `enableToc` | Whether to show the table of contents. |
| Field | Keys | Description |
| ------------------ | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Title | `title` | Page title. Falls back to filename if empty. |
| Description | `description` | Page description for metadata and search. |
| Tags | `tags`, `tag` | Categorization tags. Slugified the same way as file paths: spaces become `-`, `&` becomes `-and-`, `%` becomes `-percent`, and tags are lowercased so that `#MyTag` and `#mytag` resolve to the same tag page (matching Obsidian). |
| Aliases | `aliases`, `alias` | Alternative names for the page, used for link resolution. |
| Permalink | `permalink` | Custom URL slug. Also added to aliases. |
| CSS classes | `cssclasses`, `cssclass` | CSS classes applied to the page body. |
| Social image | `socialImage`, `image`, `cover` | Image used for social media previews. |
| Social description | `socialDescription` | Description used specifically for social media previews. |
| Created date | `created`, `date` | When the note was created. |
| Modified date | `modified`, `lastmod`, `updated`, `last-modified` | When the note was last modified. Falls back to `created` if unset. |
| Published date | `published`, `publishDate`, `date` | When the note was published. |
| Publish | `publish` | Whether the note should be published. |
| Draft | `draft` | Whether the note is a draft. |
| Comments | `comments` | Whether comments are enabled for the note. |
| Language | `lang` | Language code for the note. |
| Enable TOC | `enableToc` | Whether to show the table of contents. |
## API

View File

@@ -25,7 +25,9 @@ This plugin accepts the following configuration options:
- `enableVideoEmbed`: If `true` (default), enables the embedding of video files.
- `enableCheckbox`: If `true`, adds support for interactive checkboxes in content, including custom task characters (e.g. `- [?]`, `- [!]`, `- [/]`). Defaults to `false`.
- `enableObsidianUri`: If `true` (default), marks `obsidian://` protocol links with a CSS class and data attribute for custom styling.
- `disableBrokenWikilinks`: If `true`, replaces links to non-existent notes with a dimmed, disabled link. Defaults to `false`.
> [!note]
> The `disableBrokenWikilinks` option previously lived on this plugin. It has moved to [[CrawlLinks]], which owns link resolution and can honor the configured `markdownLinkResolution` strategy when deciding whether a link is broken. Users upgrading from earlier Quartz v5 betas should move the option from `ObsidianFlavoredMarkdown` to `CrawlLinks`.
> [!warning]
> Don't remove this plugin if you're using [[Obsidian compatibility|Obsidian]] to author the content!