Nicolino, a static site generator

You can see it in action at https://nicolino.ralsina.me and of course GitHub - ralsina/nicolino: A not-quite-minimalisting SSG written in Crystal

Yes, there are hundreds of these, and yes, there is no reason to use this specific one. I have not even migrated my site!

BUT:

After a long time I have resumed work on Nicolino.

A lot of effort was spent on making it fast and correct, which then implied a lot of fixes in ralsina/croupier because this exercises it a lot.

How did it turn out?

  • Nicolino’s site, including image galleries, thumbnails, mdbook-style books, blog posts about releases and so on, builds cold in under a second in my machine.
  • Same site, if there are no changes, “builds” in about 0.2 seconds
  • A 4000-post benchmark site builds in roughly 0.65 seconds (optimized binary) to 1.7 seconds (normal build)
  • Hugo, the “standard” for fast static site generators, builds the same 4000-post site in 0.9 seconds, so Nicolino is about 30% faster (see benchmarks

I am specially happy with the mdbook-like implementation, which you can see in the User Guide and the import command that lets you integrate 3rd-party feeds into your own site (in this case, it pulls GH releases feed into the main site here)

I think it’s basically in good shape and more or less feature complete :-)

This looks great - and I’m keen to try it as it seems perfect for my use case. I believe the release is for linux, and I’m on Mac, so I’ve just cloned down the project and done a shards build and found at the last build step, I see the following error:

Error target nicolino failed to compile:
Showing last frame. Use --error-trace for full trace.

In src/commands/auto.cr:60:19

60 | watcher = Inotify::Watcher.new(recursive: true)
^---------------
Error: undefined constant Inotify::Watcher

--

edit: I’ve found a fix, and made a pull request.

Hey, nice to hear!

Thanks for the bug reports, I am getting to them soonish :-)

After 14 years my site is now migrated from Nikola to Nicolino

For context, it’s over 26 years, thousands of images and posts, and stuff.

Nicolino builds it from scratch in about 25 seconds :-)

I’m trying out Nicolino to create a site deployed to GitHub Pages using GitHub Actions. Of course, I could use Jekyll, but I’d prefer to use tools made with Crystal if possible.

name: guide

on:
  push:
    branches: [main]
    paths:
      - "guide/**"
      - ".github/workflows/guide.yml"
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - name: Configure GitHub Pages
        uses: actions/configure-pages@v5

      - name: Install Nicolino
        run: |
          wget https://github.com/ralsina/nicolino/releases/latest/download/nicolino-static-linux-amd64
          chmod +x nicolino-static-linux-amd64
          sudo mv nicolino-static-linux-amd64 /usr/local/bin/nicolino

      - name: Build manual
        working-directory: guide
        run: |
          nicolino theme install terminal
          nicolino build -B -p

      - name: Upload Pages artifact
        uses: actions/upload-pages-artifact@v5
        with:
          path: guide/output

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v5

Neat! Would it be helpful if I hosted a reusable action for this?

No, I don’t think that’s necessary because this workflow is simple enough.
Instead, I’d prefer it if you could expand the sample pages for each theme. For example, it would be great if we could see at a glance how the “gallery” and “books” look in each theme.

Cool