6 ms·
If you're looking for a Static Site Generator: consider building your own. You can build your own static site generator in an afternoon. It's super simple to d
by geowwy 7y ago
If you're looking for a Static Site Generator: consider building your own.
You can build your own static site generator in an afternoon. It's super simple to do and you avoid all the complexity of these off-the-shelf static site frameworks.
A few examples of my own:
* A blog made with makefile, m4, multimarkdown, and scss
* A personal website made with shell scripts and php
* A business website made with ruby, rake and erb
- commanderj 7y agoI was just about commenting: Yeah, we needed another static site generator! But your approach is the most ridiculous thing I can think of. One site generator per site. Nice dude!
- praveenweb 7y agoThe advantage of doing this is that it gives you the power of using your favourite language to build this and its a fun project as long as its just dealing with markdown. If you are building static sites with content sourced from a database or APIs then these static site generators removes friction involved in setting those up.
- petepete 7y agoOr for something in-between try Nanoc. It's a static site generator but much less prescriptive and more flexible than tools like Jekyll and Hugo.
- rajangdavis 7y agoLove Sinatra for this
- gherkinnn 7y agoI have gone that route in the past, only to find myself in lost amidst config files, documentation, and never ending ideas for more features. Not that that’s impossible, but I lacked the restraint to turn away and do what actually matters: write content.
- efdee 7y ago> only to find myself in lost amidst config files, documentation, and never ending ideas for more features. Sounds like about the experience you'd have with most existing static site generators ;-)
- gherkinnn 7y agoSo very true. How can something as simple as md => html become so cumbersome?
- izolate 7y agoI agree with this. Honestly, it's super simple assuming you want to convert Markdown files to HTML. You can also leverage 3rd party libraries to do the heavy lifting of: 1) Reading local file tree (the IO/FS module of your $LANGUAGE standard lib will suffice) 2) Parsing front matter (parsing the YAML block of meta at the top of the Markdown file) 3) Transforming Markdown to HTML (plenty of good libraries) 4) Using HTML templates (also plenty to choose from) I don't think it's appropriate to link to my site here but if you're interested, I wrote a blog post on how to build your own static site generator. Link is in the bio.
- tiborsaas 7y agoI would recommend to use Parcel. Once you are done with HTML, SCSS, it's one line to build it: parcel build *.html --public-url https://yourdomain Minifies all code and has sane defaults not to have to deal with configuration in most cases.
- ORioN63 7y agoI really liked Metalsmith, mostly because it was fairly agnostic. It's a simple pipeline with pluggable components.
- djsumdog 7y agoI migrated my site from WordPress to Jekyll a few years back and I fought a lot with Jekyll and had to write a lot of custom ruby plugins to get everything I wanted. In retrospect, I really should have just written my own.
- iamgopal 7y agoComing soon a static site generator generator framework.
- anderspitman 7y agoTotally agree. I built my own last year. I don't use it anymore (decided to move to vanilla JS rendering for performance, and to remove the need for a build step), but the process was very instructive.
- TurkishPoptart 7y agoCan you point me to any resources for this? I'm somewhat of a beginner. I tried using Gatsby+ReactJS but realized I didn't understand React that well, and my GraphQL stuff didn't work. Thanks. matthewnewton (dot) info was the site.
- lqet 7y agoA few years ago, I build my own static site generator in a 200 LOC Makefile [0] I am still using it and built several sites with it, including image galleries for several weddings. [0] https://github.com/patrickbr/hagel https://github.com/patrickbr/hagel
- _bxg1 7y agoSeconded. Following React's paradigm of "markup is a function of data", I recently built a new personal site generator where I just swapped JSX for JS template literals. Pages are a set of those functions composed together. Markdown is handled by a library, which (you guessed it) also just generates HTML strings. Works like a charm, incredibly easy to build and use. Plus, because my rendering is all just pure JS functions, it'd be a flip of a switch to go from static site generator to an Express server that renders pages at request time.