add slug based on filename to ContentFile data

This issue has been tracked since 2023-02-02.

Which scope/s are relevant/related to the feature request?



The slug for the URL of a content page (markdown) can currently be explicitely added using a frontmatter attribute or by extracting it form the filename which is part of the ContentFile interface. It would be neat it the slug can be provided by the content plugin based on the filename without removing manually the path and extension parts form the filename string.


export interface ContentFile< Attributes extends Record<string, any> = Record<string, any>> {
  filename: string;
+ slug: string;
  content?: string;
  attributes: Attributes;


  attributes: { ... }
  filename: "/src/content/",
+ slug: "2023-foo-bar"

The slug should be URLEncoded.

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
More Details About Repo
Owner Name analogjs
Repo Name analog
Full Name analogjs/analog
Language TypeScript
Created Date 2022-07-06
Updated Date 2023-03-28
Star Count 885
Watcher Count 18
Fork Count 67
Issue Count 33


Issue Title Created Date Updated Date