Hacker News new | past | comments | ask | show | jobs | submit login

I tried Hugo a long time ago. I believe some of the features you mentioned did not exist at the time. Also if I remember correctly, I did find workarounds for most of what I mentioned with Hugo, but the workarounds felt really messy and inflexible. I didn't mean to imply some things weren't possible, I mostly meant to mention it as an example of a "structured" SSG (by which I mean ones that aren't very flexible with their routes or how content is organized, i.e. they enforce a lot of structure).

Regarding archives, the problem if I remember correctly was getting them to nest properly, not just a "/archive" with all your posts, but lists at "/year/", "/year/month/", etc. until you reached the post. So no path was empty. I don't think I ever got that working.

Regarding embeds, didn't know about embed.ly. Seems great, but it's not free. If there's some free alternative I will definitely use it next time around. One of the main reasons I use an SSG is to keep my costs close to 0.

> Yes, Hugo mainly supports Go Templating. (And I don't have any complaints against that :))

Maybe I'm weird, but I can't stand 99% of template languages. They're too watered down. I want the full power of a programming language, or alternatively, some easy way to manipulate the data the template gets. Correct me if I'm wrong, but I don't remember Hugo having the latter either.




> I mostly meant to mention it as an example of a "structured" SSG (by which I mean ones that aren't very flexible with their routes or how content is organized, i.e. they enforce a lot of structure).

I still don't understand this point. You are free to put all your files in a flat structure like:

    content/
      post1.md
      post2.md
But if you want structure on your site, just set a structure in the content/ dir, and that will be mirrored on your site:

    content/
      posts/
        post1.md
        post2.md
      about.md
> Regarding archives, the problem if I remember correctly was getting them to nest properly, not just a "/archive" with all your posts, but lists at "/year/", "/year/month/", etc. until you reached the post. So no path was empty. I don't think I ever got that working.

You will find many themes, at least right now, that implement "bread crumbs". Even searching bread crumbs in the Discourse forum will yield a lot of results.

> Regarding embeds, didn't know about embed.ly. Seems great, but it's not free. If there's some free alternative I will definitely use it next time around. One of the main reasons I use an SSG is to keep my costs close to 0.

I just arbitrarily threw that name out there. While I am not aware of 100% free API services, there are a few I know of that provide that service for free with rate limits.

See:

- https://docs.microlink.io/api/#introduction (this works with OpenGraph, Microformats2, JSON-LD, and a lot more) - https://www.opengraph.io/ (this works with only OpenGraph metadata)

> Maybe I'm weird, but I can't stand 99% of template languages. They're too watered down. I want the full power of a programming language, or alternatively, some easy way to manipulate the data the template gets. Correct me if I'm wrong, but I don't remember Hugo having the latter either.

What kind or degree of manipulation are you looking for. The replaceRE template is pretty powerful for my purposes.. I use it to insert anchor links next to headings as I don't like using JS solutions to do that.


My problem is the mirroring itself. I don't want, taking your example, /posts/post1 just because post1 is under posts. You can get around this with some SSGs but this doesn't change the fact that they're path oriented. For example, I think it was possible to turn this off in Hugo, but then you had to do some workarounds for specifying templates because normally the templates have to be aligned with the paths. Plus it has a bunch of weird separated page "types" (archetypes, taxonomies, etc)

For comparison I now use my own metalsmith plugin which is the opposite of these types of SSGs. It only relies on the post metadata. I can basically say, pick all posts that match x criteria, use x route (it can dynamically generate them based on metadata variables), use x template for this route, and set basic settings (posts per page, etc). All from one place. Files can be organized however I think makes sense. There aren't different types of pages or anything. The only "special" thing I had to do was for /year/month/date/ archives, but I plan to remove that exception with the SSG I'm writing now.

Regarding the archives, bread crumbs are not what I mean exactly. I want the pages to also be paginated. So /year/ is not just a list of links to all posts or links to all months, it should paginate the posts list for that year as well if they pass the posts per page limit. Seems like this has never been implemented, see this four year old issue I found: https://github.com/gohugoio/hugo/issues/448

> What kind or degree of manipulation are you looking for.

I often want array manipulations. For example, to create tag clouds. I'm sure it's possible, but I doubt it's pretty. With something like EJS, I can just have the logic in plain javascript, right above the div that iterates through it. I will grant you, I'm not sure this is the best solution. With the SSG I'm writing, I've been playing around with the idea of having a header or footer section in javascript for the templates, where you can run this type of logic and the variables will be available in the template. Kind of how when you use a JS frameworks (e.g. Vue which I love) if you have something complicated to iterate over, you remove the logic from the template. This would make simple templating languages attractive again.

Thanks for the links btw.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: