Use intros for meta descriptions

This commit is contained in:
Rico Sta. Cruz 2017-09-22 00:59:30 +08:00
parent 219e2f9ff6
commit dc66dceaa7
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,7 @@
{%
if page.type == 'article'
if page.intro
%}{{ page.intro | markdownify | strip_html }}{%
elsif page.type == 'article'
%}A comprehensive cheatsheet for {{ page.title }}.{%
endif
%}

View File

@ -4,6 +4,8 @@ category: JavaScript libraries
layout: 2017/sheet
updated: 2017-09-01
weight: -3
intro: |
A quick overview to [Jest](https://facebook.github.io/jest/), a test framework for Node.js. This guide targets Jest v20.
---
Testing
@ -328,8 +330,9 @@ See: [.mock property](http://facebook.github.io/jest/docs/en/mock-functions.html
const fn = jest.fn(() => 'hello')
```
#### or:
```js
// or:
jest.fn().mockReturnValue('hello')
jest.fn().mockReturnValueOnce('hello')
```
@ -351,6 +354,5 @@ fn() // → 2
## References
{: .-one-column}
- Based on Jest v20.
- <http://facebook.github.io/jest/>
{: .-also-see}