Skip to content

πŸ”₯ A simple and stup*d static blog generator.

License

Notifications You must be signed in to change notification settings

yusufmalikul/bloggy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

bloggy

A simple and stup*d static blog generator written in Go.

Status

Maintained by me.

Why

I wanted to create a simple blog generator that is easy to use. I prefer static sites because it's cheap to host and maintain. It also reduce security risks for your server.

Usage

First, download the release binary here.

You can also build it yourself if you have Go installed:

$ go install github.com/yusufmalikul/bloggy@latest

Then you need to prepare your blog posts content. Layouts directory must have index.html and post.html see (examples). Put your markdown files e.g. in posts directory.

$ tree myblog
myblog
β”œβ”€β”€ layouts
β”‚   β”œβ”€β”€ index.html
β”‚   └── post.html
└── posts
    β”œβ”€β”€ hello-world.md
    └── second-post.md

Run this command to generate markdown files to your designated output directory.

$ bloggy --content myblog/posts --layouts myblog/layouts --output myblog/html
Generating...
Done in 952.06Β΅s

It will generate html files in myblog/html directory.

$ tree myblog
myblog
β”œβ”€β”€ html
β”‚   β”œβ”€β”€ hello-world
β”‚   β”‚   └── index.html
β”‚   β”œβ”€β”€ index.html
β”‚   └── second-post
β”‚       └── index.html
β”œβ”€β”€ layouts
β”‚   β”œβ”€β”€ index.html
β”‚   └── post.html
└── posts
    β”œβ”€β”€ hello-world.md
    └── second-post.md

After that, you can start bloggy as a server.

$ bloggy server --dir myblog/html
Listening...
Visit http://localhost:8080

Visit http://localhost:8080 to see your blog. You can also deploy the static files (myblog/html) to your server.

Styling

You can style your blog by editing index.html and post.html in layouts directory. Bloggy uses Go's template. The available variables are:

  • Title - title of the post
  • Body - body of the post
  • Path - path of the post

License

MIT