Static Website Generators Are the Next Big Thing
141–150 of 187 posts
Re: Static Website Generators Are the Next Big Thing
#142The reason I like static site generators so much is because it allows me to treat my website as a program that outputs a website. Take some posts in whichever format you prefer, write a program to parse them as a tree of HTML nodes, insert them into templates for HTML pages, Atom feeds, etc. It's all just plain text code and markup, no stateful database with a dynamic web application in front doing everything.
template(data) -> html
I'm a fan of the inverse of this. The template and the output (html) are the same thing; I don't separate them. Instead I just update the html when something changes. The function is: update(html, data)
Where update is a function you write that modifies the html in place.The upside to this is that generating new content is cheap, you only ever update the things that need updating.
The downside is that your html output and updating function are tightly coupled; you can't change the structure of your html without also changing your update function.
I think that's ok though. Changing templates are infrequent enough to warrant the increased cost of fixing everything when you do change them.
Re: Static Website Generators Are the Next Big Thing
#143I use MiddleMan as a static site generator for a page hosted on my raspberry pi: http://pi.tafkas.net As I am more of a python guy I wonder if there is a similar (as in not primarily for blogging) generator for python?
Re: Static Website Generators Are the Next Big Thing
#144I agree with the article and think static web sites is the way to go if the read/write ratio is high, and where the view is not unique to the user. However, quote > "The static version is more than six times as fast on average!" This must be an engineering problem, especially on easily cached content. Serving static web sites Does require computation. But the current tools are very well made and optimized for it, wit…
Once in a while someone manage to get CDN hosting just right, but it's really rare, and it's not something you can simply automate with a dynamic site (like we can for static sites with netlify). Typically the result is identical to the Smashing Magazine Site, often a lot worse. Smashing does a good job of caching at their origin datacenter, but their HTML doesn't get cached at edge nodes. Many other sites does a far worse job of caching at their origin.
It might be true that to some degree it's an engineering issue, but if it's one that hits 95%+ of all sites built with a dynamic approach and can be completely eliminated with a static approach, then obviously it might be better to shift the balance and default to doing thing statically instead of reaching for Wordpress/Rails/Drupal/whatever for each new site...
Re: Static Website Generators Are the Next Big Thing
#145When I was heading up reliability at Netflix, we considered, and even began evaluating, turing the whole thing into one big static site. Each user had a custom listing, but generating 60+ million static sites is a very parallelizeable problem. At the time, the recommendations only updated once a day, but an active user would have to dynamically load that content repeatedly, and at the same time, the recs were getting…
I might be wrong, but I believe that 4chan does something similar to this: Every time a post is made, the board is updated and new static pages are generated. All the server does then is serve this static pages. (I can't find any official reference to this though, but another user has referenced this some time ago: https://news.ycombinator.com/item?id=8060200 )
Re: Static Website Generators Are the Next Big Thing
#146My company is handcuffed to a legacy custom CMS that's still using Rails 2.3.8. We have no need for it, as we have a front-end guy who would be perfectly comfortable using git, as he has me to ask whenever there's a problem. When you use the database to store content, you lose a great number of useful properties. I had to build a custom tool to search through the entire database to find encoding errors. And I had to keep re-adjusting it every time I found some hiding somewhere. It was annoying and painful. Content is code, not data, it needs to be managed like code.
Re: Static Website Generators Are the Next Big Thing
#147Re: Static Website Generators Are the Next Big Thing
#148Now I tend to think that the best way would be to use a random CMS (like Wordpress) and mirror it's output as a static site. That way, the dynamic part the end user uses for creating content could be behind some secure login-wall, and the public site would just be static.
As for comments, I guess they just won't be supported.
Re: Static Website Generators Are the Next Big Thing
#149When I was heading up reliability at Netflix, we considered, and even began evaluating, turing the whole thing into one big static site. Each user had a custom listing, but generating 60+ million static sites is a very parallelizeable problem. At the time, the recommendations only updated once a day, but an active user would have to dynamically load that content repeatedly, and at the same time, the recs were getting…
I might be wrong, but I believe that 4chan does something similar to this: Every time a post is made, the board is updated and new static pages are generated. All the server does then is serve this static pages. (I can't find any official reference to this though, but another user has referenced this some time ago: https://news.ycombinator.com/item?id=8060200 )
Re: Static Website Generators Are the Next Big Thing
#150It's an interesting idea, and I see the appeal if the site is fairly basic, but I think there's one thing people are forgetting here. You're outsourcing half your site to third parties, and basically letting them do whatever the hell they like with it. Disqus comments? Better hope the people behind that system don't decide to outlaw comments about the thing your website is about. Javascript embedded shop system? Good…