Hacker News new | past | comments | ask | show | jobs | submit login
Writing a blog platform in Go (steve-lacey.com)
59 points by stevela on June 9, 2011 | hide | past | favorite | 15 comments



Always fun to read about how someone rolled their own, but as nerds we have to poke right?

Why write a textile parser in Go? Run the JSON through one that's already written? Store the posts pre-rendered?


Exactly. He uses Disqus for comments, so it could actually be a static site. No worries about performance, caching, load, security anymore (almost).


Spot on. I think a hybrid approach would be good however as having maintained a huge static site, it's a pain in the arse getting templates etc right.

I actually have a static site generator that I wrote that uses Go to apply reusable templates (using the built in template package) and generate navigation that outputs static HTML only. The idea is that you store your HTML static documents in Mercurial, run the site through the site generator and rsync it to your web root. I really need to clean it up and chuck it on bitbucket.


I'd be interested in that code. There's lots of static site generators out there already--and like so many procrastinating nerds I wrote my own--but it'd be a nice real-world example of Go and its Template package.


I'll clean it up and upload it when I get a chance - probably in the next couple of weeks. I'll post it to Show HN.


You know, sometimes the best way to learn a language is to just have a relatively straightforward problem to solve (like your own blog) that you actually care about doing well and will continue to use. Otherwise, you are just doing tutorials for the sake of tutorials and that doesn't always stick.


I always viewed blog platforms as the "Hello World!" of web apps. They are non-trivial, but everyone has written one, knows what it should do, and how it should look. So instead of worrying about how to solve the problem, you can see how the language or framework works.


"It's way too slow. Page load times are awful."

His own blog is also very slow. Sometimes you should not reinvent the wheel but optimize it.

I don't know why he needs all the Javascript but when I open his page the whole page kind of rebuilds after 2 seconds.


The site doesn't use much js itself (other than to wrap the images which sometimes seems to look like a rebuild). I should probably just modify the textile formatter to do that...

The bulk of the js is disqus and a code pretty printer.

For actual performance it seems to be doing pretty well for me. See here for a before/after: http://steve-lacey.com/2011/04/perf_improvement


You are doing 20 requests to external Javascripts and 8 requests to external stylesheets according YSlow. "The page has a total of 61 HTTP requests and a total weight of 637.2K bytes with empty cache".

When I read about performance issues I just wondered why you are including all this stuff. That's why I prefer optimizations in the first place before reinventing the wheel ;)


Im going to reinvent a blogplatform in Clojure mainly to learn do something in a really restful way and learn a little bit of more about the clojure webstack.


how can this guy have so many tags in his tag cloud?!



I like how he has ones like 'tag1', 'tag2', 'tag3' and also 'tags'


What's with his impatience? Scala isn't that hard.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: