Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

View GitHub Profile
@jhyland87
jhyland87 / build.js
Created December 1, 2016 16:12
layouts() BEFORE include()
// Build with layouts() BEFORE include()
const fs = require( 'fs' )
const path = require( 'path' )
// Metalsmith stuff
const Metalsmith = require( 'metalsmith' )
const markdown = require( 'metalsmith-markdownit' )
const layouts = require( 'metalsmith-layouts' )
const include = require( 'metalsmith-include')
const inplace = require( 'metalsmith-in-place' )
@jhyland87
jhyland87 / build.js
Created December 1, 2016 16:13
layouts() AFTER include()
// Build with layouts() AFTER include()
const fs = require( 'fs' )
const path = require( 'path' )
// Metalsmith stuff
const Metalsmith = require( 'metalsmith' )
const markdown = require( 'metalsmith-markdownit' )
const layouts = require( 'metalsmith-layouts' )
const include = require( 'metalsmith-include')
const inplace = require( 'metalsmith-in-place' )
@jhyland87
jhyland87 / build.js
Created December 1, 2016 16:14
layouts() BEFORE & AFTER include()
// Build with layouts() BEFORE & AFTER include()
const fs = require( 'fs' )
const path = require( 'path' )
// Metalsmith stuff
const Metalsmith = require( 'metalsmith' )
const markdown = require( 'metalsmith-markdownit' )
const layouts = require( 'metalsmith-layouts' )
const include = require( 'metalsmith-include')
const inplace = require( 'metalsmith-in-place' )
@jhyland87
jhyland87 / hello-world_and_head.pug
Created December 1, 2016 16:16
hello-world.pug and head.pug
//--------------------------------
//- File: templates/hello-world.pug
// Begin: hello-world.pug
//- I would expect this to show the rendered head.md file, including the head.pug data, but it only shows the "content" from head.md
!= head
!=contents
p (File: hello-world.pug) This page includes the content from head.md, but not the rendered data from head.pug
@jhyland87
jhyland87 / hello-world_and_head.md
Created December 1, 2016 16:18
hello-world.md and head.md

--------------------------------

File: source/hello-world.md


title: hello-world layout: hello-world.pug include: head: head

(hello-world.md) This file should show the rendered HTML data from head.pug, but it only shows the content from head.md

@jhyland87
jhyland87 / hello-world.html
Created December 1, 2016 16:22
Expected result
<!-- Begin: hello-world.pug -->
<!-- Begin: head.pug --><p>(File: <a href="http://head.md">head.md</a>) When viewing hello-world.html, you’ll see this sentence, but no rendered data from head.pug</p>
<p>(File: head.pug) This is the content that doesn't get rendered when this file is included</p>
<!-- End: head.pug -->
<!-- End: hello-world.pug -->
mixin prefixed_title(caption)
-
var headerSegments = [ webconfigs.general.title_prefix ]
if ( typeof caption === 'string' && caption.trim().length > 0 ){
headerSegments.push( caption.trim() )
}
var headerTxt = headerSegments.join( ' - ' )
!=headerTxt
//-
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
{
"codeformatter_js_options":
{
"brace_style": "collapse",
"break_chained_methods": false,
"comma_first": false,
"e4x": false,
"end_with_newline": false,
"eol": "\n",
"eval_code": false,
doctype html
html.no-js.no-touch(lang='en')
head
meta(charset='utf-8')
meta(name='viewport', content='width=device-width, initial-scale=1.0')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(name='msapplication-TileImage', content='content/live/thumbs/favicon-270x270.png')
link(rel='icon', href='content/live/thumbs/favicon-32x32.png', sizes='32x32')
link(rel='icon', href='content/live/thumbs/favicon-192x192.png', sizes='192x192')
link(rel='apple-touch-icon-precomposed', href='content/live/thumbs/favicon-180x180.png')