sitemap.json: Fix chapter_number

master
rubenwardy 2018-09-24 15:59:56 +01:00
parent 3936c2ebe9
commit 4984821adf
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
1 changed files with 7 additions and 1 deletions

View File

@ -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 %}
{