Blogging with Metalsmith

Datetime:2016-08-23 05:19:11         Topic: CSS  Gulp          Share        Original >>
Here to See The Original Article!!!

I switched from Wordpress to metalsmith .

And, instead of having a behind the curtains approach, I decided to just OSS all the things and do it out in the open: .

My biggest goals in switching:

  • Easy to author
  • Easy to deploy
  • Effective version control
  • Versital and customizable enough to explore new technology

Enter Metalsmith

"An extremely simple, pluggable static site generator."

  • Static Site Generator
  • Plugins for All the Things
  • Very much chose your own adventure

Metalsmith is a static site generator written in node. The documentation is not great and most of the tutorials are out of date... so it's hard for me to easily recommend unless you are set on node and wanting to get off the beaten path and/or needing a tool that's flexible enough to customize ultra-customize.

For further exploration, some helpful links:

Deploy with gh-pages

I have a simple shell script that runs the build scripts and pushes the files to github pages.

Feel free to checkout the deploy script .

Gulp for the rough edges

Metalsmith, while a great static site generator, does not cut it, imo, as a build system.

Instead of trying to shoe-horn it into doing so (which is more possible than you'd think) I just used gulp to do additional lifting.

local development

I use Browser Sync to serve my assets during development.

Gulp watches all content and style, running appropriate build tasks as these change

running metalsmith

I run metalsmith through gulp, and then execute a series of dependent tasks when this finishes (i.e. css and asset related tasks).

basscss, postcss, and cssnext

Instead of using SASS, I decided to jump on the new hotness and use postcss.

I'm using basscss for css.

I copy pasta'd the important parts of BassPlate to get started and customized from there.

From there I use cssnext and a few other plugins, as you can see here .

No jQuery or Bootstrap

Since I killed Wordpress, go pure iconoclast and get rid of jQuery and Bootstrap from my blog.

—In Conclusion—

Writing a blog should be a tool for learning and a way to share your knowledge with others. So yah, there are some rough edges, and in the early days I spent more time tweaking my build process than I did writing.


Put your ads here, just $200 per month.