News for hackers. Stuff that matters.
Re:Pre-rendering static websites with the 23 year-old wget c... by znpy on Tuesday August 27, 2019 @01:26PM (#20812253)
Wouldn’t it make more sense to generate the html and save it to the appropriate file from the blog generator itself?

What if you have a page that is there but it’s not linked from any other page (a landing page for example)? It would never be pre-rendered.

Re:Pre-rendering static websites with the 23 year-old wget c... by tjholowaychuk on Saturday August 31, 2019 @08:02AM (#20845805)
You can definitely do that, but I find this appealing for development, just write some routes as you normally would and the templates all re-render etc, no need for watching file changes and re-compiling. But you're right, if you have a 404 template for example you have to `curl ... > build/404.html` which is a bit lame.
Re:Pre-rendering static websites with the 23 year-old wget c... by thedanbob on Tuesday August 27, 2019 @05:10PM (#20814434)
I did exactly this with a rails project once, called render_to_string on each page I was interested in and saved them as HTML files. The wget method is clever but I agree, working within the same system makes the most sense.
Re:Pre-rendering static websites with the 23 year-old wget c... by zeroimpl on Tuesday August 27, 2019 @10:45PM (#20816421)
If you are using a web framework designed for dynamic processing - think something like Java servlets/JSP, or in the authors case Go - it's often non-trivial to find/implement a render_to_page function, let alone enumerate all possible pages.