content
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.
Suggestion
export interface ContentFile< Attributes extends Record<string, any> = Record<string, any>> {
filename: string;
+ slug: string;
content?: string;
attributes: Attributes;
}
Example
{
attributes: { ... }
filename: "/src/content/2023-foo-bar.md",
+ slug: "2023-foo-bar"
}
The slug should be URLEncoded.
No response
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 |
---|