The docs()
tag is for including markdown files from the local ./docs
directory.
- old:
{%= _.doc("foo.md") %}
- new:
{%= docs("foo") %}
Note that the underscore (_.
) is gone and the .md
extension is no longer needed.
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')) | |
}); |
module.exports = function(grunt) { | |
'use strict'; | |
grunt.initConfig({ | |
assemble: { | |
options: { | |
partials: ['<%= app.templates %>/includes/*.hbs'], | |
}, | |
site: { |
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 | |
})); |
# =============================================== | |
# Verb config > https://github.com/assemble/verb | |
# =============================================== | |
username: jonschlinkert | |
data: docs/repos.json |
var fs = require('fs'); | |
var path = require('path'); | |
var cleanPath = function(filepath) { | |
filepath = path.relative(process.cwd(), filepath); | |
return filepath.replace(/\\/g, '/'); | |
}; | |
function lookupFiles(dir, recursive) { |
# 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 |
This example makes use of
strings.parser()
andstrings.process()
to dynamically generate permalinks from local file paths.
Before we get started, it's important to note that although we're going to use three different methods to accomplish our goal, .propstring()
, .parser()
, and .template()
, we can accomplish the same thing with one method: .process()
. But, the point of this tutorial is to demonstrate how to create reusable templates and parsers, and as a result you'll learn how .process()
works along the way.
Now, on to the subject of this tutorial!
var fs = require('fs'); | |
var path = require('path'); | |
var glob = require('globby'); | |
var _ = require('lodash'); | |
var pattern = 'test/fixtures/remarked_pending/**/*.{md,html}'; | |
var len = 'answer_to_life_the_universe_and_everything'.length; | |
var delim = new Array(len).join('~'); | |