Skip to content

Enhancement: Date format in preview path #593

Description

@svrooij

Is your feature request related to a problem? Please describe.
I migrated from Jekyll to Hugo and wanted to keep the old url format /{year}/{month}/{day}/{slug} this is perfectly doable in Hugo. But now I cannot get the preview path to load, since it would require having the day.

Describe the solution you'd like
I would like support for either {{fm.day}} / {{fm.month}} / {{fm.year}} in the preview path or have some sort of formatting option on the provided date value like {{fm.date.format('yy')}} or {{fm.date:yy}} depending on language features.

Describe alternatives you've considered
I've considered using the {{pathToken.x}} placeholders, but that does not work because I don't have the day folder, since my posts are stored in content/posts/{year}/{month}/{slug}.md format.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions