7 ms·
Gatsby – Static Site Generator with React and Webpack
- jimktrains2 11y agoWhat are we pulling in such heavy machinery for a text-only site? It's things like this that make people think it's OK to have a blog that isn't accessible without JS which includes so screen readers.
- tilt 11y agoThis one is actually Universal ("Isomorphic" if you want), check https://www.reindex.io/ https://www.reindex.io/ for example.
- jimktrains2 11y agoInteresting. I had expected it to be like bloger that just greets you with a white screen; I didn't see his example blog earlier.
- lhorie 11y agorelevant: http://prog21.dadgum.com/130.html http://prog21.dadgum.com/130.html
- hughw 11y agoSerious question: Why do screen readers not evolve to run js and build a DOM? (I agree blogs should be accessible to text only UAs)
- baddox 11y agoAn even better question: Do screen readers NOT do this? I would be very surprised if they don't. Surely by now screen readers would be based on one of the popular browsers.
- danneu 11y agoScreen readers definitely support Javascript: http://webaim.org/projects/screenreadersurvey5/#javascript http://webaim.org/projects/screenreadersurvey5/#javascript HN had a pretty good convo about accessibility a few years ago where some screen reader dependent community members dispelled the myth once and for all, for me. We tend to talk about screen readers here like they're just `curl example.com | say`.
- xtrumanx 11y agoThe docs page delivered 270kb of compressed and minified JavaScript (1MB uncompressed) but sadly didn't seem to show anything with JavaScript disabled. I thought all the hot new React apps were isomorphic nowadays.
- Killswitch 11y agoIsomorphic does not mean works without JavaScript. Actually you need JavaScript turned on for isomorphic to work. On a related topic, I hate the term isomorphic. It's just JavaScript.
- sylvinus 11y agoYou don't need JavaScript if the server can generate all the pages and the links are valid.
- aberatiu 11y agoIt also contains all his blogposts (the bundle.js file). Not good on the long term
- davexunit 11y agoRequiring JS to read pages of a static website is nonsensical.
- lojack 11y agoWhich is why this tool compiles the pages into static HTML before serving them to the client. Go ahead, disable javascript and visit any of the example websites.
- deckard1 11y agouh. This just means you end up with inverted PHP. Instead of PHP, where you have a Perl-ish language generating HTML, you now have JS generating HTML. You lose 100% of the benefit of React, which is the virtual DOM. You can literally use any template language you want and achieve identical results here.
- lojack 11y agoI'm not quite sure what your point is. You say that the only use of react is the virtual DOM, so is it just that React is a poor choice as a template engine? I'm not personally convinced, but that's a bit of personal preference I suppose. The modularization and composability of components is definitely nice, and not all template engines do this well. I could certainly see how you may disagree with me though. Is it that they aren't doing anything revolutionary? That's certainly true. It's relatively trivial to make a static site generator that uses React, and there's plenty of static site generators out there that use other engines. I think using webpack to bundle everything up is pretty nice though. Either way, my point wasn't that this project is particularly amazing, or useful, just that it works with JavaScript disabled.
- deckard1 11y ago> just that it works with JavaScript disabled My point is, the whole point of React is to use JavaScript. Otherwise it just becomes yet another template language. Which every static site generator already has. It's also easy to screw up React and end up with JS on the client side. Because that's the selling point of React (or isomorphic, to be exact)... JS freely travels between backend and frontend without the developer really caring much.
- sago 11y agoGenuine question, not passive aggression. Why do static site generators always revolve around blogs? Blogs are around, sure, but they're a bit old-hat now, right? There are other ways to arrange content. I've got my own single-file Python static site generator, which could handle a blog, I guess, but it would seem odd to crown that one application. Is it historical, from Jekyll? Or is blogging the overwhelming use-case for static sites?
- geraldbauer 11y agoFYI: I've put together a showcase for static sites [1] at Planet Jekyll. If you browse the listing (a static site itself ;-) you will find project sites, online books, and much more (than just blogs). [1] http://planetjekyll.github.io/showcase http://planetjekyll.github.io/showcase
- Poiesis 11y agoMind sharing the link for your static site generator?
- sago 11y agoThanks for the interest, but it is just a kind of personal hack thing. Just feed pages through markdown and jinja templates.
- nkrisc 11y agoWhile I can only speculate, I would imagine that blogs or blog-like sites are not only the majority use case for static site generators, they also make for a simple and relatable example for demonstrating the capabilities of the generator.
- Touche 11y agoGreat question, I'm not sure why media sites aren't all statically generated, would be much more economical if nothing else. Ads can still be dynamically loaded on the client, but content that never changes; why is that in a database?
- stackpush 11y agoI've been using http://gohugo.io http://gohugo.io which has the same live reload feature and is really fast and easy to work with.
- curiousjorge 11y agowhat static site generators out there exists that is easy to setup on a ubuntu server?