10 ms·
I though this was about the wedding registry site at first. Anyway, I liked this line from the Github: > Hugo gets ehh for the template engine because while i
by regus 6y ago
I though this was about the wedding registry site at first.
Anyway, I liked this line from the Github:
> Hugo gets ehh for the template engine because while it is probably the most powerful template engine in the list (after Jinja2) it personally drives me insane, to the point of writing my own template engine and static site generator. Yes, this is a bit biased.
This seems to be the life cycle of static site generators (SSG). It works at first, but you end up wanting to design your own custom SSG once you run up against something that goes against your mental model of how things should work.
I did this exact thing when I got frustrated with Hugo. I made my own custom SSG in order to create my blog.
The other thing that tends to happen with SSGs is that it can be a lot more fun to play around with the tech than actually writing blog posts!
If you're interested you can read here to see how I made an SSG for my blog:
https://joelregus.com/posts/blog/index.html https://joelregus.com/posts/blog/index.html
- bachmeier 6y agoThe problem I see with using a SSG is that (a) it probably doesn't do what you want, combined with (b) it's designed to automate specific workflows rather than to make customization easy. There are obviously some cases for which someone else's automated workflow is useful. I'm not sure how often the tradeoff is worth it if you are proficient with a programming language that you can use to automate the workflow yourself.
- patrickmcnamara 6y agoI think I’m just going to write a HTTP server for my website in Go, download the entire website with wget and host that statically. At least that way I can have any feature I want.
- egeozcan 6y agoWhy not varnish then?
- patrickmcnamara 6y agoSimply because a lot easier to host static files than it is to host a web server binary that has to be executed. I can just upload to GitHub Pages or AWS S3 and let them worry about the HTTP caching, TLS certs, upgrade to HTTP/3, etc.
- vidarh 6y agoWhen I decided it wasn't worth keeping my personal site dynamic, I took my webapp and pulled out the core of it, and built a small little script that enumerated the possible urls and "requested them" from the old webapp and wrote them to files, turning the webapp into a static site generator.
- patrickmcnamara 6y agoYep, exactly. Wget can do this with the --recursive flag.
- michaelbuckbee 6y agoThere are legit services/plugins that do this with Wordpress for similar reasons.
- NotPavlovsDog 6y agoI've been contemplating converting some legacy WP to static, but have not had the time to review available options. With root access to the server / just good old wget, are there benefits to using the plugins/services? Which would you suggest? Would be grateful if you shared your experience.
- minitoar 6y agoPerhaps we need a meta ssg. An ssgg if you will. Perhaps a dsl for specifying ssgs.
- threatofrain 6y agoI guess Racket’s proposal of language oriented programming isn’t so kooky after all.
- threepio 6y agoPollen, written in Racket, is arguably a "dsl for specifying ssgs" https://docs.racket-lang.org/pollen/ https://docs.racket-lang.org/pollen/
- mdtusz 6y agoPollen seems so incredibly cool and powerful, but every time I have tried to play around with it, I get distracted by small quirks and areas that I wish were documented more clearly, or in a more organized format. My daydream is to make a _good_ technical documentation system with it that is usable by the everyman, but it's still just a bit too much of a stretch. Markdown + pandoc + LaTeX templates get close, but LaTeX templating is a nightmare, and markdown is far too limiting and lacks expressivity (without ad-hoc DSL's slapped on top). If anyone has a good pollen tutorial or example repo, I'd _love_ to know of it.
- laurent123456 6y agoIndeed I guess there are so many SSG because it's so easy to create one. In fact it might take as much time or even less to build one than it does to learn all the quirks and bugs of an existing one.
- remexre 6y agoYep, I got frustrated with Zola, ended up maintaining a couple patches, and eventually ended up writing my own (ad hoc, not generally usable) SSG...
- southerntofu 6y agoHello, i'm curious about your patches. Do you believe they could be useful for other people? Would you be willing to help upstream them? I'm happy you coded your own SSG, and if you're happy with it it's cool, but maybe your painpoints with zola are valid for other people as well and we could try to fix them for everyone :)
- remexre 6y agoAlready tried; patch that lead to the fork was "not adding this feature," sadly.
- the_arun 6y agoWe don't need to create one if we do not like Hugo. There are other SSGs like Hugo. Jekyll, Gatsby, etc., More here https://jamstack.org/generators/ https://jamstack.org/generators/
- chrisweekly 6y agoNextJS is (by far) the best of the bunch, because it isn't limited to SSG.
- proyb2 6y agoThey are not the right comparison, but we get your point.
- chrisweekly 6y agoPlease explain how it's "not the right comparison". The parent listed static site generators including Gatsby, Hugo, and Jekyll. I suggested NextJS is a superior option to those 3, because (among many other things) it supports "export" of a fully static, pre-rendered site, which puts it -- unambiguously! -- in the "JAMstack SSG tools" category. So I'm baffled by the downvotes, and your dismissal. What am I missing? Thanks in advance! PS Edit to add: NextJS is even listed, as the 1st result, in the parent's jamstack link!
- aendruk 6y agohttps://github.com/vercel/next.js/issues/5054 https://github.com/vercel/next.js/issues/5054
- chrisweekly 6y agoThanks, @aendruk -- ok, that issue is a legit reason for some people, in some cases, to prefer a dedicated SSG-only tool over NextJS. But it's not a reason to leave NextJS off the list altogether.
- CJefferson 6y agoPersonally, all I want is a full proper programming language in my templating. Every templating language ends up being irritatingly limited, for me at least.
- dukeyukey 6y agoCareful, you might end up with PHP.
- mikepurvis 6y agoI think that's the big divide in templating languages— whether or not you trust the template author. Zero trust is a template like Liquid which has some trivial scripting stuff, but nothing non-halting (written originally for Shopify, where storefront owners could completely customize their look & feel). And total trust is PHP. In the middle is the whole realm of somewhat-trusted, where the templates can embed varying degrees of executable script, but you are at pains to let users know that too much embedding is a bad practice, and that especially if they're "just a designer", they should work with someone from software team to implement a properly-encapsulated solution for whatever it is they want to do.
- ibraheemdev 6y agoJSX seems to fit that bill, and many other languages have a comparable library.
- xfer 6y agoracket scribble might be of interest to you. https://docs.racket-lang.org/scribble/ https://docs.racket-lang.org/scribble/
- chrisweekly 6y agoJSX (or even MDX) might fit the bill!
- Yoofie 6y agoI use PHP for exactly this reason. I wrote my own single .exe binary (written in C++) that generates JSON files from markdown files + others. The JSON files are then turned into static files via PHP using whatever template I care to create. I think people their life harder when they go out of their way to avoid using PHP when really it is suited towards these types of problems.
- Lammy 6y ago> It works at first, but you end up wanting to design your own custom SSG once you run up against something that goes against your mental model of how things should work. There is a middle ground. I hit this point in Jekyll when I wanted Insanely Great image thumbnailing that no extant Jekyll plugin could provide, ended up writing my own tool to do that, but didn't want to duplicate the rest of Jekyll's functionality too. It's kiiinda hacky and I probably should propose the interface changes upstream if I keep doing this, but a very light monkey-patch lets my tool pretend to be a Jekyll::StaticFile that just happens to write out many separate files: https://github.com/okeeblow/DistorteD/blob/master/DistorteD-Jekyll/lib/distorted-jekyll/monkey_business/jekyll/cleaner.rb https://github.com/okeeblow/DistorteD/blob/master/DistorteD-...
- jacques_chester 6y ago> The other thing that tends to happen with SSGs is that it can be a lot more fun to play around with the tech than actually writing blog posts! This has been my experience also[0]. Instead of writing I wound up a side quest to see if I could get Project Mallard[1] to do what I wanted. [0] https://twitter.com/jacques_chester/status/1344034012608618496 https://twitter.com/jacques_chester/status/13440340126086184... [1] http://projectmallard.org/ http://projectmallard.org/
- brainzap 6y agoI use hugo but a script that converts my folder based writing style to Hugo markdowns, before build
- brundolf 6y agoThe thing about an SSG is that it's so trivial to write your own (at least for the basic cases). And then you may well get more benefit after that point from retaining the ability to customize it than you would from having a generalized one that you need to wrestle toward your use-case It's something that feels highly generic, and so programmers jump on the chance to genericize it, but may not actually be that useful to have as a thing you can grab off the shelf
- temp8964 6y agoIf you really want to focus on writing, why don't you just use WordPress? My feeling is that SSG is a toy to play with. I had a SSG blog before. After stop using it for half year and came back, I found I had to relearn the whole thing to be able to make it work again. Add any function is a PITA. Totally wasting of time.
- bccdee 6y agoYou have to relearn it if you want to create a new theme for it. If you want to focus on writing, you just put new markdown files inside the post folder. Not to mention that wordpress isn't static, which makes hosting more complicated & expensive.
- temp8964 6y agoMy two cents are blogging through static hosting is more complicated than wordpress on basic php hosting. I need the email hosting comes with the $3/month web hosting anyway.
- southerntofu 6y ago> why don't you just use WordPress? Making a Wordpress theme is more complex, and is full of footguns for security concerns. The fact that using a specific theme can open security issues server-side is worrying to me. I want my server to serve files without having to worry about security vulnerabilities. That's why i use a SSG (zola).
- Keats 6y ago> I though this was about the wedding registry site at first. I didn't even know what a wedding registry was until after the rename. It is named after https://fr.wikipedia.org/wiki/%C3%89mile_Zola https://fr.wikipedia.org/wiki/%C3%89mile_Zola > I did this exact thing when I got frustrated with Hugo. I made my own custom SSG in order to create my blog. > The other thing that tends to happen with SSGs is that it can be a lot more fun to play around with the tech than actually writing blog posts! Exactly that. A great way to learn a language too.
- pembrook 6y ago> The other thing that tends to happen with SSGs is that it can be a lot more fun to play around with the tech than actually writing blog posts! I wish I could remember the link, but there's a fantastic XKCD-style cartoon making fun of over-engineered static site generator blogging setups. When you build a static site, basically there's a 99% chance your only blog post is going to be "How I rebuilt this blog in [insert] static site generator."
- spf13 6y agoI did this exact thing when I got frustrated with Jekyll (and friends) and created Hugo. Of course, at the time all SSGs were in dynamic languages and very VERY slow. Happy to see some Hugo ideas made it into Zola.
- waterside81 6y agoHey - thanks for making Hugo. We run our blog on it and I love it. Spitting out an AMP version and maintaing it side-by-side with our non-AMP version was a piece of cake. Edit: noticed you make Cobra too! Damn - I owe you like 1000 man hours of saved work.
- regus 6y agospf13, thank you for your vim config, I have been using it for years! In regards to Hugo, I enjoyed using it at first, I loved how fast it was, but I kept running into issues so I decided to make my own SSG.
- kcartlidge 6y agoI know the feeling. In my very meta case I get frustrated with my own SSGs, so every time I start learning a new language an SSG is one of my two standard projects to give a frame of comparison. I now have my own SSGs written in C#, Go, Node, Python, Ruby, and PHP. It's totally ridiculous, I know. Yak shaving and shiny to the nth degree.
- mbreese 6y agoThat makes a lot of sense to me. It used to be that writing a blog engine was the "Hello World" of a new language or framework. So, it makes sense that a SSG would be a good non-trivial project to use to learn or understand the pros/cons of a language.
- ci5er 6y agoI prefer ray-tracers (or other rendering or physics engines), maybe because I'm old or have nothing to blog about.
- valvar 6y agoWriting a blog post about how you enabled the writing of that blog post is the most fun part! I just happened to write my own today in a very similar vein [0]. I guess using webhooks to automatically deploy might be pretty obvious, but I didn't know how to do it until today. [0] - https://vnord.net/post/hugo/ https://vnord.net/post/hugo/
- TeMPOraL 6y agoYeah, I wrote two. And I think my next SSG will be a Makefile, because generating HTML is the easy part. The tough part is tracking dependencies and xrefs, which I also think are the tough part of any build system (SSGs themselves are a subset of build systems). That, and coming up with a good design for the page.
- hexanal 6y agoI'm doing the same thing but I wonder if I should even write something about it, hehe Seeing all those HN posts about new static website generators and then your post makes me think that the important thing here is the concept of it, rather than specific implementations. I kind of like the multitude of options because it tells me that there's demand for that stuff, and we're all trying to find the most elegant solutions. As a webdev, I'm happy to admit I'm not a programmer. I just dump some data in HTML templates, sprinkle some CSS and JS, while trying to give devs, editors, and users the tools to manage/navigate a website without much pain and suffering.