5 ms·
Harp is fantastic, but I'm still curious why the creators shy away from the static site generator aspect of it. It seems they really don't want Harp to be in th
by prezjordan 13y ago
Harp is fantastic, but I'm still curious why the creators shy away from the static site generator aspect of it. It seems they really don't want Harp to be in that group, but I'm wondering why.
- sintaxi 13y agoGreat question. Harp is a great static site generator. First of all, Harp works completely differently from SSGs like Jekyll in that it doesn't regenerate the entire application every time you change a file. Instead, harp only generates the static assets as it needs to (in-memory) to serve any given request and it doesn't spew out any files. This was throwing a lot of people off when they thought of it as an SSG because they were expecting harp generate a bunch of files and then serve those assets. So even though Harp has a `compile` function for exporting your application to static assets, it behaves and is built much more like static web server than a static site generator. Second, Harp unlike Jekyll doesn't have a strict convention of how your application is structured with a `_posts` directory and a `_layouts` directory. Instead, URLs with harp map directly to your file structure exactly as a static web server does. So if you want the url `/articles/hello-world` you must have a file in your project called `hello-world.md` or `hello-world.jade` in a directory called `articles`. The mental model of a web server translates much better to this paradigm.