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.
**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.
<!-- github-sync-id:1776488481 -->
@svrooij, do you have a date field in your front matter section?
The {{fm.<field-name>}} placeholder is what can be used here, only need to find the best approach to apply the date formatting.
@svrooij, do you have a date field in your front matter section?
The `{{fm.<field-name>}}` placeholder is what can be used here, only need to find the best approach to apply the date formatting.
<!-- github-comment-id:1611136319 -->
@estruyf yes I do have the date field in the front matter. I think it's even a default field if you setup front matter CMS.
I was not sure if formatting would be an option, or if it would be easier to make 3 addition special placeholders day / month / year that are filled if the frontmatter has a date property.
@estruyf yes I do have the date field in the front matter. I think it's even a default field if you setup front matter CMS.
I was not sure if formatting would be an option, or if it would be easier to make 3 addition special placeholders `day / month / year` that are filled if the frontmatter has a `date` property.
<!-- github-comment-id:1611143592 -->
Indeed, OOTB Front Matter has a date field, but you can adapt it by referring to your older articles.
This {{fm.date:yy}} is my preferred format right now, but more thinking towards something like this: {{fm.date | dateFormat 'yyyy'}}
Indeed, OOTB Front Matter has a date field, but you can adapt it by referring to your older articles.
This `{{fm.date:yy}}` is my preferred format right now, but more thinking towards something like this: `{{fm.date | dateFormat 'yyyy'}}`
<!-- github-comment-id:1611302037 -->
@svrooij I have added it. The format changed a bit. I've asked ChatGPT what would be the ideal field definition. It was pretty close to what we already came up with.
The format for this will be: {{fm.<field name>|format:<your format>}}. Example: {{fm.pubDate|format:dd/MM/yy}}.
PS: Feel free to try it out in the 8.5.5410787 beta.
@svrooij I have added it. The format changed a bit. I've asked ChatGPT what would be the ideal field definition. It was pretty close to what we already came up with.
The format for this will be: `{{fm.<field name>|format:<your format>}}`. Example: `{{fm.pubDate|format:dd/MM/yy}}`.

PS: Feel free to try it out in the `8.5.5410787` beta.
<!-- github-comment-id:1612729041 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 incontent/posts/{year}/{month}/{slug}.mdformat.@svrooij, do you have a date field in your front matter section?
The
{{fm.<field-name>}}placeholder is what can be used here, only need to find the best approach to apply the date formatting.@estruyf yes I do have the date field in the front matter. I think it's even a default field if you setup front matter CMS.
I was not sure if formatting would be an option, or if it would be easier to make 3 addition special placeholders
day / month / yearthat are filled if the frontmatter has adateproperty.Indeed, OOTB Front Matter has a date field, but you can adapt it by referring to your older articles.
This
{{fm.date:yy}}is my preferred format right now, but more thinking towards something like this:{{fm.date | dateFormat 'yyyy'}}Having the
| dateFormat 'yy'would allow using it on other fields as well. That sound like a perfect plan.@svrooij I have added it. The format changed a bit. I've asked ChatGPT what would be the ideal field definition. It was pretty close to what we already came up with.
The format for this will be:
{{fm.<field name>|format:<your format>}}. Example:{{fm.pubDate|format:dd/MM/yy}}.PS: Feel free to try it out in the
8.5.5410787beta.It works perfectly, shall I close the issue? Or does that happen automatically if you release the new version
@svrooij I will close it when I document and release it in the main version.