
Build a Blog Engine in Go - dhruvbhatia
http://0value.com/build-a-blog-engine-in-Go
======
ghostdiver
I like the trick in Golang marketing, where we get a code full of references
to some libraries. Same could be done about other languages.

Oh, look, web server in 5 lines of code, in Java!

    
    
        public static void main(String[] args) throws Exception {
            Server server = new Server(80);
            server.setHandler(new HelloWorld());
     
            server.start();
            server.join();
        }
    

The trick is cheap, but it works!

~~~
icebraining
Of course, the difference is that the Golang code isn't using "some
libraries", but the standard library. Well, except for this one, which is also
using some custom handlers for gzip and such.

~~~
ghostdiver
It is also the only one library available for Golang atm.

Actually I think that this example written in Java8 with lambda expressions
would be more impressive.

~~~
icebraining
_It is also the only one library available for Golang atm._

Except it isn't: [http://go-lang.cat-v.org/pure-go-libs](http://go-
lang.cat-v.org/pure-go-libs)

~~~
ghostdiver
Nice one, a fun list of hobby side projects made by Golang enthusiasts.

I'm gonna drop Jetty and Java altogether in favor of AeroNotix/wedge!

~~~
icebraining
Well, your sarcasm really showed all those people who said you should!

------
jacques_chester
A few years ago, a greybeard of my acquaintance quipped that blogs are this
generation's unix shell.

My main nitpick would be that I see a standard blog as requiring a comments
facility. Inbuilt, I don't count disqus as having reached the minimum feature
level.

I'm also wary of flat file fetishism. Where data is strictly hierarchical and
there is only one pattern of access, YAML would suit fine.

In blogs you pretty get into not-hierarchical-really stuff pretty quickly. As
soon as the first per-tag or per-author archive page is added, for instance.

~~~
PuerkitoBio
Author here. As I mention in the opening lines, I agree that this is really
not the most original idea, barely above web frameworks :)

This was an attempt to build the minimal features required to have a useful
yet ridiculously simple blog engine. Of course it is very subjective, and to
me there are enough options to comment outside the blog itself (this thread
here being a good example), I didn't feel this was required. I think a more
"controversial" choice may be the absence of a distinct template for the index
page. I know this is not acceptable for some, but then there are a few other
blog generators to choose from!

~~~
jacques_chester
To each their own, friend.

------
stesch
I've written a static blog generator, too. But I haven't written a lot of blog
posts since then. I realized that I'm missing a browser based backend to edit
the posts.

 _sigh_

~~~
PuerkitoBio
Well, I edit with vim and git push when I'm ready. But if you really want a
browser-based editor, [Draft][0] is very nice.

[0]: [https://draftin.com/](https://draftin.com/)

------
gokce
I had a similar thing going 8 months ago.

[http://gokcehan.github.io/glog/](http://gokcehan.github.io/glog/)

The upside is that you are able to push your generated site to appengine with
a single command afterwards. Too bad even I have switched to jekyll nowadays.

------
peterg2
I've wanted to get into Go for a while now. This looks like it will be a good
reference. Thanks!

------
buro9
Neat, but I keep wondering with these static generators... why wouldn't you
just use pandoc
[http://johnmacfarlane.net/pandoc/](http://johnmacfarlane.net/pandoc/) for the
HTML generation?

~~~
toyg
Building a [static|dynamic] blog in $language is the most classic weekend
project for us web-nerds. It's the one field where universal reinvention of
wheel is culturally accepted. And it's just fun, I guess.

~~~
buro9
That's cool, and there's lots of things people should play with: the Go
templates for the design and layout, the file system watcher for auto-updates,
the file writing, etc.

But when it comes to formats, pandoc is so damn feature-rich, and would allow
authors to write in whatever was best for a particular post. Markdown most of
the time, restructered text occasionally, TeX rarely.

If anything it would extend the capabilities whilst introducing to the weekend
project the execution of an OS command and using stdout and stdin to
communicate.

A good addition to the weekend project, and a comprehensive addition to the
features of the static blog generator.

