# {%= name %}
> {%= description %}
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam.
## Contribute
{%= docs("contributing") %}
This file contains hidden or 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
var assemble = require('assemble'); | |
assemble.partials('templates/partials/*.hbs'); | |
assemble.layouts('templates/layouts/*.hbs'); | |
assemble.task('default', function() { | |
assemble.src('templates/*.hbs') | |
.pipe(assemble.dest('_gh_pages')) | |
}); |
This file contains hidden or 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
var file = require('fs-utils'); | |
module.exports = function(verb) { | |
verb.log.subhead('building', 'My Book'); | |
// Process templates | |
file.writeFileSync('book/', verb.read('src/*.tmpl.md', { | |
data: 'chapters/*.json' // custom metadata for templates | |
})); |
This file contains hidden or 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
var file = require('fs-utils'); | |
module.exports = function(verb) { | |
// Process templates | |
file.writeFileSync('docs/', verb.read('src/*.tmpl.md', { | |
data: 'src/*.json' // custom metadata for templates | |
})); | |
}; |
This file contains hidden or 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
{{#each (expand 'content/*.md')}} | |
{{#markdown}} | |
{{inline .}} | |
{{/markdown}} | |
{{/each}} |
This file contains hidden or 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
--- | |
headings: [1, 2, 3, 4, 5, 6] | |
--- | |
<div data-section="headings"> | |
{{#each headings}} | |
{{#withHash num=this text="Heading"}} | |
<h{{num}}>{{text}} {{num}}</h{{num}}> | |
{{/withHash}} | |
{{/each}} |
written in response to this question on Twitter, but hopefully this is helpful to someone, somewhere, in some small way.
Rather than cover what a function is and how it works, this example dives right into examples to illustrate the basics. If you need to do some research first, just remember: StackOverflow and Google are your best friends. Just take your time, and whenever you're ready this example will be right here waiting for you!
Let's get started!
Remember algrebra, as in 3 * x = 6
? Let's create a function that is capable of calculating a known value, 3
against an unknown value, x
:
This file contains hidden or 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
# I'm only using a few fields here to demonstrate how this works | |
# Site theme | |
theme: slides | |
# Assets | |
# The assets path is based on the theme, | |
# the other paths can build on the assets path | |
assets: assets/<%= site.theme %> | |
images: <%= site.assets %>/images |