Blog Generator - my own static site generator
Blog Generator - my own static site generator
Write in Markdown, publish in HTML.
Image created by https://robohash.org/
#
mark.##
mark. Will be in meta description of generated html.2016-12-31-this-is-a-post.md
.texts
. Each subdirectory will be assigned a category.templates
dir, which uses Tenjin as template system.JS
andCSS
files put in assets/{css, js}
.images
subdirectory, within the category directory:texts/ruby/images/pinkpanter.jpg
. In the post, put the reference as 
.CATEGORY/images
.ruby/2016-12-31-ruby-rocks.md
if it has some source code, it will be marked as lang-ruby.
# This is the title
## This is the description
Here the text.
Show-me the code:
puts 'Hello world!'
gem install gerablog
bundle install
;rake
) and fix anything that appears wrongrubocop
and fix all offenses!The executable gerablog
has this options:
-h
or --help
Yes, we have a --help
option:
➤ gerablog --help
Usage: optparse [options]
-h, --help Display this screen
-n, --new FILENAME Create a new project.
-g, --generate FILENAME Generate the static blog.
-n
or --new
Create a new project:
➤ gerablog --new /tmp/test
How the project looks like?
➤ tree /tmp/test
/tmp/test
├── assets
│ └── assets
│ ├── css
│ │ ├── gerablog.css
│ │ └── prism.css
│ └── js
│ └── prism.js
├── gerablog.conf
├── output
├── templates
│ └── templates
│ ├── categories.rbhtml
│ ├── category.rbhtml
│ ├── feed.rbxml
│ ├── footer.rbhtml
│ ├── header.rbhtml
│ ├── index.rbhtml
│ └── post.rbhtml
└── texts
If --root
is not informed, root will be ./
.
-g
or --generate
For my blog:
➤ gerablog --generate ~/Dropbox/projetos/paulohrpinheiro.xyz/blog/gerablog.conf
ruby
diversos
programadorbipolar
javascript
c
perl
rust
python
Copy output
directory to your server :)
This project started with a script I made to generate my site https://paulohrpinheiro.xyz.
The script is in this gist:
https://gist.github.com/paulohrpinheiro/20130e06355fc5bffe5865ce903dce63