From 4984821adf3d7b15275a09073cdba924a1bcdd80 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 24 Sep 2018 15:59:56 +0100 Subject: [PATCH] sitemap.json: Fix chapter_number --- sitemap.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sitemap.json b/sitemap.json index 5474e7c..43c99be 100644 --- a/sitemap.json +++ b/sitemap.json @@ -2,9 +2,13 @@ --- {% assign pages = site.en | sort: "idx" %} +{% assign num = 0 %} [ {% for link in pages %} + {% assign idsplit = link.id | split: '/' %} + {% assign section = idsplit[2] %} + { "idx": {{ link.idx }}, "title": "{{ link.title }}", @@ -13,8 +17,10 @@ "description": "{{ link.description }}", {% endif %} "priority": 1 - {% if link.num %}, "chapter_number": {{ link.num }}{% endif %} + {% if section != "index" %}, "chapter_number": {{ num }}{% endif %} }, + + {% assign num = num | plus:1 %} {% endfor %} {