Skip to content

Instantly share code, notes, and snippets.

Trying to stay in the right branch of the wave function.

Jon Schlinkert jonschlinkert

Trying to stay in the right branch of the wave function.
View GitHub Profile
jonschlinkert / assemblefile.js
Last active Aug 29, 2015
Everything you need to build a complete project with Assemble v0.6.0
View assemblefile.js
var assemble = require('assemble');
assemble.task('default', function() {
View Assemble-Gruntfile.js
module.exports = function(grunt) {
'use strict';
assemble: {
options: {
partials: ['<%= app.templates %>/includes/*.hbs'],
site: {
View default.hbs
<!-- this is a layout -->
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
{{> body }}
{{> styles }}
jonschlinkert / verbfile-with-logging.js
Last active Aug 29, 2015
This verbfile adds some basic logging and changes the dest directory to `book/`. (if you don't use a verbfile, verb-cli will just process templates in the `docs` directory by default.)
View verbfile-with-logging.js
var file = require('fs-utils');
module.exports = function(verb) {
verb.log.subhead('building', 'My Book');
// Process templates
file.writeFileSync('book/','src/*', {
data: 'chapters/*.json' // custom metadata for templates
jonschlinkert / .verbrc.yml
Created Mar 21, 2014
Runtime config file for Verb.
View .verbrc.yml
# ===============================================
# Verb config >
# ===============================================
username: jonschlinkert
data: docs/repos.json
View filter-paths.js
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) {
jonschlinkert /
Last active Aug 29, 2015
WIP, I'll add to this conversion guide as I think of things.

Tags that needs to be converted

_.doc() changed to docs()

The docs() tag is for including markdown files from the local ./docs directory.

  • old: {%= _.doc("") %}
  • new: {%= docs("foo") %}

Note that the underscore (_.) is gone and the .md extension is no longer needed.

jonschlinkert / .assemblerc.yml
Last active Aug 29, 2015
Create a theme with Assemble
View .assemblerc.yml
# 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
View fixtures.js
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('~');