This is an open source project I've worked on over weekends for a long time. The goal is to create a tool well suited for websites you expect to be around for 5 or 10+ years.
Would love any thoughts you have on it.
The reason why I decided to build this is all other (JS-based) static site generators I tried had one or of these problems:
- Built on an underlying framework like React, Vue, etc.
- Relies on complex build tools like Webpack, Babel, etc.
- Depends on a massive tree of modules that force constant maintenance
- Has interfaces, source code and documentation that cannot be understood in one sitting
- Requires that your site source be organized in a way that looks nothing like your output
- Forces a huge leap from hello world to a real world implementation
Really like what you are going for here. I've actually been working on a similar system of a minimalist static site generator off and on for about a year. Looking forward to having a more in depth look at your approach.. and congrats for putting it out there, I've been letting my imposter syndrome keep me from publicly showing my system off. I really dig your templating system, I ended up going with Handlebars but I always planned on removing it at some point. Are you using grey matter for parsing the markdown metadata or did you create your own parser?
Hey thanks! Can definitely empathize with the imposter syndrome, it's a tough hurdle to clear.
For the templating system I decided to also add an option to define your own if you don't like the [] syntax (https://prpl.dev/api#options). Figured since the system is regex-based instead of AST-based there's no reason not to expose it as an option to users.
For the metadata I implemented a basic parser. Here's a link to that part of the source code, it's not the most efficient nor does it cover all the edge cases, but it's simple enough it can be easily updated (https://github.com/tyhopp/prpl/blob/master/packages/core/src...).
Good luck and hope I can see your system on HN someday too
I take that approach too if the site is small enough.
The challenge is if the site starts to get into the hundreds of pages and you want to be able to reuse templates and/or render lists of content. Then you reach for a static site generator.
I love this. I have used Eleventy, Hugo, Gatsby, and Jekyll. All of them feel like overkill. I want to write my own HTML. I want to write posts (and maybe some simple pages) in markdown. And I want to be able to render a list of posts/individuals posts. This hits all of those in a really simple package. Nice work!
7 comments
[ 248 ms ] story [ 398 ms ] threadThis is an open source project I've worked on over weekends for a long time. The goal is to create a tool well suited for websites you expect to be around for 5 or 10+ years.
Would love any thoughts you have on it.
The reason why I decided to build this is all other (JS-based) static site generators I tried had one or of these problems:
- Built on an underlying framework like React, Vue, etc.
- Relies on complex build tools like Webpack, Babel, etc.
- Depends on a massive tree of modules that force constant maintenance
- Has interfaces, source code and documentation that cannot be understood in one sitting
- Requires that your site source be organized in a way that looks nothing like your output
- Forces a huge leap from hello world to a real world implementation
Thanks,
naansequitur
EDIT - List formatting
For the templating system I decided to also add an option to define your own if you don't like the [] syntax (https://prpl.dev/api#options). Figured since the system is regex-based instead of AST-based there's no reason not to expose it as an option to users.
For the metadata I implemented a basic parser. Here's a link to that part of the source code, it's not the most efficient nor does it cover all the edge cases, but it's simple enough it can be easily updated (https://github.com/tyhopp/prpl/blob/master/packages/core/src...).
Good luck and hope I can see your system on HN someday too
The challenge is if the site starts to get into the hundreds of pages and you want to be able to reuse templates and/or render lists of content. Then you reach for a static site generator.