HUGO

Control the order of articles and folders using a dedicated file

Hi, is it possible to control the order of articles and folders using a dedicated file per folder that will hold all the weights instead of specifying the weight in each file?
Thank you!

content
├── posts/
│   ├── post-1.md
│   ├── post-2.md
│   └── post-3.md
└── _index.md

data/pages.toml

[[posts]]
path = 'posts/post-1.md'
weight = 2

[[posts]]
path = 'posts/post-2.md'
weight = 1

[[posts]]
path = 'posts/post-3.md'
weight = 3

layouts/posts/list.html

{{ range (sort site.Data.pages.posts "weight") }}
  {{ $page := site.GetPage .path }}
  <h2><a href="{{ $page.RelPermalink }}">{{ $page.Title }}</a></h2>
{{ end }}

Thank you @jmooring . Is there a possibility to control the order of the folders? Can you write an example please ?

What is your content structure? Post the output of tree content/.

The tree content is:
en → v6.0 → Getting Started
en → v6.0 → About Us
en → v6.0 → Imaging
en → v6.0 → Processing

en → v6.2 → Getting Started
en → v6.2 → About Us
en → v6.0 → Deployment
en → v6.0 → Integration

Is it possible to control the order of these folders? Can you write an example please ? Thank you @jmooring !

I want to know what your directory structure looks like. What you posted above is not helpful. Can you use the tree command on your system? I cannot tell what is a page and what is a directory.

All specified above are directories. I want to control order of these folders and put
en → v6.0 → Processing
folder as first folder,
en → v6.0 → About Us
should be the last folder.

In addition, I have files (a.md, b.md, c.md …) in these folders and I would like to have also control over their order. Thank you @jmooring !

Hi, I am looking for a way to show in the left menu of ZDoc theme a list of documents (files and folders) based on an order specified in one file (and not based on the weight). I am interesting in to control the list of docs in the menu like here - in the documents of the theme. What can be the way to solve this?

Thank you very much!