Skip to content

Commit 89f0377

Browse files
aaronsofalykeithamus
authored andcommitted
fixed: broken links, anchors, removed duplicate main.css, fixed newline issue with site's description, fixed guide layout, and fixed slug in the guide's sidebar (#135)
* fixed broken links * fixed broken anchors * removed duplicate main.css * fixed newline issue with the site's description * updated layout, body class, and weight for the guide pages * fixed guide sidebar slug issue
1 parent b8fac73 commit 89f0377

File tree

11 files changed

+34
-27
lines changed

11 files changed

+34
-27
lines changed

_config.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
title: Chai
2-
description: |
2+
description: >
33
Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the
44
browser that can be delightfully paired with any javascript testing framework.
55
baseurl: ""
@@ -34,14 +34,6 @@ defaults:
3434
path: ""
3535
values:
3636
layout: default
37-
-
38-
scope:
39-
path: guide
40-
type: guides
41-
values:
42-
layout: guide
43-
bodyClass: guide
44-
weight: 0
4537
-
4638
scope:
4739
path: api
@@ -53,7 +45,6 @@ collections:
5345
guides:
5446
output: true
5547
permalink: /guide/:path/
56-
bodyClass: guide
5748

5849
featuredplugin:
5950
name: chai-webdriver

_guides/helpers.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: Building a Helper
3+
layout: guide
4+
bodyClass: guide
5+
weight: 0
36
order: 40
47
headings:
58
- Adding Language Chains
@@ -110,7 +113,7 @@ utils.addProperty(Assertion.prototype, 'model', function () {
110113
});
111114
```
112115

113-
<a href="/api/plugins/#addProperty-section" class="clean-button">View addProperty API</a>
116+
<a href="{{site.github.url}}/api/plugins/#method_addproperty" class="clean-button">View addProperty API</a>
114117

115118
Simple and concise. Chai can take it from here. It is also worth mentioning that
116119
because this extension pattern is used so often, Chai makes it just a bit easier.
@@ -154,7 +157,7 @@ Assertion.addMethod('model', function (type) {
154157
});
155158
```
156159
157-
<a href="/api/plugins/#addMethod-section" class="clean-button">View addMethod API</a>
160+
<a href="{{site.github.url}}/api/plugins/#method_addmethod" class="clean-button">View addMethod API</a>
158161
159162
All calls to `assert` are synchronous, so if the first one fails the `AssertionError`
160163
is thrown and the second one will not be reached. It is up to the test runner to interpret
@@ -268,7 +271,7 @@ finish up here first...
268271
Assertion.addChainableMethod('age', assertModelAge, chainModelAge);
269272
```
270273
271-
<a href="/api/plugins/#addChainableMethod-section" class="clean-button">View addChainableMethod API</a>
274+
<a href="{{site.github.url}}/api/plugins/#method_addchainablemethod" class="clean-button">View addChainableMethod API</a>
272275
273276
Done. Now we can assert Arthur's exact age. We will pick up again with this example when learning how to overwrite methods.
274277
@@ -308,7 +311,7 @@ chai.overwriteProperty('ok', function (_super) {
308311
});
309312
```
310313
311-
<a href="/api/plugins/#overwriteProperty-section" class="clean-button">View overwriteProperty API</a>
314+
<a href="{{site.github.url}}/api/plugins/#method_overwriteproperty" class="clean-button">View overwriteProperty API</a>
312315
313316
##### Overwrite Structure
314317
@@ -426,7 +429,7 @@ Assertion.overwriteMethod('above', function (_super) {
426429
});
427430
```
428431
429-
<a href="/api/plugins/#overwriteMethod-section" class="clean-button">View overwriteMethod API</a>
432+
<a href="{{site.github.url}}/api/plugins/#method_overwritemethod" class="clean-button">View overwriteMethod API</a>
430433
431434
This covers both positive and negative scenarios. No need to transfer flags in this
432435
case as `this.assert` handles that automatically. The same pattern can also be used

_guides/index.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: Getting Started Guide
3+
layout: guide
4+
bodyClass: guide
5+
weight: 0
36
permalink: /guide/
47
order: 1
58
---
@@ -12,8 +15,8 @@ assertion styles.
1215

1316
## The Basics
1417

15-
- [Install Chai](/guide/installation/) in node, the browser, and other environments.
16-
- [Learn about styles](/guide/styles/) that you can use to define assertions.
18+
- [Install Chai]({{site.github.url}}/guide/installation/) in node, the browser, and other environments.
19+
- [Learn about styles]({{site.github.url}}/guide/styles/) that you can use to define assertions.
1720

1821
## Making Plugins
1922

@@ -23,5 +26,5 @@ than what is included, limited only by what you want to achieve. The Plugin API
2326
is also intended as a way to simplify testing by providing users a way to
2427
encapsulate common assertions for repeat use.
2528

26-
- [Core Plugin Concepts](/guide/plugins/) covers the basics of using the Chai Plugin API.
27-
- [Building a Helper](/guide/helpers/) is a walkthrough for writing your first plugin.
29+
- [Core Plugin Concepts]({{site.github.url}}/guide/plugins/) covers the basics of using the Chai Plugin API.
30+
- [Building a Helper]({{site.github.url}}/guide/helpers/) is a walkthrough for writing your first plugin.

_guides/installation.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: Installation
3+
layout: guide
4+
bodyClass: guide
5+
weight: 0
36
order: 10
47
headings:
58
- Node.js

_guides/plugins.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: Core Plugin Concepts
3+
layout: guide
4+
bodyClass: guide
5+
weight: 0
36
order: 30
47
headings:
58
- Accessing Utilities

_guides/resources.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: Resources
3+
layout: guide
4+
bodyClass: guide
5+
weight: 0
36
order: 50
47
headings:
58
- Getting Help

_guides/styles.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: Assertion Styles
3+
layout: guide
4+
bodyClass: guide
5+
weight: 0
36
order: 20
47
headings:
58
- Assert
@@ -17,7 +20,7 @@ This section of the guide introduces you to the three different assertion styles
1720

1821
## Assert
1922

20-
<a href="/api/assert" class="clean-button">View full Assert API</a>
23+
<a href="{{site.github.url}}/api/assert" class="clean-button">View full Assert API</a>
2124

2225
The assert style is exposed through `assert` interface. This provides
2326
the classic assert-dot notation, similar to that packaged with
@@ -43,7 +46,7 @@ error messages should your assertion not pass.
4346

4447
## BDD
4548

46-
<a href="/api/bdd" class="clean-button">View full BDD API</a>
49+
<a href="{{site.github.url}}/api/bdd" class="clean-button">View full BDD API</a>
4750

4851
The BDD style comes in two flavors: `expect` and `should`. Both use the same
4952
chainable language to construct assertions, but they differ in the way an

_includes/banner.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h2>
2727
<div class="command dsp-left">
2828
$ npm install chai
2929
</div>
30-
<a href="{{site.github.url}}/guide/installation/#node" class="button dsp-right">
30+
<a href="{{site.github.url}}/guide/installation/#nodejs" class="button dsp-right">
3131
View Node Guide
3232
</a>
3333
</div>

_includes/head.html

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | markdownify | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
88

99
<link rel='icon' type='image/x-icon' href="{{site.github.url}}/img/favicon.ico">
10-
<link rel="stylesheet" href="{{site.github.url}}/css/main.css">
1110
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.github.url | prepend: site.url }}">
1211

1312
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

_layouts/guide.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
layout: default
3-
bodyClass: guide
43
---
54

65
<nav id="guide" class="sidebar sticky">
@@ -23,7 +22,7 @@
2322
{% if guide.headings %}
2423
<div id="{{ slug }}" class="subitems">
2524
{% for heading in guide.headings %}
26-
{% assign headingSlug = heading | slugify %}
25+
{% assign headingSlug = heading | slugify: 'pretty' | remove: '.' %}
2726
<a href="#{{ headingSlug }}" class="item secondary group-{{ slug }}{{ expanded }}">{{ heading }}</a>
2827
{% endfor %}
2928
</div>

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ <h3 class="fancy">Featured Plugin</h3>
113113
<div class="wrap">
114114
<h3 class="fancy">Custom Plugins</h3>
115115
<p>Browse our growing directory of custom plugins &amp; vendor integrations to find the best tool for your needs.</p>
116-
<div class="more-wrap"><a href="/plugins" class="more">Browse Plugins<span class="arrow">&rarr;</span></a></div>
116+
<div class="more-wrap"><a href="{{site.github.url}}/plugins" class="more">Browse Plugins<span class="arrow">&rarr;</span></a></div>
117117
</div>
118118
</article>
119119
<article id="plugin-guide" class="grid_3 plugin-box contrast"><span class="img">
120120
<div class="icon"></div></span>
121121
<div class="wrap">
122122
<h3 class="fancy">Develop Plugins</h3>
123123
<p>Chai has an extensive utility belt for plugin developers. Learn how to build your plugins &amp; share.</p>
124-
<div class="more-wrap"><a href="/guide/plugins" class="more">Plugin Guide<span class="arrow">&rarr;</span></a></div>
124+
<div class="more-wrap"><a href="{{site.github.url}}/guide/plugins" class="more">Plugin Guide<span class="arrow">&rarr;</span></a></div>
125125
</div>
126126
</article>
127127
</div>

0 commit comments

Comments
 (0)