Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use time.Format in date partial to allow localized formatting #582

Open
hedzards opened this issue Jan 9, 2024 · 1 comment
Open

use time.Format in date partial to allow localized formatting #582

hedzards opened this issue Jan 9, 2024 · 1 comment

Comments

@hedzards
Copy link

hedzards commented Jan 9, 2024

Hi,

I am completely new to Hugo and just barely got to know your theme that fits nicely for my needs. I tried to set

BookDateFormat: ":date_long"

to get localized values for the date in posts. Unfortunately that does not work. I changed partials/date.html to

{{- return (time.Format $format .Date) -}}

which does what I expect. Is this the right way to do it? And would that be an adjustment that makes sense in general?

Regards
Hendrik

@alex-shpak
Copy link
Owner

Hi!
Yes, that partial there specifically for that purpose, as that date formatting is old, I'm afraid to change it to not break someone's site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants