Enhancement: Placeholder support for slugs #593

Closed
opened 2026-10-05 02:54:45 +02:00 by adam · 2 comments
Owner

Like the preview path, the slug should also be able to use placeholders: https://frontmatter.codes/docs/content-creation/placeholders - that way, users can use any fields to include their slugs.

The configuration should be on the global level and content type level.

Like the preview path, the `slug` should also be able to use placeholders: https://frontmatter.codes/docs/content-creation/placeholders - that way, users can use any fields to include their slugs. The configuration should be on the global level and content type level. <!-- github-sync-id:2105199152 -->
adam closed this issue 2026-10-05 02:54:45 +02:00
Author
Owner

To be tested after the change:

  • Placeholders on fields
  • File creation with placeholder
  • Update slug command
  • Preview
  • Snippets in the snippets dashboard (placeholders on fields)
To be tested after the change: - [x] Placeholders on fields - [x] File creation with placeholder - [x] Update slug command - [x] Preview - [x] Snippets in the snippets dashboard (placeholders on fields) <!-- github-comment-id:1915008072 -->
Author
Owner

New settings:

{
  "frontMatter.taxonomy.slugTemplate": "{{title}}",
  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "slugTemplate": "{{fm.pubDate|format:yyyy-MM}}-{{title}}",
      "fields": []
    }
  ]  
}
New settings: ```json { "frontMatter.taxonomy.slugTemplate": "{{title}}", "frontMatter.taxonomy.contentTypes": [ { "name": "default", "pageBundle": false, "slugTemplate": "{{fm.pubDate|format:yyyy-MM}}-{{title}}", "fields": [] } ] } ``` <!-- github-comment-id:1917750958 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#593