Skip to content

Instantly share code, notes, and snippets.

View artibella's full-sized avatar

Richard Bausek artibella

View GitHub Profile
@artibella
artibella / app.js
Created January 19, 2017 20:06
Use Fractal as a custom Express view engine
// example Express server using the custom Fractal view engine
const express = require('express');
const path = require('path');
const appRoot = path.normalize(path.join(__dirname, '..'));
const app = express();
const fractalEngine = require(path.join(appRoot, 'lib/fractal-engine'));
const loadComponents = require(path.join(appRoot, 'middleware/load-components'));
// register custom Fractal rendering engine
app.engine('fractal', fractalEngine);
@artibella
artibella / _snippet.haml
Created June 1, 2015 07:58
Middleman code snippet partial for Haml
- code ||= ''
%pre
%code.language-markup
= preserve do
:escaped
#{code}