Skip to content

Fixed broken links, fixed broken anchors, removed duplicate main.css, fixed newline issue with site's description, fixed guide layout, and fixed slug in the guide's sidebar #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: Chai
description: |
description: >
Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the
browser that can be delightfully paired with any javascript testing framework.
baseurl: ""
Expand Down Expand Up @@ -34,14 +34,6 @@ defaults:
path: ""
values:
layout: default
-
scope:
path: guide
type: guides
values:
layout: guide
bodyClass: guide
weight: 0
-
scope:
path: api
Expand All @@ -53,7 +45,6 @@ collections:
guides:
output: true
permalink: /guide/:path/
bodyClass: guide

featuredplugin:
name: chai-webdriver
Expand Down
13 changes: 8 additions & 5 deletions _guides/helpers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Building a Helper
layout: guide
bodyClass: guide
weight: 0
order: 40
headings:
- Adding Language Chains
Expand Down Expand Up @@ -110,7 +113,7 @@ utils.addProperty(Assertion.prototype, 'model', function () {
});
```

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

Simple and concise. Chai can take it from here. It is also worth mentioning that
because this extension pattern is used so often, Chai makes it just a bit easier.
Expand Down Expand Up @@ -154,7 +157,7 @@ Assertion.addMethod('model', function (type) {
});
```

<a href="/api/plugins/#addMethod-section" class="clean-button">View addMethod API</a>
<a href="{{site.github.url}}/api/plugins/#method_addmethod" class="clean-button">View addMethod API</a>

All calls to `assert` are synchronous, so if the first one fails the `AssertionError`
is thrown and the second one will not be reached. It is up to the test runner to interpret
Expand Down Expand Up @@ -268,7 +271,7 @@ finish up here first...
Assertion.addChainableMethod('age', assertModelAge, chainModelAge);
```

<a href="/api/plugins/#addChainableMethod-section" class="clean-button">View addChainableMethod API</a>
<a href="{{site.github.url}}/api/plugins/#method_addchainablemethod" class="clean-button">View addChainableMethod API</a>

Done. Now we can assert Arthur's exact age. We will pick up again with this example when learning how to overwrite methods.

Expand Down Expand Up @@ -308,7 +311,7 @@ chai.overwriteProperty('ok', function (_super) {
});
```

<a href="/api/plugins/#overwriteProperty-section" class="clean-button">View overwriteProperty API</a>
<a href="{{site.github.url}}/api/plugins/#method_overwriteproperty" class="clean-button">View overwriteProperty API</a>

##### Overwrite Structure

Expand Down Expand Up @@ -426,7 +429,7 @@ Assertion.overwriteMethod('above', function (_super) {
});
```

<a href="/api/plugins/#overwriteMethod-section" class="clean-button">View overwriteMethod API</a>
<a href="{{site.github.url}}/api/plugins/#method_overwritemethod" class="clean-button">View overwriteMethod API</a>

This covers both positive and negative scenarios. No need to transfer flags in this
case as `this.assert` handles that automatically. The same pattern can also be used
Expand Down
11 changes: 7 additions & 4 deletions _guides/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Getting Started Guide
layout: guide
bodyClass: guide
weight: 0
permalink: /guide/
order: 1
---
Expand All @@ -12,8 +15,8 @@ assertion styles.

## The Basics

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

## Making Plugins

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

- [Core Plugin Concepts](/guide/plugins/) covers the basics of using the Chai Plugin API.
- [Building a Helper](/guide/helpers/) is a walkthrough for writing your first plugin.
- [Core Plugin Concepts]({{site.github.url}}/guide/plugins/) covers the basics of using the Chai Plugin API.
- [Building a Helper]({{site.github.url}}/guide/helpers/) is a walkthrough for writing your first plugin.
3 changes: 3 additions & 0 deletions _guides/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Installation
layout: guide
bodyClass: guide
weight: 0
order: 10
headings:
- Node.js
Expand Down
3 changes: 3 additions & 0 deletions _guides/plugins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Core Plugin Concepts
layout: guide
bodyClass: guide
weight: 0
order: 30
headings:
- Accessing Utilities
Expand Down
3 changes: 3 additions & 0 deletions _guides/resources.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Resources
layout: guide
bodyClass: guide
weight: 0
order: 50
headings:
- Getting Help
Expand Down
7 changes: 5 additions & 2 deletions _guides/styles.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Assertion Styles
layout: guide
bodyClass: guide
weight: 0
order: 20
headings:
- Assert
Expand All @@ -17,7 +20,7 @@ This section of the guide introduces you to the three different assertion styles

## Assert

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

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

## BDD

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

The BDD style comes in two flavors: `expect` and `should`. Both use the same
chainable language to construct assertions, but they differ in the way an
Expand Down
2 changes: 1 addition & 1 deletion _includes/banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2>
<div class="command dsp-left">
$ npm install chai
</div>
<a href="{{site.github.url}}/guide/installation/#node" class="button dsp-right">
<a href="{{site.github.url}}/guide/installation/#nodejs" class="button dsp-right">
View Node Guide
</a>
</div>
Expand Down
1 change: 0 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | markdownify | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">

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

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
Expand Down
3 changes: 1 addition & 2 deletions _layouts/guide.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
layout: default
bodyClass: guide
---

<nav id="guide" class="sidebar sticky">
Expand All @@ -23,7 +22,7 @@
{% if guide.headings %}
<div id="{{ slug }}" class="subitems">
{% for heading in guide.headings %}
{% assign headingSlug = heading | slugify %}
{% assign headingSlug = heading | slugify: 'pretty' | remove: '.' %}
<a href="#{{ headingSlug }}" class="item secondary group-{{ slug }}{{ expanded }}">{{ heading }}</a>
{% endfor %}
</div>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ <h3 class="fancy">Featured Plugin</h3>
<div class="wrap">
<h3 class="fancy">Custom Plugins</h3>
<p>Browse our growing directory of custom plugins &amp; vendor integrations to find the best tool for your needs.</p>
<div class="more-wrap"><a href="/plugins" class="more">Browse Plugins<span class="arrow">&rarr;</span></a></div>
<div class="more-wrap"><a href="{{site.github.url}}/plugins" class="more">Browse Plugins<span class="arrow">&rarr;</span></a></div>
</div>
</article>
<article id="plugin-guide" class="grid_3 plugin-box contrast"><span class="img">
<div class="icon"></div></span>
<div class="wrap">
<h3 class="fancy">Develop Plugins</h3>
<p>Chai has an extensive utility belt for plugin developers. Learn how to build your plugins &amp; share.</p>
<div class="more-wrap"><a href="/guide/plugins" class="more">Plugin Guide<span class="arrow">&rarr;</span></a></div>
<div class="more-wrap"><a href="{{site.github.url}}/guide/plugins" class="more">Plugin Guide<span class="arrow">&rarr;</span></a></div>
</div>
</article>
</div>
Expand Down