Skip to content

Commit 7992d3f

Browse files
committed
Added a routing component
1 parent a29af2a commit 7992d3f

File tree

15 files changed

+73
-55
lines changed

15 files changed

+73
-55
lines changed

_data/navigation.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
11
- title: "Getting started"
22
items:
33
- title: "Command Line"
4-
url: "/getting-started/"
4+
route: command_line
55
_blank: false
66
- title: "Configuration"
7-
url: "/configuration/"
7+
route: configuration
88
_blank: false
99
- title: "Annotations"
10-
url: "/annotations/"
10+
route: annotations
1111
_blank: false
1212
- title: "File-level annotations"
13-
url: "/file-level-annotations/"
13+
route: poster_annotations
1414
_blank: false
1515
- title: "Customising the view"
16-
url: "/customising-the-view/"
16+
route: view
1717
_blank: false
1818
- title: "Custom theme"
1919
order: 2
2020
items:
2121
- title: "Using your own theme"
22-
url: "/using-your-own-theme/"
22+
route: custom_theme
2323
_blank: false
2424
- title: "Data Interface"
25-
url: "/data-interface/"
25+
route: data_interface
2626
_blank: false
2727
- title: "Extending SassDoc"
28-
url: "/extending-sassdoc/"
28+
route: extending_sassdoc
2929
_blank: false
3030
- title: "Extra tools"
31-
url: "/extra-tools/"
31+
route: extra_tools
3232
_blank: false
3333
- title: "Theme generator"
34-
url: "/theme-generator/"
34+
route: theme_generator
3535
_blank: false
3636
- title: "Theme Gallery"
37-
url: "/theme-gallery/"
37+
route: theme_gallery
3838
_blank: false
3939
- title: "Alternative usages"
4040
items:
4141
- title: "Node"
42-
url: "/node/"
42+
route: node
4343
_blank: false
4444
- title: "Grunt"
45-
url: "/grunt/"
45+
route: grunt
4646
_blank: false
4747
- title: "Gulp"
48-
url: "/gulp/"
48+
route: gulp
4949
_blank: false
5050
- title: "Broccoli"
51-
url: "/broccoli/"
51+
route: broccoli
5252
_blank: false
5353
- title: "Extras"
5454
items:
5555
- title: "Changelog"
56-
url: "/changelog/"
56+
route: changelog
5757
_blank: false
5858
- title: "About"
59-
url: "/about/"
59+
route: about
6060
_blank: false
61-
- title: "Frequently Asked questions"
62-
url: "/frequently-asked-questions/"
61+
- title: "FAQ"
62+
route: faq
6363
_blank: false
6464
- title: "Contributing"
65-
url: "/contributing/"
65+
route: contributing
6666
_blank: false
6767
- title: "Gallery"
68-
url: "/gallery/"
68+
route: gallery
6969
_blank: false
7070
- title: "Brand guidelines"
71-
url: "/brand-guidelines/"
71+
route: branding
7272
_blank: false

_data/routes.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
home: "/"
2+
command_line: "/getting-started/"
3+
configuration: "/configuration/"
4+
annotations: "/annotations/"
5+
poster_annotations: "/file-level-annotations/"
6+
view: "/customising-the-view/"
7+
custom_theme: "/using-your-own-theme/"
8+
data_interface: "/data-interface/"
9+
extending_sassdoc: "/extending-sassdoc/"
10+
extra_tools: "/extra-tools/"
11+
theme_generator: "/theme-generator/"
12+
theme_gallery: "/theme-gallery/"
13+
node: "/node/"
14+
grunt: "/grunt/"
15+
gulp: "/gulp/"
16+
broccoli: "/broccoli/"
17+
changelog: "/changelog/"
18+
about: "/about/"
19+
faq: "/frequently-asked-questions/"
20+
contributing: "/contributing/"
21+
gallery: "/gallery/"
22+
branding: "/brand-guidelines/"

_includes/sidebar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ <h2 class="sidebar__title">{{ group.title }}</h2>
88

99
<ul class="sidebar__list">
1010
{% for item in group.items %}
11-
{% capture tmp %}{{ item.url }}index.html{% endcapture %}
11+
{% capture tmp %}{{ site.data.routes[item.route] }}index.html{% endcapture %}
1212
<li class="sidebar__list-item {% if tmp == page.url %}active{% endif %}">
13-
<a class="sidebar__link" href="{{ item.url }}" {% if item._blank %}target="_blank"{% endif %}>{{ item.title }}</a>
13+
<a class="sidebar__link" href="{{ site.data.routes[item.route] }}" {% if item._blank %}target="_blank"{% endif %}>{{ item.title }}</a>
1414
</li>
1515
{% endfor %}
1616
</ul>

annotations/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,4 +601,4 @@ Describes the documented item.
601601

602602
---
603603

