From 5075bde168f0bdaf6856d8c06695f42d94c37c62 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 29 Aug 2017 03:56:17 +0800 Subject: [PATCH] Set up some redirects --- Readme.md | 13 +++++++++++++ commander-js.md | 34 ++-------------------------------- commander.js.md | 35 +++++++++++++++++++++++++++++++++++ ember.md | 1 + handlebars-js.md | 34 ++-------------------------------- handlebars.js.md | 35 +++++++++++++++++++++++++++++++++++ harvey-js.md | 19 ++----------------- harvey.js.md | 20 ++++++++++++++++++++ immutable-js.md | 44 ++------------------------------------------ immutable.js.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ jade.md | 1 + 11 files changed, 158 insertions(+), 123 deletions(-) create mode 100644 commander.js.md create mode 100644 handlebars.js.md create mode 100644 harvey.js.md create mode 100644 immutable.js.md diff --git a/Readme.md b/Readme.md index a2802c19b..9a46b6def 100644 --- a/Readme.md +++ b/Readme.md @@ -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 +--- +``` diff --git a/commander-js.md b/commander-js.md index 444dba6f2..1f749c2e9 100644 --- a/commander-js.md +++ b/commander-js.md @@ -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] ') - .option('-w, --words ', 'generate words') - .option('-i, --interval ', '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); - - diff --git a/commander.js.md b/commander.js.md new file mode 100644 index 000000000..444dba6f2 --- /dev/null +++ b/commander.js.md @@ -0,0 +1,35 @@ +--- +title: Commander.js +category: JavaScript libraries +--- + +### Initialize + + var cli = require('commander'); + +### Options + + cli + .version(require('../package').version) + .usage('[options] ') + .option('-w, --words ', 'generate words') + .option('-i, --interval ', '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); + + diff --git a/ember.md b/ember.md index 5df64d941..e43677786 100644 --- a/ember.md +++ b/ember.md @@ -1,5 +1,6 @@ --- title: Ember.js +category: JavaScript libraries --- {% raw %} diff --git a/handlebars-js.md b/handlebars-js.md index 061ffe08e..73158ae79 100644 --- a/handlebars-js.md +++ b/handlebars-js.md @@ -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 "" + this.body + ""; -}) -``` - -```js -var context = { posts: [{url: "/hello-world", body: "Hello World!"}] } -var source = "
    {{#posts}}
  • {{{link_to}}}
  • {{/posts}}
" -``` - -```js -var template = Handlebars.compile(source) -template(context) -``` - -Would render: - -```html - -``` - -{% endraw %} diff --git a/handlebars.js.md b/handlebars.js.md new file mode 100644 index 000000000..061ffe08e --- /dev/null +++ b/handlebars.js.md @@ -0,0 +1,35 @@ +--- +title: Handlebars.js +category: JavaScript libraries +layout: 2017/sheet +--- + +{% raw %} + +### Helpers + +```js +Handlebars.registerHelper('link_to', function() { + return "" + this.body + ""; +}) +``` + +```js +var context = { posts: [{url: "/hello-world", body: "Hello World!"}] } +var source = "
    {{#posts}}
  • {{{link_to}}}
  • {{/posts}}
" +``` + +```js +var template = Handlebars.compile(source) +template(context) +``` + +Would render: + +```html + +``` + +{% endraw %} diff --git a/harvey-js.md b/harvey-js.md index 1cf2c36b9..c6e6df971 100644 --- a/harvey-js.md +++ b/harvey-js.md @@ -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 - diff --git a/harvey.js.md b/harvey.js.md new file mode 100644 index 000000000..1cf2c36b9 --- /dev/null +++ b/harvey.js.md @@ -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 + diff --git a/immutable-js.md b/immutable-js.md index fc19c70cf..2ae8ece7d 100644 --- a/immutable-js.md +++ b/immutable-js.md @@ -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' -``` - diff --git a/immutable.js.md b/immutable.js.md new file mode 100644 index 000000000..fc19c70cf --- /dev/null +++ b/immutable.js.md @@ -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' +``` + diff --git a/jade.md b/jade.md index 0401c6737..796fbda8f 100644 --- a/jade.md +++ b/jade.md @@ -1,5 +1,6 @@ --- title: Jade +category: JavaScript libraries --- ```