Set up some redirects

This commit is contained in:
Rico Sta. Cruz 2017-08-29 03:56:17 +08:00
parent 5ec0d107b0
commit 5075bde168
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
11 changed files with 158 additions and 123 deletions

View File

@ -41,3 +41,16 @@ ads: false # Add this to disable ads
updated: 201708 # To show in the updated list (update _config.yml)
---
```
## Setting up redirects
This example sets up a redirect from `es2015` to `es6`:
```yml
# /es2015.md
---
title: ES2015
category: Hidden
redirect_to: /es6
---
```

View File

@ -1,35 +1,5 @@
---
title: Commander.js
category: JavaScript libraries
category: Hidden
redirect_to: /commander.js
---
### Initialize
var cli = require('commander');
### Options
cli
.version(require('../package').version)
.usage('[options] <command>')
.option('-w, --words <n>', 'generate <n> words')
.option('-i, --interval <n>', 'interval [1000]', 1000)
.option('-s, --symbols', 'include symbols')
.parse(process.argv);
### Help
.on('--help', function() {
console.log('');
})
### Commands
cli.outputHelp();
cli.args == ["hello"];
### Other useful things
process.exit(0);

35
commander.js.md Normal file
View File

@ -0,0 +1,35 @@
---
title: Commander.js
category: JavaScript libraries
---
### Initialize
var cli = require('commander');
### Options
cli
.version(require('../package').version)
.usage('[options] <command>')
.option('-w, --words <n>', 'generate <n> words')
.option('-i, --interval <n>', 'interval [1000]', 1000)
.option('-s, --symbols', 'include symbols')
.parse(process.argv);
### Help
.on('--help', function() {
console.log('');
})
### Commands
cli.outputHelp();
cli.args == ["hello"];
### Other useful things
process.exit(0);

View File

@ -1,5 +1,6 @@
---
title: Ember.js
category: JavaScript libraries
---
{% raw %}

View File

@ -1,35 +1,5 @@
---
title: Handlebars.js
category: JavaScript libraries
layout: 2017/sheet
category: Hidden
redirect_to: /handlebars.js
---
{% raw %}
### Helpers
```js
Handlebars.registerHelper('link_to', function() {
return "<a href='" + this.url + "'>" + this.body + "</a>";
})
```
```js
var context = { posts: [{url: "/hello-world", body: "Hello World!"}] }
var source = "<ul>{{#posts}}<li>{{{link_to}}}</li>{{/posts}}</ul>"
```
```js
var template = Handlebars.compile(source)
template(context)
```
Would render:
```html
<ul>
<li><a href='/hello-world'>Hello World!</a></li>
</ul>
```
{% endraw %}

35
handlebars.js.md Normal file
View File

@ -0,0 +1,35 @@
---
title: Handlebars.js
category: JavaScript libraries
layout: 2017/sheet
---
{% raw %}
### Helpers
```js
Handlebars.registerHelper('link_to', function() {
return "<a href='" + this.url + "'>" + this.body + "</a>";
})
```
```js
var context = { posts: [{url: "/hello-world", body: "Hello World!"}] }
var source = "<ul>{{#posts}}<li>{{{link_to}}}</li>{{/posts}}</ul>"
```
```js
var template = Handlebars.compile(source)
template(context)
```
Would render:
```html
<ul>
<li><a href='/hello-world'>Hello World!</a></li>
</ul>
```
{% endraw %}

View File

@ -1,20 +1,5 @@
---
title: Harvey.js
category: JavaScript libraries
category: hidden
redirect_to: /harvey.js
---
### Usage
Harvey.attach('(min-width: 600px)', {
setup: function () {
},
on: function () {
},
off: function () {
}
})
### References
* http://harvesthq.github.io/harvey/harvey.js

20
harvey.js.md Normal file
View File

@ -0,0 +1,20 @@
---
title: Harvey.js
category: JavaScript libraries
---
### Usage
Harvey.attach('(min-width: 600px)', {
setup: function () {
},
on: function () {
},
off: function () {
}
})
### References
* http://harvesthq.github.io/harvey/harvey.js

View File

@ -1,45 +1,5 @@
---
title: Immutable.js
category: JavaScript libraries
layout: default-ad
category: Hidden
redirect_to: /immutable.js
---
```js
var Immutable = require('immutable')
```
## Maps
```js
var map = Immutable.Map({ a: 1, b: 2, c: 3 })
map
.set('b', 50)
.get('b') // 50
```
## Lists
```js
var list = Immutable.List.of(1, 2)
list
.push(3, 4, 5)
.unshift(0)
.concat(list2, list3)
.get(0)
.size
```
## Nested maps
```js
var nested = Immutable.fromJS({ user: { profile: { name: 'John' } } })
nested
.mergeDeep({ user: { profile: { age: 90 } } })
.setIn([ 'user', 'profile', 'name' ], 'Jack')
.updateIn([ 'user', 'profile', 'name' ], (s) => s.toUpperCase())
.getIn(['user', 'profile', 'name']) // 'JACK'
```

45
immutable.js.md Normal file
View File

@ -0,0 +1,45 @@
---
title: Immutable.js
category: JavaScript libraries
layout: default-ad
---
```js
var Immutable = require('immutable')
```
## Maps
```js
var map = Immutable.Map({ a: 1, b: 2, c: 3 })
map
.set('b', 50)
.get('b') // 50
```
## Lists
```js
var list = Immutable.List.of(1, 2)
list
.push(3, 4, 5)
.unshift(0)
.concat(list2, list3)
.get(0)
.size
```
## Nested maps
```js
var nested = Immutable.fromJS({ user: { profile: { name: 'John' } } })
nested
.mergeDeep({ user: { profile: { age: 90 } } })
.setIn([ 'user', 'profile', 'name' ], 'Jack')
.updateIn([ 'user', 'profile', 'name' ], (s) => s.toUpperCase())
.getIn(['user', 'profile', 'name']) // 'JACK'
```

View File

@ -1,5 +1,6 @@
---
title: Jade
category: JavaScript libraries
---
```