handlebars-helper-compose
Version:
{{compose}} handlebars helper. Inlines content from multiple files optionally using wildcard (globbing/minimatch) patterns, extracts YAML front matter to pass to context for each file. Accepts compare function as 3rd parameter for sorting inlined files. Good for blog posts, chapters, etc.
77 lines (69 loc) • 2.61 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Compose. Options hash cwd</title>
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container bs-docs-container">
<!-- post -->
<article class="post">
<h1>My Brilliant Blog</h1>
<h2>Post title: Alpha post</h2>
<!-- Content -->
<p class="content">This is the Alpha post, which should be inserted in the composed result.
</p>
<div class="alert alert-success">
<strong>Well done!</strong> You successfully read this important alert message. You successfully read
<a href="#" class="alert-link">this important alert message</a>.
</div>
<!-- Tags -->
<ul class="tags">
<li>happy</li>
<li>gregarious</li>
<li>sad</li>
</ul>
</article>
<article class="post">
<h1>My Brilliant Blog</h1>
<h2>Post title: Beta post</h2>
<!-- Content -->
<p class="content">This is the Beta post, which should be inserted in the composed result.
</p>
<div class="alert alert-success">
<strong>Well done!</strong> You successfully read this important alert message. You successfully read
<a href="#" class="alert-link">this important alert message</a>.
</div>
<!-- Tags -->
<ul class="tags">
<li>paper</li>
<li>rock</li>
<li>scissors</li>
</ul>
</article>
<article class="post">
<h1>My Brilliant Blog</h1>
<h2>Post title: Gamma post</h2>
<!-- Content -->
<p class="content">This is the Gamma post, which should be inserted in the composed result.
<p>This is content from the description property in the YFM of Gamma post</p>
</p>
<div class="alert alert-success">
<strong>Well done!</strong> You successfully read this important alert message. You successfully read
<a href="#" class="alert-link">this important alert message</a>.
</div>
<!-- Tags -->
<ul class="tags">
<li>white</li>
<li>gray</li>
<li>black</li>
</ul>
</article>
<div class="alert alert-default">
<strong>Foo</strong> Not much going on here. You successfully read
<a href="#" class="alert-link">this important alert message</a>.
</div>
</div>
</body>
</html>