When I write a blog post, it get published at (xyz.com/post) and we all know that this is not a good SEO practice.
So I want to know if there is a way that my post gets published at (xyz.com/2016/07/post).
I think the exact opposite, except for news sites or blogs where the date is an essential information, but that’s just my opinion.
That said, you can either structure your content in subfolders, so it’s also easier to navigate in the Admin, and build your Twig template so it loops by taxonomy (instead of looping through direct children of the blog/ page, search pages by
category: blog for example), or you can add a custom route to each page, but this is not convenient if you have lots of pages and is prone to errors as you can forget it.
yep, it’s the exact opposite
I am working on a blog, So I guess I need it… Thanks for the replies guys but I still cant understand how I am going to make that happen. Just for the info I am little new to Grav.
It’s not mandatory for blog posts either, this is a good summary: http://www.problogger.net/archives/2008/07/22/dates-on-blogs/
Anyway, to do it create a folder
user/pages/blog/2016 and another
user/pages/blog/2016/07. Then inside this folder create your blog posts as
item.md files with category taxonomy “blog” for example.
You’ll have something like
Then create a
user/pages/blog/blog.md page, and inside it define it should show pages with category “blog”:
content: items: '@taxonomy.category': blog
If you’re using a theme that provides a blog structure (Antimatter for example), this should already work.
Also check this blog tutorial to learn more.
Thanks for the quick reply.
I have managed to do all the things you said to.
So I have created user/pages/blog/2016/07/hello-world/item.md and user/pages/blog/ has blog.md
but it doesn’t work… I am getting a 2016 post in the blog page but when I click its says page not found…
Thanks a lot for helping me out… I know why it didn’t worked at the first place… I didn’t had a blog.md at user/pages/2016/06/blog.md
So its working now thanks