Skip to content

Commit 700684e

Browse files
committed
Fixed ordering on tutorial. Should work remotely too this time.
1 parent 785acc0 commit 700684e

33 files changed

+45
-212
lines changed

_layouts/category_index.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

_plugins/generate_categories.rb

Lines changed: 0 additions & 162 deletions
This file was deleted.

tutorials/index.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ title: Tutorials
66
<div class="page-header-index">
77
<h1>A Tour of Scala <small>Bite-size pieces of all of the essentials...</small></h1>
88
</div>
9-
<ul>
109
{% for pg in site.pages %}
11-
{% if pg.tutorial == "scala-tour" %}
12-
<li><a href="{{ pg.url }}">{{ pg.title }}</a></li>
10+
{% if pg.tutorial == "scala-tour" and pg.outof %}
11+
{% assign totalPages = pg.outof %}
1312
{% endif %}
1413
{% endfor %}
15-
</ul>
16-
17-
1814

15+
{% if totalPages %}
16+
<ul>
17+
{% for i in (1..totalPages) %}
18+
{% for pg in site.pages %}
19+
{% if pg.tutorial == "scala-tour" and pg.num and pg.num == i %}
20+
<li><a href="{{ pg.url }}">{{ pg.title }}</a></li>
21+
{% endif %}
22+
{% endfor %}
23+
{% endfor %}
24+
</ul>
25+
{% else %} **ERROR**. Couldn't find the total number of pages in this set of tutorial articles. Have you declared the `outof` tag in your YAML front matter?
26+
{% endif %}

tutorials/tour/abstract-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
layout: tutorial
33
title: Abstract Types
44

5-
category: scala-tour
65
tutorial: scala-tour
7-
no: 2
6+
num: 2
7+
outof: 33
88
---
99

1010
In Scala, classes are parameterized with values (the constructor parameters) and with types (if classes are [generic](generic-classes.html)). For reasons of regularity, it is not only possible to have values as object members; types along with values are members of objects. Furthermore, both forms of members can be concrete and abstract.

tutorials/tour/annotations.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
layout: tutorial
33
title: Annotations
44

5-
category: scala-tour
65
tutorial: scala-tour
7-
no: 3
6+
num: 3
87
---
98

109
Annotations associate meta-information with definitions.

tutorials/tour/anonymous-function-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: tutorial
33
title: Anonymous Function Syntax
44

55
tutorial: scala-tour
6-
no: 14
6+
num: 14
77
---
88

99
Scala provides a relatively lightweight syntax for defining anonymous functions. The following expression creates a successor function for integers:

tutorials/tour/automatic-closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: tutorial
33
title: Automatic Type-Dependent Closure Construction
44

55
tutorial: scala-tour
6-
no: 16
6+
num: 16
77
---
88

99
Scala allows parameterless function names as parameters of methods. When such a method is called, the actual parameters for parameterless function names are not evaluated and a nullary function is passed instead which encapsulates the computation of the corresponding parameter (so-called *call-by-name* evalutation).

tutorials/tour/case-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: tutorial
33
title: Case Classes
44

55
tutorial: scala-tour
6-
no: 5
6+
num: 5
77
---
88

99
Scala supports the notion of _case classes_. Case classes are regular classes which export their constructor parameters and which provide a recursive decomposition mechanism via [pattern matching](pattern-matching.html).

tutorials/tour/classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: tutorial
33
title: Classes
44

55
tutorial: scala-tour
6-
no: 4
6+
num: 4
77
---
88

99
Classes in Scala are static templates that can be instantiated into many objects at runtime.

tutorials/tour/compound-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: tutorial
33
title: Compound Types
44

55
tutorial: scala-tour
6-
no: 6
6+
num: 6
77
---
88

99
Sometimes it is necessary to express that the type of an object is a subtype of several other types. In Scala this can be expressed with the help of *compound types*, which are intersections of object types.

0 commit comments

Comments
 (0)