staticsmith

1.0.1 • Public • Published

StaticSmith | Readme

Build Status Dependency Status devDependency Status Codacy Badge

An extremely simple, modular static site generator forked from metalsmith which was originaly built by those awesome peps at Segment. StaticSmith was forked (from metalsmith v1.7.0) and re-configured for use by the Single Page Application / Content Management System (SPA/CMS) OceanPress - A codePile.PBC project.

Current Release Status: GitHub version

Stable Production Release:

The current stable/production series on the master branch released on September 30, 2015. You can learn about what is new with StaticSmith v1.0.0 in our Release Announcements or bullet-ed in the HISTORY.md

Beta Quality Build:

StaticSmith v[TBA] is the current beta series on the develop branch and the release as a production build is scheduled for [TBA]. Information about whats new in this version can be viewed in the in the HISTORY.md


How does it work?

In StaticSmith, all of the logic is handled by plugable moduels. You simply chain them together. Here's what the simplest blog looks like...

StaticSmith(__dirname)
  .use(markdown())
  .use(templates('handlebars'))
  .build(function(err) {
    if (err) throw err;
  });

...but what if you want to get fancier by hiding your unfinished drafts and using custom permalinks? Just add another module...

StaticSmith(__dirname)
  .use(drafts())
  .use(markdown())
  .use(permalinks('posts/:title'))
  .use(templates('handlebars'))
  .build(function(err) {
    if (err) throw err;
  });

...it's as easy as that!

Installation

Typically installation is handled via the OceanPress builder during it's initial install. If you are wanting to use StaticSmith on it's own, feel free to use the following:

$ npm install @codepile/staticsmith

Modules

Check out the developer hub for a list of modules.

How does it work?

StaticSmith works in three simple steps:

  1. Read all the files in a source directory.
  2. Invoke a series of modules that manipulate the files.
  3. Write the results to a destination directory!

Each module is invoked with the contents of the source directory, and each file can contain YAML front-matter that will be attached as metadata, so a simple file like...

---
title: A Catchy Title
date: 2014-12-01
---

An informative article.

...would be parsed into...

{
  'path/to/my-file.md': {
    title: 'A Catchy Title',
    date: new Date('2014-12-01'),
    contents: new Buffer('An informative article.')
  }
}

...which any of the modules can then manipulate however they want. And writing the modules is incredibly simple, just take a look at the example drafts module.

Of course they can get a lot more complicated too. That's what makes StaticSmith powerful; the modules can do anything you want!

...and for CLI usage, see the wiki page


Todo's's, Bugs, Requests, Security, Oh My!:

Have a Feature Request? Suggest it at our UserVoice page. Peers can vote vote on your awesome idea and if it is a popular request, we'll implement it and you can follow its progress on our Waffle Board

Found A Bug? Give us a holler on our issues page and if your in the need to know whats going down? Check out our Waffle Board - You'll see the noise you created and track it in reall time. Our policy is Transparency, Transparency, Transparency!

Security: Here at codePile.PBC, we are committed to working with security experts across the world to stay up to date with the latest security techniques and participates in HackerOne. The codePile cooperative may pay out for various issues reported there. You can find out more information on our HackerOne page.


StaticSmith is a product of OceanPress - A registered trademark maintained by codePile.PBC & its contributors | codePile.PBC is a public benefit company (PBC) operating as a consumer/worker (web-technology) cooperative.

Package Sidebar

Install

npm i staticsmith

Weekly Downloads

1

Version

1.0.1

License

GPL-3.0

Last publish

Collaborators