Get post index/offset in Query Template

I found a - somehow - related post: accessing-current-post-id-within-loop. A “loop id” (-q-1, -q-2, etc…) is appended to all child elements of a query template. I used the ::after pseudo-element to add the post index:

h2#module-number:after {
  content: " 1";
}

h2#module-number-q-2:after {
  content: " 2";
}

h2#module-number-q-3:after {
  content: " 3";
}

...

Result:

image