Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

How to generate blog-item folder dynamically based on current date

Started by Leon 4 years ago · 2 replies · 305 views
4 years ago

I would like the blog posts to have a slug structure like year/month/day/post-title. However, I dont want to set it manually for each blog item I am going to write. Is there a way to chqnge the default slug generation?

last edited 12/01/22 by pamtbaau
4 years ago

@leon, Do you want the folder structure to be generated dynamically based on the current date?

If so, I guess you will need a plugin for that. I've never played with this use-case though.

4 years ago

Can you give me the first steps? I haven't found a way to hook up to the event when a page of a specific template is created and then I would have to create a folder structure based on that.
How would this behave with child elements in grav? Would my blog posts still be discoverable by the main blog page?

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 133 1 day ago
General · by pamtbaau, 1 day ago
1 93 1 day ago
General · by Andy Miller, 2 days ago
0 77 2 days ago
General · by Marcel, 12 months ago
6 387 5 days ago
General · by Duc , 6 days ago
3 72 6 days ago