Categories
Programming

GoBlogger – A micro blogging platform written in Go

I spend few weeks learning Go, the idea was to have a small  side project written in Go by the end of a week or so. I decided to write a small micro blogging platform from scratch – The GoBlogger!

Project structure

I used the good old bootstrap and jquery for building a responsive UI.

config.json:

Contains an array of json document representing the following:

  • title: Title of the blog post
  • content: The content to be rendered for this blog post – referencing the markdown file in the posts directory.
  • tags: tags for the post.
  • author: Author of the post.
  • publishdate: The date of publishing.
  {
    "title": "Hello from GoBlog!",
    "content" :"posts/hello-goblog.md",
    "tags":["go-blog", "go-blogging"],
    "post":"hello-goblog",
    "author":"AkhlD",
    "publishdate":"June 04, 2017"
  }

Posts

The idea of posts are pretty simple, you write the contents in markdown (thanks to blackfriday) and add an entry to the config.json file and GoBlogger will render it, It is also possible to have multiple tags referencing the same post, for instance in the above example, I could access the hello-goblog post using go-blog and go-blogging in the URL.

The end results

Landing page:

Post page:

You can also access the PoC through this link.

Code

I pushed the basic code along with few example blog posts to my github repo: https://github.com/akhld/go-blogger

Go more ideas or want to contribute? Feel free to drop me a message or open a PR in the git repo.

Leave a Reply

Your email address will not be published. Required fields are marked *