Live data from Hacker News

Build Static Websites

eager.io

41–50 of 60 posts

Re: Build Static Websites

#41

Static website generators seem to come and go -- would anyone like to comment on one they like that seems to be lasting the test of time? The obvious one seems to be jekyll (possibly with octopress on top of it), but I'm interested in any others.

Middleman has been the most usable for me. In the past I've tried Jekyll, Hexo, Huge and DocPad.

Middleman is just simple enough that you can quickly build out an entire website/blog with great functionality, but extensible enough that you can write some custom Ruby to do that one specific thing you want.

I also really like how middleman can essentially use any markdown renderer or template engine. As someone that loves erb, Sass and Rake, Middleman just makes the most sense.

A few sites I've built with middleman

- http://ryanSrich.com/blog

- https://resources.catalyze.io

Re: Build Static Websites

#42

Static website generators seem to come and go -- would anyone like to comment on one they like that seems to be lasting the test of time? The obvious one seems to be jekyll (possibly with octopress on top of it), but I'm interested in any others.

http://www.staticgen.com is a great tool to help you find one to fit your needs. It does a daily poll of github stats on the most popular static site generators (72 on last count!) and lets you sort by programming language and popularity.

That being said, I'm been using gulp to hack together a system when the site isn't something conventional like a blog, marketing page or docs that many of these generators excel at.

Re: Build Static Websites

#44
post #27

I like the static site idea (I used it for years for my personal site), but I also like having a web front end for editing. I can't find a static site generator with a dynamic admin/posting end. Anyone seen one?

I started a working on a little node-webkit app with a markdown editor and some node.js static site generator embedded, giving a nice UI for editing and generating the site. I never got it working well enough to use, let alone share, but I hope somebody else does it someday.

Re: Build Static Websites

#45
post #37

Another solution we implemented was to have a WordPress site up, but only serving a spidered copied HTML version of it in the public_html directory. Every 2 minutes the site gets fully spidered, dumped into flat HTML files. And if the dump is not successful, because of a database connection or any problem at all, it doesn't get saved and doesn't overwrite the public_html dir.

This is interesting. Do the internal links get updated to point to the static spidered version or do they still point to the dynamic website?

I've been toying with the idea of creating a product / service that would let you choose which internal links went to the static copy and which would be forwarded to the original site so that dynamic stuff like commenting could still work (although perhaps display would be delayed), but everything else could be static / cached.

Honestly I think a proof of concept could be done using something like wget to mirror the site and a little ruby or awk to do the specific link rewriting.

Re: Build Static Websites

#46
post #38

I tried building a static website for people to browse tech article headlines that were gather ed from around the web. The feedback was that people like the style and general idea, but wanted a crap ton of features that can only be accomplished in a highly dynamic and scalable web site. IE Logins, Voting, Commenting, Friending, Favoriting, Etc and so forth.

A lot of that stuff can be done with embedded third-parties like Disqus or ShareThis.

That's totally true, but it's off-putting to farm out the core functionality and it's underlying data to a third party.

Re: Build Static Websites

#47
Static websites are great, I love them. I definitely generate them when possible.

But beware, if your website start to grow and becomes more dynamic, take a step back and rethink if you should still go with all that generation. Could be a pain in the future.

Someone correct if I'm wrong, but the people behind the The New York Times website had to do a major rewriting of their code base due to that (I remember seeing some presentation about it some time ago, but I can't find the link nowadays...).

Re: Build Static Websites

#48
post #26

I get the point he's making, but when I want to add something as simple as a counter my website already stops being static. The question you have to ask yourself: How many static websites are in your "favourite" folder? When I look into it, I have a hard time finding a single one.

Fortunately websites can run javascript now, allowing you to do virtually any dynamic thing you need. Counters in particular are an interesting example, because they were inserted as images into websites long before the idea of a dynamic website was popularized.

You can see many of the things you can do just on the client in our apps list: https://eager.io/apps. We don't have a counter in there yet, but it's certainly possible.

Re: Build Static Websites

#49

I tried building a static website for people to browse tech article headlines that were gather ed from around the web. The feedback was that people like the style and general idea, but wanted a crap ton of features that can only be accomplished in a highly dynamic and scalable web site. IE Logins, Voting, Commenting, Friending, Favoriting, Etc and so forth.

You can do any of these things by building an API and communicating with it using javascript in the browser. This method generally leads to a more responsive interface as well, as you don't have to reload the page when the user favorites, friends, etc.

Re: Build Static Websites

#50
If caching is setup properly, you won't need any Database-Querys unless your Content changes.

A static site needs also to be served. HTML-files are on the Servers Harddrive. They have to be read and send to the client.

A clever Caching-Strategy might beat this aproach by reading the files once and Serving the content from memory. When I write "reading the files once", this also includes making a db-query, rendering a HTML-Site and caching the result in a Tool like memcache to serve it from there.

Post reply on HN