Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

static-blode

1.1.8 • Public • Published

blode

blode is a simple Node.js application to create static blogs. I've designed it to create my own blog (zanon.io) and I'll be glad to help if you want to use it too.

Build Status

Quick Start

# install
> npm install static-blode -g

# create sample blog
> blode new my-blog-folder

# change to the new directory
> cd my-blog-folder

# build the blog files
> blode build

# watch the blog running at localhost:3000
> blode run-local

# publish to Amazon S3
> blode publish

How does it work?

The Node.js application reads the blog posts written with the Markdown syntax and compile them to HTML. It also minifies CSS, JS, pre-render pages to improve SEO and gzip contents before uploading to Amazon S3. If you don't want to host on AWS, you can publish manually to another service.

Why a static site generator and not Wordpress?

You can use Jekyll or another static website generator, but please, don't use Wordpress for blogging! Static websites don't need a dedicated server neither a database. A serverless blog means an extremely fast and cheap website. Also, you don't need to worry about security and server updates. You can read more reasons here.

Features

  • Compiles Markdown files to HTML
  • Uses single-page application with AngularJS
  • Pre-render pages
  • Adds blog posts filters by tags
  • Minifies CSS/JS
  • gzip and upload to Amazon S3
  • Updates the RSS and sitemap files

Installing

> npm install static-blode -g

How to use

Below follows some instructions about how to use blode. If you have any doubt, please, file an issue and I'll try to help you.

Create a sample blog

The first step is to generate the blog sample files:

> blode new my-blog-folder
> cd my-blog-folder

Build files

The following command will render all markdown files, update the sitemap, RSS and update additional files for Angular.

> blode build

Configuration

If you want to publish your blog on Amazon S3, you need to modify the config.json file that is located at the root level of your blog folder. Fill the following properties:

{
  "awsAccessKeyId" : "your_access_key",
  "awsSecretAccessKey" : "your_secret_key",
  "awsRegion": "your_region",
  "awsBucketName" : "your_aws_bucket_name"
}

The only mandatory option is the awsBucketName (that must match your domain name). The rest of the settings can be configured with shared files or environment variables (more here).

For a tutorial on how to host a static blog in Amazon S3, you can read here.

Test

Test the blog and watch it running at localhost:3000

> blode run-local

Publish

Publish is done to AWS S3 using:

> blode publish

Blog posts

Blog posts should be created inside the raw folder using the Markdown markup language and you can use your favorite editor for this. If you don't have one, I suggest: stackedit.io

blode requires that each post uses the following format:


Title: < Post Title >  
Summary: < Summary of post. >  
Tags: < TagX >  
Date: < NOV 15, 2015 >  
URL: < post-url >  

< ##  Post Title  >  

< Here starts the content of your Post >  

Note: replace < text > by your data.

Keywords

none

install

npm i static-blode

Downloadsweekly downloads

4

version

1.1.8

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability