Skip to content

Commit 17019c9

Browse files
committed
Semanticize the HTML in the chapter index a bit.
1 parent 219b6ab commit 17019c9

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed

chapters/index.html

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,24 @@
1717
- Databases
1818
---
1919

20-
{% for chapter in page.chapters %}
21-
{% capture url %}/chapters/{{ chapter | replace: ' ', '_' | downcase }}{% endcapture %}
22-
{% capture indexurl %}{{ url }}/index.html{% endcapture %}
20+
<ol id="chapters">
21+
{% for chapter in page.chapters %}
22+
{% capture url %}/chapters/{{ chapter | replace: ' ', '_' | downcase }}{% endcapture %}
23+
{% capture indexurl %}{{ url }}/index.html{% endcapture %}
2324

24-
<h2><a href="{{ url }}">{{ chapter }}</a></h2>
25+
<li class="chapter">
26+
<h2><a href="{{ url }}">{{ chapter }}</a></h2>
2527

26-
<ul>
27-
{% for page in site.pages %}
28-
{% if page.url contains url %}
29-
{% unless page.url == indexurl %}
30-
<li><a href="{{ page.url | replace: '.html', '' }}">{{ page.title }}</a></li>
31-
{% endunless %}
32-
{% endif %}
33-
{% endfor %}
34-
</ul>
28+
<ul id="recipes">
29+
{% for page in site.pages %}
30+
{% if page.url contains url %}
31+
{% unless page.url == indexurl %}
32+
<li class="recipe"><a href="{{ page.url | replace: '.html', '' }}">{{ page.title }}</a></li>
33+
{% endunless %}
34+
{% endif %}
35+
{% endfor %}
36+
</ul>
37+
</li>
3538

36-
{% endfor %}
39+
{% endfor %}
40+
</ul>

index.html

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,24 @@ <h1>Welcome</h1>
2121

2222
<p>Welcome to the CoffeeScript Cookbook! CoffeeScript recipes for the community <em>by</em> the community. Head over to the <a href="/contributing">Contributing</a> page and see what you can do to help out!</p>
2323

24-
{% for chapter in page.chapters %}
25-
{% capture url %}/chapters/{{ chapter | replace: ' ', '_' | downcase }}{% endcapture %}
26-
{% capture indexurl %}{{ url }}/index.html{% endcapture %}
24+
<ol id="chapters">
25+
{% for chapter in page.chapters %}
26+
{% capture url %}/chapters/{{ chapter | replace: ' ', '_' | downcase }}{% endcapture %}
27+
{% capture indexurl %}{{ url }}/index.html{% endcapture %}
2728

28-
<h2><a href="{{ url }}">{{ chapter }}</a></h2>
29+
<li class="chapter">
30+
<h2><a href="{{ url }}">{{ chapter }}</a></h2>
2931

30-
<ul>
31-
{% for page in site.pages %}
32-
{% if page.url contains url %}
33-
{% unless page.url == indexurl %}
34-
<li><a href="{{ page.url | replace: '.html', '' }}">{{ page.title }}</a></li>
35-
{% endunless %}
36-
{% endif %}
37-
{% endfor %}
38-
</ul>
32+
<ul id="recipes">
33+
{% for page in site.pages %}
34+
{% if page.url contains url %}
35+
{% unless page.url == indexurl %}
36+
<li class="recipe"><a href="{{ page.url | replace: '.html', '' }}">{{ page.title }}</a></li>
37+
{% endunless %}
38+
{% endif %}
39+
{% endfor %}
40+
</ul>
41+
</li>
3942

40-
{% endfor %}
43+
{% endfor %}
44+
</ul>

0 commit comments

Comments
 (0)