
Security News
Meet the Socket Team at RSAC and BSidesSF 2025
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
grunt-markdown-blog
Advanced tools
This is a grunt multi-task for generating static blogs from posts written in markdown. It was designed to be used with Lineman, but should be generally useful to someone trying to accomplish the same.
Here's an easy-to-clone repo that uses it: linemanjs/lineman-blog-template
There are a few spiffy features of grunt-markdown-blog that make it pretty useful:
A post might look like this:
---
title: "Learning to love again with Lineman.js"
description: "We love lineman, and we think you will too!"
date: "2013-06-15"
author:
name: "Justin Searls"
video:
type: "youtube"
url: "http://www.youtube.com/embed/PWHyE1Ru4X0"
---
Summary Cupcake wypas pastry sweet roll. Cake ice cream caramels apple pie donut chupa chups. Sugar plum dessert liquorice caramels jelly sugar plum ice cream applicake. Jelly beans tart carrot cake caramels liquorice macaroon gummi bears bonbon gummies.
All of those goodies between the "---" headers will be evaluated as JavaScript or CoffeeScript. So long as it evaluates to an object with properties, those will be accessible from your templates like so:
<div class="byline">
<% if(post.get('author')) { %>
by <a href="#"><span class="author"><%= post.get('author').name %></span></a>
<% } %>
</div>
Here's an example configuration in CoffeeScript, which more or less mirrors the default configuration.
markdown:
options:
author: "Full Name"
authorUrl: "https://twitter.com/fullname"
title: "my blog"
description: "my blog where I write things"
url: "https://myblog.com"
disqus: "my_disqus_id" #<-- just remove or comment this line to disable disqus support
feedCount: 10 #<-- set to zero to disable RSS and JSON Feed generation
dateFormat: 'MMMM Do YYYY'
layouts:
wrapper: "app/templates/wrapper.pug"
index: "app/templates/index.pug"
post: "app/templates/post.pug"
page: "app/templates/page.pug" #<-- optional static pages
archive: "app/templates/archive.pug"
paths:
posts: "posts/*.md"
pages: "pages/**/*.md" #<-- optional static pages
index: "index.html"
archive: "archive.html"
rss: "index.xml" #<-- rss/atom feed
json: "index.json" #<-- jsonfeed.org v1.1
dev:
dest: "generated"
context:
js: "../js/app.js"
css: "../css/app.css"
dist:
dest: "dist"
context:
js: "../js/app.min.js"
css: "../css/app.min.css"
If you use a watch plugin with grunt, you can also do something like this for development:
watch:
markdown:
files: ["app/posts/*.md", "app/pages/**/*.md", "app/templates/*.pug"]
tasks: ["markdown:dev"]
FAQs
Generates a blog from markdown posts & pug templates
The npm package grunt-markdown-blog receives a total of 33 weekly downloads. As such, grunt-markdown-blog popularity was classified as not popular.
We found that grunt-markdown-blog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.