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

Template handling for dates in custom permalinks #1277

Closed
digitalcraftsman opened this issue Jul 17, 2015 · 4 comments
Closed

Template handling for dates in custom permalinks #1277

digitalcraftsman opened this issue Jul 17, 2015 · 4 comments
Labels

Comments

@digitalcraftsman
Copy link
Member

As discussed in this forum post, it would be nice if Hugo integrates an easy way to handle templates for dates in custom permalinks.

If the custom permalink looks like this

[permalink]
    posts = ":year/:title"

I want to list all posts of a year (which could be extended for months and days) under example.com/2015/. Therefore I would like to see a supported folder structure like layouts/:year/templateName.html.

The solution of the forum post requires the _manual_ creation of a taxonomy with the year ("2015", "2016" and so on) and a corresponding template folder at static/<yearOfTheTaxonomy>/templateName.html for each year.

@bep
Copy link
Member

bep commented Jul 18, 2015

Only year?

:year the 4-digit year
:month the 2-digit month
:monthname the name of the month
:day the 2-digit day
:weekday the 1-digit day of the week (Sunday = 0)
:weekdayname the name of the day of the week
:yearday the 1- to 3-digit day of the year

@digitalcraftsman
Copy link
Member Author

I want to list all posts of a year (which could be extended for months and days)

The year is only needed for my purpose but as I mentioned (quote above) could this be extended. Your list of all possible elements in a permalink should of course be added.

@bep
Copy link
Member

bep commented Jul 25, 2015

This duplicates #448

@bep bep closed this as completed Jul 25, 2015
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants