Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Bearclaw – tiny static site generator with RSS (github.com/donuts-are-good)
101 points by lagniappe on Feb 26, 2023 | hide | past | favorite | 23 comments
hey yall, I made bearclaw because I just wanted an unopinionated static site generator with no toolchain and fancy stuff going on; it'd be my pleasure to show it to you today and answer any questions you might have.

If you do end up trying out bearclaw, you can use nginx or your favorite webserver. Earlier this week I made eclaire - a static site webserver with compression, caching, and automatic HTTPS through letsencrypt. https://github.com/donuts-are-good/eclaire



> tiny static site generator w/ rss https://bearclaw.blog

bearclaw.blog redirects back to source repo[0] on GitHub.

Should not it be a redirect to GitHub Pages site?

[0] https://github.com/donuts-are-good/bearclaw


I got really frustrated with Hugo yesterday when I couldn't add a page with just a list of all my posts on it. I spent a few hours playing around with a bunch of different options, Hexo seemed to come the closest to something I could fire up and just drop my existing markdown in (though it did blow up on a youtube embedded player I had in one post).

Bearclaw does look super simple to get going, but seemed to be missing a few things I was hoping for:

  - No real documentation, so I copied my markdown files over.
  - Ran bearclaw and put the output in a web accessible location.
  - Went there and there was no index.html (though "home" on the "posts" page seems to link to it).
  - The "posts.html" page just has filenames, so it doesn't seem to pick up the frontmater.
It's definitely leaning in the direction I was looking for, but maybe a little too far. :-)


> I got really frustrated with Hugo yesterday when I couldn't add a page with just a list of all my posts on it.

I know you weren't asking for solutions but I'm surprised to hear this. That should not only be trivial but is something that ships by default when you init your site. For example this should be enough on your list page:

    <ul>
      {{ range .Pages }}
        <li>
          <a href="{{ .Permalink }}">{{ .Title }}</a>
        </li>
      {{ end }}
    </ul>


Thank you for the suggestion. When I was searching for solutions, I got a lot of snippets like yours, but I couldn't for the life of me figure out how to turn a snippet like that into a page on the site. The best I ever got was a markdown page that was a copy of the "about.md" page, but I couldn't get that to show anything but static content.

I created this 3-4 years ago, hacked on it some to get it where it is, which I tried not to be too crazy. But maybe I just munged it up somehow. Maybe I just need to start over again with the latest Hugo and get brained up. Hugo has nice documentation, but it fairly quickly goes from "put a few markdown pages here and run hugo" to "read the rest of the book". Which is probably just the nature of the beast.


> When I was searching for solutions, I got a lot of snippets like yours, but I couldn't for the life of me figure out how to turn a snippet like that into a page on the site.

Completely understand. If this is helpful, the way Hugo works (and the way many static site generators work) is that you make a template for each kind of page that you want to appear in the final output. A typical blog might have, say, three templates: a template for the homepage (show a quick bio and your most recent posts), a list template (show all your post titles and links), and a post template (show one post at a time).

When you generate the site, your content will be processed through the templates. For a typivally sized personal site this happens in under 100ms.

In Hugo, when you initialize a new site, these templates will already exist for you, so you won't have to write them, though you can of course edit them. (The out of the box defaults also include other kinds of things you might or might not care about, like tags or categories.)


Thank you, that description is very helpful and clarifies some things in how the "layout" in the frontmater influences the page.


I took it to mean not a list of post _titles_, but a full output of posts on a single page (a la DaringFireball).

I tried to do the same not that long ago (was just starting to toy around with Hugo) and could not find an easy solution to it.


Wouldn't that be similar to the parent comment, but outputting `.Content` in the range loop?


Yes, you got it.


https://github.com/piranha/gostatic & https://github.com/getzola/zola are two other single binary alternatives.


Thanks for the pointers, I tried them both. Gostatic is super simple, but probably too simple. It's quite a step up in power from Bearclaw, and has all the parts to be able to make a good blog, but the parts are all pretty basic and if you want anything very fancy you're going to have to custom build it. Think "main page is <ul> of page titles and date". Also didn't seem to have a way to specify a base URL so everything needed to be at "/" in the resulting site, a little tricky for testing.

Zola looks like a good fit, almost as simple as gostatic, but with a lot of templates (though many kind of stale, many I couldn't get working, but I think the template largely dictates the install, so switching between themes really is a bit of work).

Hexo looks like the quickest way to a fancy looking site, though it is more effort than Zola. I'd lean towards Zola.



I'm definitely going to have a look at this. I was just comparing hugo, soupalt, jekyll and zola for a tiny geocities-ish blog site, and will add that to the list.

I do feel rather old when I see 3 megabytes described as tiny, though ;)


You should add Astro to the list, there's no JS sent to the browser at all until you specifically add JS.


Have a look at https://bearblog.dev



Hello all, thanks for checking out my project! For those of you trying out Eclaire right now to host your Bearclaw site, I'm getting a weird 500 error right now that I probably introduced in the last day or two, and I'd bet you guys would too. I'll do some thinking about it tomorrow and see what I can do to smooth it out. Bookmark it and hang in there, or chime in on the issue I made to remind me to fix it, and we'll see you soon!


I have interesting RSS feeds to put it on display for my communities. Can I do it with this tool. Basically a neat display of feeds i generate.


For someone completely unfamiliar with GO, how do I install this or where should I get started?


Hey there, thanks for asking. There are precompiled versions of it so you can run it like an .exe if you want to.

You can grab one of the binaries here [0] for your system, then put your markdown content in the markdown folder that bearclaw makes when you run it the first time. Bearclaw puts the html it generates in the output folder. If you want to, you can tell markdown to just keep an eye on the folder and it will generate the output as you make it, like if you have a webserver pointing at your output/ folder.

From there it's up to you, you can put it on github, or use your own server with nginx or apache or caddy.

[0] - https://github.com/donuts-are-good/bearclaw/releases/tag/1.1...


Looks cool! What are it's advantages over hugo?


Hey thanks for looking :) hugo has a lot more moving parts, and a lot more dependencies [0]. bearclaw is written to be simple and easy to understand without instructions or learning any new paradigms about templating or frontmatter or other markup languages.

[0] https://github.com/gohugoio/hugo#dependencies


Not using a template language and avoiding to do error handling are not good ways to make a program "simple and easy to understand".

If your users run into one of the many string escaping bugs or get an unexpected error code from the file system, the program will not behave as expected and not detect the error either.


[deleted]




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

Search: