Skip to content

Instantly share code, notes, and snippets.

View doowb's full-sized avatar
:octocat:
Creating something awesome!

Brian Woodward doowb

:octocat:
Creating something awesome!
View GitHub Profile
/node_modules
/node_modules/.bin
/node_modules/assemble
/node_modules/assemble-contrib-anchors
/node_modules/assemble-contrib-decompress
/node_modules/assemble-contrib-download
/node_modules/assemble-contrib-permalinks
/node_modules/assemble-less
/node_modules/chalk
/node_modules/cheerio
<%= foo %>
<%= foo.bar %>
<%= foo.bar.baz %>
<%= foo() %>
<%= foo.bar() %>
<%= _.foo() %>
<%= _.foo(bar) %>
<%= _.foo("baz") %>
@doowb
doowb / Gruntfile.js
Created January 17, 2014 02:54
Generating assemble targets.
var _ = require('lodash');
module.exports = function(grunt) {
var config = grunt.file.readJSON('path/to/blog/config.json');
grunt.initConfig({
config: config,
@doowb
doowb / assemble-content-changer.js
Created October 31, 2013 17:47
Assemble plugin to modify page contents.
var options = {
stage: 'assemble:post:pages'
};
var plugin = function(params, next) {
var buildPaginationInfo = function() {
var pages = params.assemble.options.pages;
# Usage: {{ include [partial] }}
module.exports.include = include = (template, options) ->
partial = Handlebars.partials[template]
if (typeof partial is "string")
partial = Handlebars.compile(partial)
Handlebars.partials[template] = partial
return Utils.safeString('Partial **' + template + '** not found.') unless partial
context = _.extend({}, this, options.hash)
Utils.safeString partial(context)
assembleOptions = options #this is assuming these helpers are in the register function that takes in an options object from assemble
minimatch = require 'minimatch'
matchPartials = (src, search) ->
files = grunt.files.expand src
partials = files.filter(minimatch.filter(search))
partials
@doowb
doowb / Gruntfile.js
Created June 23, 2013 18:48
Example of setting up grunt-github-api to get all public assemble repos.
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
// Project metadata
{
"articles": [
{
"title": "Article 1",
"#comments": [
{"subject": "sweet article 1", "body": "that's a really sweet first article" },
{"subject": "re: sweet article 1", "body": "I total agree" }
]
},
{
var helperList = ['a', 'b', 'c', 'd', 'e'];
var documentedList = ['a', 'c'];
var undocumentedList = [];
helperList.forEach(function(helper) {
if(_.contains(documentedList, helper) === false) {
undocumentedList.push(helper);
}
});