Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Placeholder support for slugs #746

Closed
estruyf opened this issue Jan 29, 2024 · 2 comments
Closed

Enhancement: Placeholder support for slugs #746

estruyf opened this issue Jan 29, 2024 · 2 comments

Comments

@estruyf
Copy link
Owner

estruyf commented Jan 29, 2024

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.

@estruyf estruyf added the enhancement New feature or request label Jan 29, 2024
@estruyf
Copy link
Owner Author

estruyf commented Jan 29, 2024

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)

estruyf added a commit that referenced this issue Jan 29, 2024
@estruyf
Copy link
Owner Author

estruyf commented Jan 30, 2024

New settings:

{
  "frontMatter.taxonomy.slugTemplate": "{{title}}",
  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "slugTemplate": "{{fm.pubDate|format:yyyy-MM}}-{{title}}",
      "fields": []
    }
  ]  
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant