Skip to content

Commit 6f62b31

Browse files
committed
fix #9 use increasing numbers
1 parent 51a2a54 commit 6f62b31

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: _layouts/tutorial.html

+3-5
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
{% assign same_topic_started = false %}
6969
{% assign should_assign_next = false %}
7070
{% assign has_next_page = false %}
71+
{% assign step_index = 0 %}
7172
{% assign next_page = nil %}
7273
{% for p in site.pages %}
7374
{% assign file_name = page.path | split: "/" %}
@@ -79,11 +80,8 @@
7980
{% assign topic = file_name | split: "-" | first %}
8081
{% assign p_topic = p_file_name | split: "-" | first %}
8182

82-
{% assign step = file_name | split: "-" %}
83-
{% assign step = step[1] %}
84-
{% assign step = step | split: "." | first %}
85-
8683
{% if p.lang == page.lang %}
84+
{% assign step_index = step_index | plus: 1 %}
8785
{% if p_topic == topic and same_topic_started == false %}
8886
<div class="same-topic">
8987
{% assign same_topic_started = true %}
@@ -92,7 +90,7 @@
9290
</div>
9391
{% assign same_topic_started = false %}
9492
{% endif %}
95-
<a id="page-{{ p.path }}" class="step {% if page == p %}current{% endif %}" href="..{{ p.url }}">{% if page == p %}<script>document.write(parseInt("{{ step }}", 10));</script>{% endif %}</a>
93+
<a id="page-{{ p.path }}" class="step {% if page == p %}current{% endif %}" href="..{{ p.url }}">{% if page == p %}{{ step_index }}{% endif %}</a>
9694
{% if should_assign_next %}
9795
{% assign should_assign_next = false %}
9896
{% assign has_next_page = true %}

0 commit comments

Comments
 (0)