Live data from Hacker News

Show HN: SQLite Plugin for Jekyll

github.com

41–50 of 70 posts

Re: Show HN: SQLite Plugin for Jekyll

#41

I wish if there was some hugo alternative to it , I guess I am going to go into the weeds of this project to replicate it in golang

Hugo more or less is "Jekyll, replicated in Go".

The core problem you will run into is that Go is a very static language, and Ruby is a very dynamic "free for all" language. Obviously up- and downsides to both approaches, but IMHO Ruby is clearly a much better fit for this sort of thing. On my own Jekyll website I do syntax highlighting with Vim's :TOhtml. I like how my Vim looks and I know how to tweak Vim syntax files. Kind of crazy I guess, but it works, and it's actually very little code. I would be hard to replicate this in Hugo, or any other Go-based site generator.

Similarly, doing a plugin like jekyll-sqlite will be hard. You can bake it in of course, but people experimenting with random stuff like this? Not going to happen with Go.

Not that Hugo can't be improved on by the way – I have generally found using Hugo to be highly complex and a forest of weird confusing errors that don't make much sense. But you will never really replicate Jekyll in Go.

I like Go. I have written tons of Go code over the last 10 years. But for some things it's just not a great fit, and this is one of those things.

Re: Show HN: SQLite Plugin for Jekyll

#42
post #18

I'm a little confused. The baked-data model is so you DON'T have to generate a thousand static pages. But this solution does exactly that. Not complaining, mind you. My kid is trying to learn HTML/CSS/JS and wants to put together a read-only website with a database backend. I'll be pointing him this way as an ootion once he's far enough. But it's still puzzling to link it to baked-data. Maybe I'm missing something.

> bundling a read-only copy of your data alongside the code for your application, as part of the same deployment You can see https://github.com/captn3m0/northwind for example, which bundles the entire database alongside the code in the _db/northwind.db file. While Simon considers it primarily for dynamic apps, you have the ability to build PWAs and other interesting apps with the baked data pattern. I'm building blr.…

But it's still not baked data, no? The whole point of baked data is that you don't generate static pages for every item in the data set.

Mind you, it's great to have a Jekyll plugin to do that from sqlite, it's just confusing when you call it baked data.

Re: Show HN: SQLite Plugin for Jekyll

#43
This is a cool approach to integrating SQL with static site generation!

If you're into SQL-powered tooling, you might find something like https://sql-page.com interesting as a comparison point. It flips the model by letting you create dynamic web apps entirely in SQL, skipping the static file generatio step.

Anyways it's really nice to see new tooling removing a lot of the plumbing work needed to go from database to website.

Re: Show HN: SQLite Plugin for Jekyll

#44

In wake of all the WP craziness a few weeks back, I wonder how long before someone builds a "best of both worlds" CMS to rival WordPress. "You get the nice admin UI, but it generates a static site" type of thing.

There are a lot of those. Even Wordpress has a solution for that where it generates a static site.

Re: Show HN: SQLite Plugin for Jekyll

#46
This is welcome news! I already use spreadsheets and SQLite as part of my Jekyll workflow. I import spreadsheet data into SQLite, create some additional tables, and export them to CSV files. Jekyll ingests CSV files automatically and makes them available via Liquid. I look forward to learning more about this project.

Re: Show HN: SQLite Plugin for Jekyll

#47
post #35

Is it possible to generate an SQLite DB from the site data and statically serve it, so sql.js can use it as a DB to provide something like search?

I'm mostly focusing on sqlite-as-the-data-source, but I can imagine something like this might be in scope for a project like lunr.js[1], which currently uses a large index served as JS/JSON. You can write a Jekyll plugin in a few lines of ruby code (with no gem management needed, just drop it in the _plugins directory), so the "write-index-to-a-sqlite-file" part shouldn't be hard to build either. Is FTS5 included in…

Lunr.js isn't really being developed anymore from what I remember. I switched from Lunr.js to SQLite FTS in browser myself. I'm using sqlite-wasm-http [0], which uses range requests to only pull relevant pages of the static database as needed. Though if your search query is short enough, it'll probably pull the entire FTS table anyways.

[0] https://github.com/mmomtchev/sqlite-wasm-http

Re: Show HN: SQLite Plugin for Jekyll

#48
I have an understanding of static site generators, I've used several of them and even written my own. But I simply don't understand what this is or what it's doing. You're using a sqlite database during site generation time instead of .md files? You're definitely not querying the db at serve time right? I'm so confused...

Re: Show HN: SQLite Plugin for Jekyll

#49

I have an understanding of static site generators, I've used several of them and even written my own. But I simply don't understand what this is or what it's doing. You're using a sqlite database during site generation time instead of .md files? You're definitely not querying the db at serve time right? I'm so confused...

Maybe I'm just not understanding the novelty of the concept. No one has done this before? That's very hard to believe.
Post reply on HN