Feedback: Formatting of paths/dates #252

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

I wonder if there is more to the formatting options of the preview path:

frontMatter.preview.pathName
Specify the path you want to add after the host and before your slug. This can be used for instance to include the year/month like: yyyy/MM. The date will be generated based on the article its date field value.

Type: string
Default: ""
Important: As the value will be formatted with the article's date, it will try to convert all characters you enter. In case you wan to skip some characters or all of them, you need to wrap that part between two single quotes. Example: "'blog/'yyyy/MM" will result in: blog/2021/08.

The documentation shows only yyyy/MM. I would expect, that there is more to this. Maybe adding a link to the formatting options of dates that are available? How to format "2022/january" or "22/jan" for instance?

I wonder if there is more to the formatting options of the preview path: ``` frontMatter.preview.pathName Specify the path you want to add after the host and before your slug. This can be used for instance to include the year/month like: yyyy/MM. The date will be generated based on the article its date field value. Type: string Default: "" Important: As the value will be formatted with the article's date, it will try to convert all characters you enter. In case you wan to skip some characters or all of them, you need to wrap that part between two single quotes. Example: "'blog/'yyyy/MM" will result in: blog/2021/08. ``` The documentation shows only `yyyy/MM`. I would expect, that there is more to this. Maybe adding a link to the formatting options of dates that are available? How to format "2022/january" or "22/jan" for instance? <!-- github-sync-id:1200230149 -->
adam closed this issue 2026-10-05 02:35:55 +02:00
Author
Owner

Internally we use date-fns and all the following formatting options are available: https://date-fns.org/v1.30.1/docs/format

Internally we use `date-fns` and all the following formatting options are available: https://date-fns.org/v1.30.1/docs/format <!-- github-comment-id:1096386423 -->
Author
Owner

Closing this issue as the question was answered.

Closing this issue as the question was answered. <!-- github-comment-id:1116371821 -->
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#252