How to enumerate my sections and subsections in Jekyll

Hi I am building a website to upload some of my work. The website is made up of project documentation. I split up the documentation for a project in pages which are sections and the corresponding subsections.

Here is the overall structure of the the source. I used _ instead o blank space to give the gist of the organization because space are erased.

├── index.html
├── _layouts
___└── documentation.html
├── _projects
___└── project1
_______└── (These are in the same directory but logically they are part of the section introduction)
__└── project2
_____└── same_pattern…

Each page is made up of a section file ( and the corresponding subsection files(…).

To do that the layout file documentation.html shows first of all the content of a section, and go through all the subsection printing just the one that “belong” to the above section. I preserved the order I wanted thanks to how I called the single files.

Nevertheless since there is this implicit structure, I also wanted to enumerate such paragraphs automatically, in a Latex fashion(without adding more properties to the relative page).

For example for the page relative to section “Introduction” I would like to have something like this:

  1. Introduction
    some text
    1 . 1 Subsection 1
    some text
    1 . 2 Sebsection 2
    some text

And for the page relative to “Implementation”

  1. Implementaion
    some text
    2 . 1 Subsection 1
    some teext
    2 . 2 Subsection 2
    some text

Since I am a newbie in Jekyll I don’t know if it is possible and which tools should I use.

I hope anyone could give me a hint, and thank you in advance.

Sorry, have to ask, why break down the page into all the different files? is this cause you inherited it like this? or your are creating it like this cause each one is really long or something? understanding that may help answer the question.

If each project was its own collection, then inside that you had all the files it would be fairly simple to loop thru the collection and output all the files into one file.

In your example it seems like wouldn’t even have content? it is just a heading? the content for para 1 is in a separate file? this part of your example doesn’t make any sense to me.

Thanks so much for your reply rdyar!

I did this just because I wanted to create some sort of hierarchy within my project, and if I need to modify a specific paragraph I exactly know which one modify.

Yes I did that, the only thing is that I wanted to generate an automatic indexing of each section and subsection as mentioned.

Introduction may or may not have its own text, then if I decide to add a subsection it will go right after it. I attach an example for clarity.

You may be able to do the indexing by setting a variable and then incrementing it in the loop. There is a recent thread about someone wanting to do a breadcrumb that may be similar to what you want.

Personally I would find it easier to edit one file than all the different ones - like what if you want to edit more than one paragraph? plus if you have a lot of different projects that could be a ton of files to sift thru to find something. But thats just an opinion so don’t take it seriously.

So you mostly have it working but just want the project 4 section 4.1 parts?