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.
# 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.
- 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
> 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
The following command will render all markdown files, update the sitemap, RSS and update additional files for Angular.
> blode build
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:
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 the blog and watch it running at localhost:3000
> blode run-local
Publish is done to AWS S3 using:
> blode publish
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.