604-
\* The Markdown parsing is effective in compliant themes, by using the Markdown filter from [sassdoc-extras](/extra-tools/#markdown).
604+
\* The Markdown parsing is effective in compliant themes, by using the Markdown filter from [sassdoc-extras]({{ site.data.routes.extra_tools }}#markdown).

broccoli/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ var docs = sassdoc(tree, options);
2626
Any specified option will be passed through directly to SassDoc, thus you can
2727
specify any option that SassDoc supports. Refer to:
2828

29-
* [Getting started](/getting-started/) for CLI options;
30-
* [Configuration](/configuration/) for SassDoc options;
31-
* [Customising the view](/customising-the-view/) for default theme options.
29+
* [Command Line]({{ site.data.routes.command_line }}) for CLI options;
30+
* [Configuration]({{ site.data.routes.configuration }}) for SassDoc options;
31+
* [Customising the view]({{ site.data.routes.view }}) for default theme options.
3232

3333
<p class="note note--info">
3434
<strong>Tip:</strong> provided you know what your doing and you've checked your paths before,

configuration/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ layout: default
55

66
## Introduction
77

8-
SassDoc comes with surprisingly few configuration in itself. Most of the configuration is [brought by the theme](/customising-the-view). However, you don't have to set up a configuration file in the theme package, that would be silly.
8+
SassDoc comes with surprisingly few configuration in itself. Most of the configuration is [brought by the theme]({{ site.data.routes.view }}). However, you don't have to set up a configuration file in the theme package, that would be silly.
99

1010
Here is how it works: SassDoc merge the configuration file you provide (or that is being automatically fetched) with the one from the theme. If an option is set in both files, the one you set yourself overrides the one from the theme.
1111

@@ -86,7 +86,7 @@ The `groups` option is an object of aliases for group slugs. When you gather ite
8686

8787
All non-grouped items are gathered by SassDoc in an `undefined` group, that is being aliased as *General*. Feel free to change this to suit your preferences.
8888

89-
<p class="note note--warning"><strong>Note:</strong> that for this feature to work, <a href="/extra-tools/#groups-aliases">sassdoc-extras</a> has to be used by the theme, which is obviously the case with the default theme.</p>
89+
<p class="note note--warning"><strong>Note:</strong> that for this feature to work, <a href="{{ site.data.routes.extra_tools }}#groups-aliases">sassdoc-extras</a> has to be used by the theme, which is obviously the case with the default theme.</p>
9090

9191
## No update notifier
9292

contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ There are many things you can do to contribute SassDoc:
1414

1515
## Asking a question
1616

17-
Please, do not open an issue only to ask a question; it is not the best place for this. First, make sure your question is not already answered in the documentation, especially in the [Frequently Asked Questions](/frequently-asked-questions/) section.
17+
Please, do not open an issue only to ask a question; it is not the best place for this. First, make sure your question is not already answered in the documentation, especially in the [Frequently Asked Questions]({{ site.data.routes.faq }}) section.
1818

1919
If it's not, you can leave your question on:
2020

customising-the-view/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ title: "Customising the view"
55

66
## Introduction
77

8-
Aside from regular [configuration](/configuration/) from SassDoc itself, it is likely that the theme you use provides some kind of default configuration that you can overload.
8+
Aside from regular [configuration]({{ site.data.routes.configuration }}) from SassDoc itself, it is likely that the theme you use provides some kind of default configuration that you can overload.
99

10-
This is done exactly like the regular configuration, within the same configuration file. Please refer to the [configuration documentation](/configuration/) to learn how to specify a configuration file.
10+
This is done exactly like the regular configuration, within the same configuration file. Please refer to the [configuration documentation]({{ site.data.routes.configuration }}) to learn how to specify a configuration file.
1111

1212
## Options
1313

extending-sassdoc/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ title: "Extending SassDoc"
66
## Introduction
77

88
SassDoc allows you to define custom annotations. This can only be done
9-
from a [custom theme](/using-your-own-theme/) since there is no way for
9+
from a [custom theme]({{ site.data.routes.custom_theme }}) since there is no way for
1010
SassDoc to guess what to do or how those annotations should be displayed.
1111

1212
Here's a simple example to add a few simple annotations to SassDoc
13-
within your theme. First, you'll have the usual theme function. Refer to [Using Your Own Theme](/using-your-own-theme/) for more informations about this.
13+
within your theme. First, you'll have the usual theme function. Refer to [Using Your Own Theme]({{ site.data.routes.custom_theme }}) for more informations about this.
1414

1515
{% highlight js %}
1616
module.exports = function () {
@@ -98,7 +98,5 @@ module.exports.annotations.push({
9898
});
9999
{% endhighlight %}
100100

101-
For more examples, you can look at [the core annotations] which are very
101+
For more examples, you can look at [the core annotations](https://github.com/SassDoc/sassdoc/tree/master/src/annotation/annotations) which are very
102102
insightful.
103-
104-
[the core annotations]: https://github.com/SassDoc/sassdoc/tree/master/src/annotation/annotations

extra-tools/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = function (dest, ctx) {
5555

5656
## Groups aliases
5757

58-
The `groupName` filter makes it possible for you to define aliases for your group slugs (see [reference](/configuration/#groups)). When using `@group` annotation in your SassDoc comments, you usually define a slug (a lowercase string without spaces). If you want your theme to display pretty titles, you can map those slugs to human-friendly names by setting a `groups` key in your context configuration.
58+
The `groupName` filter makes it possible for you to define aliases for your group slugs (see [reference]({{ site.data.routes.configuration }}#groups)). When using `@group` annotation in your SassDoc comments, you usually define a slug (a lowercase string without spaces). If you want your theme to display pretty titles, you can map those slugs to human-friendly names by setting a `groups` key in your context configuration.
5959

6060
{% highlight js %}
6161
{

0 commit comments

Comments
 (0)