# \[SOLVED\] Sorting of subsections and their pages

**URL:** <https://zola.discourse.group/t/solved-sorting-of-subsections-and-their-pages/248>\
**Category:** Support\
**Created:** [November 22, 2019, 6:57am UTC](https://zola.discourse.group/t/solved-sorting-of-subsections-and-their-pages/248 "2019-11-22T06:57:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![photong](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/photong/32/120_2.png) [@photong](https://zola.discourse.group/u/photong)\
**Post date:** [November 22, 2019, 6:57am UTC](https://zola.discourse.group/t/solved-sorting-of-subsections-and-their-pages/248/1 "2019-11-22T06:57:06Z")

</div>

I have the following content directory structure:

```bash
|-- blog
|----cat1
|------post1.md
|------post2.md
|----cat2
|------post3.md
|------post4.md

```

‘cat1/\_index.html’ and ‘cat2/\_index.html’ have transparent = true and sort\_by = “date”.  
‘blog/\_index.html’ has sort\_by = “date”.

When I list posts in the blog section, everything works as expected (posts from ‘cat1’  
and ‘cat2’ are listed in order of date). The problem is listing the subsection links.  
As mentiond in the docs, subsections must be ordered by “weight”. However, I need  
sort\_by = “date” in ‘blog/\_index.html’ to list the posts in order of date. It seems that I need ‘blog/\_index.html’ to have something like:

```auto
sort_pages_by = "date"
sort_subsections_by = "weight"

```

The only workaround I can think of is to give each page a “weight” based on its date (weight = 20180102, weight = 20180104, etc.) and then sort everything by “weight”, but this is a rather ugly hack. Am I missing something?

---

<div class="post-metadata">

**Author:** ![photong](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/photong/32/120_2.png) [@photong](https://zola.discourse.group/u/photong)\
**Post date:** [November 22, 2019, 7:01am UTC](https://zola.discourse.group/t/solved-sorting-of-subsections-and-their-pages/248/2 "2019-11-22T07:01:56Z")

</div>

Please ignore this post. I restarted “zola serve” and the section weights got picked up. Everything works as expected now.
