Hi,
I’m looking to get my site onto hugo. Here’s the layout I’m looking for:
/ -> Home page
/ashic/blog -> List of all RegularPages
/ashic/blog/yyyy/mm/slug -> blog post
The file layout I have is:
/content
- ashic
- blog
-2017
-04
-slug-1.md
-slug-2.md
It seems it renders a list for /ashic, but /ashic/blog, /ashic/blog/2017 etc. fails. How can I say render home page, but for all blog stuff, the url should be /ashic/blog instead of just /ashic, or just /blog?
Hi @ashic. You can create “sections” under content (like content/post) but, the permalinks setting in your config.toml is what governs the resulting structure.
For example:
[permalinks]
post = "/:year/:month/:day/:slug/"
Because I want the date in my markdown file for better sorting and finding later, I just prefix the file with a YYYYMMDD string.
20170416-my-great-post.md
But so far as I know, you can’t “nest” folders in content, and it only gives you one level down, the “section” level.
Hi Rick,
Thanks for the response. Yeah, I found that too… And tried the following:
/content
- blog
- post1.md
- post2.md
with a permalink:
“blog” = “/ashic/blog/:year/:month/:slug”
But the “section” page, as you say, appears under /blog, and not under /ashic/blog. I tried to name the section “ashic”, and then the list appears under /ashic, and not /ashic/blog. I was wondering if there’s some trick with _index.md that would allow me to render a page at /ashic/blog.