Skip to content

Commit 26b9ad0

Browse files
Merge pull request #88 from WeeRox/issue-9
The number of the current step is shown in the bubble
2 parents 1491383 + 7bcced8 commit 26b9ad0

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

_layouts/tutorial.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,20 @@
7070
{% assign has_next_page = false %}
7171
{% assign next_page = nil %}
7272
{% for p in site.pages %}
73-
{% assign p_language = p.path | split: "/" | first %}
74-
{% assign file_name = p.path | split: "/" %}
73+
{% assign file_name = page.path | split: "/" %}
7574
{% assign file_name = file_name[1] %}
76-
{% assign topic = page.path | split: "-" | first %}
77-
{% assign p_topic = p.path | split: "-" | first %}
7875

79-
{% if p_language == page.lang %}
76+
{% assign p_file_name = p.path | split: "/" %}
77+
{% assign p_file_name = p_file_name[1] %}
78+
79+
{% assign topic = file_name | split: "-" | first %}
80+
{% assign p_topic = p_file_name | split: "-" | first %}
81+
82+
{% assign step = file_name | split: "-" %}
83+
{% assign step = step[1] %}
84+
{% assign step = step | split: "." | first %}
85+
86+
{% if p.lang == page.lang %}
8087
{% if p_topic == topic and same_topic_started == false %}
8188
<div class="same-topic">
8289
{% assign same_topic_started = true %}
@@ -85,7 +92,7 @@
8592
</div>
8693
{% assign same_topic_started = false %}
8794
{% endif %}
88-
<a id="page-{{ p.path }}" class="step {% if page == p %}current{% endif %}" href="..{{ p.url }}"></a>
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>
8996
{% if should_assign_next %}
9097
{% assign should_assign_next = false %}
9198
{% assign has_next_page = true %}

css/progress.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
display: block;
1010
}
1111

12-
.progress .step {
12+
.step {
1313
width: 10px;
1414
height: 10px;
1515
border: 3px solid {{ site.data.colors.step-color }};
@@ -24,16 +24,24 @@
2424
display: inline-block;
2525
}
2626

27-
.progress .step.done {
27+
.step.done {
2828
background-color: {{ site.data.colors.step-done-color }};
2929
border-color: {{ site.data.colors.step-done-border-color }};
3030
}
3131

32-
.progress .step.current {
32+
.step.current {
3333
background-color: {{ site.data.colors.step-color }};
34+
color: white;
35+
text-decoration: none;
36+
font-size: 14px;
37+
width: 20px;
38+
height: 20px;
39+
line-height: 20px;
40+
border-radius: 20px;
41+
border-width: 4px;
3442
}
3543

36-
.progress .same-topic {
44+
.same-topic {
3745
background-color: {{ site.data.colors.header-color }};
3846
clear: none;
3947
padding: 5px;

0 commit comments

Comments
 (0)