-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e9518fe
Showing
20 changed files
with
395 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
temp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"node": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- '0.10' | ||
before_install: | ||
- currentfolder=${PWD##*/} | ||
- if [ "$currentfolder" != 'generator-metalsmith' ]; then cd .. && eval "mv $currentfolder generator-metalsmith" && cd generator-metalsmith; fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# generator-metalsmith [![Build Status](https://secure.travis-ci.org/hariadi/generator-metalsmith.png?branch=master)](https://travis-ci.org/hariadi/generator-metalsmith) | ||
|
||
> [Yeoman](http://yeoman.io) generator for [Metalsmith](http://metalsmith.io) | ||
|
||
## Getting Started | ||
|
||
### What is Yeoman? | ||
|
||
Trick question. It's not a thing. It's this guy: | ||
|
||
![](http://i.imgur.com/JHaAlBJ.png) | ||
|
||
Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create. | ||
|
||
Not every new computer comes with a Yeoman pre-installed. He lives in the [npm](https://npmjs.org) package repository. You only have to ask for him once, then he packs up and moves into your hard drive. *Make sure you clean up, he likes new and shiny things.* | ||
|
||
``` | ||
$ npm install -g yo | ||
``` | ||
|
||
### Yeoman Generators | ||
|
||
Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension. | ||
|
||
To install generator-metalsmith from npm, run: | ||
|
||
``` | ||
$ npm install -g generator-metalsmith | ||
``` | ||
|
||
Finally, initiate the generator: | ||
|
||
``` | ||
$ yo metalsmith | ||
``` | ||
|
||
### Getting To Know Yeoman | ||
|
||
Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. | ||
|
||
If you'd like to get to know Yeoman better and meet some of his friends, [Grunt](http://gruntjs.com) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started). | ||
|
||
|
||
## License | ||
|
||
Copyright (c) 2014, Hariadi Hinta | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Example: | ||
yo metalsmith | ||
yo metalsmith [--skip-install] [--skip-welcome-message] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
'use strict'; | ||
|
||
var yeoman = require('yeoman-generator'); | ||
var chalk = require('chalk'); | ||
|
||
var MetalsmithGenerator = yeoman.generators.Base.extend({ | ||
|
||
init: function () { | ||
this.pkg = require('../package.json'); | ||
|
||
this.on('end', function () { | ||
this.installDependencies({ | ||
skipInstall: this.options['skip-install'] || this.options['s'], | ||
callback: function () { | ||
this.spawnCommand('make', ['build']); | ||
}.bind(this) | ||
}); | ||
}); | ||
|
||
}, | ||
|
||
askFor: function () { | ||
var done = this.async(); | ||
|
||
if (!this.options['skip-welcome-message'] || !this.options['w']) { | ||
this.log(this.yeoman); | ||
} | ||
|
||
this.log(chalk.magenta('You\'re using the fantastic Metalsmith generator.')); | ||
|
||
/* | ||
TODO: | ||
1. build type | ||
2. metalsmith-templates engine | ||
*/ | ||
|
||
var prompts = [{ | ||
type : 'input', | ||
name : 'msTitle', | ||
message : 'Site Title', | ||
default : this.appname | ||
}, { | ||
type : 'input', | ||
name : 'msDesc', | ||
message : 'Site Description', | ||
default : 'My Metalsmith-Powered Site' | ||
}, { | ||
type : "input", | ||
name : "msAuthor", | ||
message : "Author name", | ||
default : this.user.git.username || 'Metal Smith' | ||
}, { | ||
type : "input", | ||
name : "msGithubUser", | ||
message : "Would you mind telling me your username on Github?", | ||
default : process.env.username || 'metalsmith' | ||
}]; | ||
|
||
this.prompt(prompts, function (answers) { | ||
|
||
for (var key in answers) { | ||
if (answers.hasOwnProperty(key)) { | ||
this[key] = answers[key]; | ||
} | ||
} | ||
|
||
done(); | ||
}.bind(this)); | ||
}, | ||
|
||
site: function () { | ||
this.mkdir('_site'); | ||
}, | ||
|
||
layouts: function () { | ||
this.mkdir('_layouts'); | ||
this.directory('_layouts', '_layouts'); | ||
}, | ||
|
||
posts: function () { | ||
this.mkdir('_posts'); | ||
this.directory('_posts', '_posts'); | ||
}, | ||
|
||
gitfiles: function () { | ||
this.copy('gitignore', '.gitignore'); | ||
}, | ||
|
||
app: function () { | ||
this.copy('_package.json', 'package.json'); | ||
this.copy('_metalsmith.json', 'metalsmith.json'); | ||
this.copy('Makefile', 'Makefile'); | ||
this.copy('README.md', 'README.md'); | ||
}, | ||
|
||
}); | ||
|
||
module.exports = MetalsmithGenerator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
build: node_modules | ||
node_modules/.bin/metalsmith | ||
|
||
node_modules: package.json | ||
npm install | ||
|
||
.PHONY: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# <%= _.capitalize(msTitle) %> | ||
|
||
> <%= _.capitalize(msDesc) %>. | ||
This boilerplate static site uses Metalsmith to emulate a Jekyll static site. To test it out yourself just run: | ||
|
||
$ make | ||
|
||
## Release History | ||
* <%= (new Date).toISOString().split('T')[0] %> v0.1.0 Generated by the [Yeoman Generator](https://github.com/hariadi/generator-metalsmith) for [Metalsmith](http://metalsmith.io/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<html> | ||
<head> | ||
<title><%= _.capitalize(msTitle) %></title> | ||
</head> | ||
<body> | ||
<h1>{{ title }}</h1> | ||
<time>{{ date | date('Y-m-d') }}</time> | ||
{{ contents | safe }} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"source": "./_posts", | ||
"destination": "./_site", | ||
"metadata": { | ||
"title": "<%= _.capitalize(msTitle) %>", | ||
"description": "<%= msDesc %>" | ||
}, | ||
"plugins": { | ||
"metalsmith-drafts": {}, | ||
"metalsmith-markdown": {}, | ||
"metalsmith-permalinks": { | ||
"pattern": ":title" | ||
}, | ||
"metalsmith-templates": { | ||
"engine": "swig", | ||
"directory": "_layouts" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "<%= _.slugify(msTitle) %>", | ||
"version": "0.1.0", | ||
"description": "<%= msDesc %>", | ||
"author": { | ||
"name": "<%= msAuthor %>", | ||
"url": "https://github.com/<%= msGithubUser %>" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/<%= msGithubUser %>/<%= _.slugify(msTitle) %>" | ||
}, | ||
"dependencies": { | ||
"metalsmith-drafts": "0.0.1", | ||
"metalsmith-templates": "^0.1.0", | ||
"metalsmith-markdown": "^0.2.1", | ||
"metalsmith-permalinks": "^0.1.0", | ||
"swig": "^1.3.2", | ||
"metalsmith": "^0.2.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: First Post | ||
date: 2012-08-20 | ||
template: post.html | ||
--- | ||
|
||
An interesting post about how it's going to be different this time around. I'm going write a lot more nowadays and use this blog to improve my writing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Second Post | ||
date: 2012-08-23 | ||
template: post.html | ||
--- | ||
|
||
A super-interesting piece of prose I had already written weeks ago. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Third Post | ||
date: 2012-09-28 | ||
template: post.html | ||
--- | ||
|
||
A slightly late, less interesting piece of prose. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Fourth Post | ||
date: 2012-12-07 | ||
template: post.html | ||
--- | ||
|
||
A really short, rushed-feeling string of words. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "generator-metalsmith", | ||
"version": "0.1.0", | ||
"homepage": "https://github.com/hariadi/generator-metalsmith", | ||
"description": "Yeoman generator for Metalsmith", | ||
"author": { | ||
"name": "Hariadi Hinta", | ||
"url": "https://github.com/hariadi" | ||
}, | ||
"license": "ISC", | ||
"main": "app/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/hariadi/generator-metalsmith.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/hariadi/generator-metalsmith/issues" | ||
}, | ||
|
||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha --reporter spec" | ||
}, | ||
"files": [ | ||
"app" | ||
], | ||
"dependencies": { | ||
"yeoman-generator": "~0.16.0", | ||
"chalk": "~0.4.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
}, | ||
"peerDependencies": { | ||
"yo": ">=1.0.0" | ||
}, | ||
"keywords": [ | ||
"yeoman-generator", | ||
"metalsmith", | ||
"generator", | ||
"static", | ||
"site" | ||
] | ||
} |
Oops, something went wrong.