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

Respect parmas.dateFmt key's value on /posts/ page #27

Open
etanot opened this issue Sep 16, 2021 · 0 comments
Open

Respect parmas.dateFmt key's value on /posts/ page #27

etanot opened this issue Sep 16, 2021 · 0 comments

Comments

@etanot
Copy link

etanot commented Sep 16, 2021

Type: Feature request.

On /posts/ page, datetime format is "2006-01-02", despite parmas.dateFmt key value being set to different value. This happens because we have hard coded the date format for /posts/ page.

{{ .Date.Format "2006-01-02" }} <a href="{{ .RelPermalink }}">{{.Title }}</a>

It would be nice, if we would respect params.dateFmt key value.


One solution could be replace:

{{ .Date.Format "2006-01-02" }}

with

{{ .Date.Format (default "2006-01-02" .Site.Params.dateFmt)}}

But there is a one problem with this solution, if .params.dateFmt key value also contains time, /posts/ page will also contain time along with date, which I think nobody wants it (i.e. time along with date on /posts/ page).

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

1 participant