When I'll grow up I want to know how relative image links work in posts when deploying jekyll to github.

· · Web · 2 · 0 · 1

The problem was that `jekyll-postfiles` doesn't work on github deployments.

@jimmac I figured this out before. I had some some hacky stuff to make links just work perfectly in every case too, including links referring to root / and got it working with subdir installation transparently too.

It's all the stuff that starts at this line and goes below:

(Doing stuff in Liquid can be funky, as it's so limited. But it all compiles down to static, so it's OK enough.)

@jimmac I have all my hacks and such pushed up to for a non-Cockpit repo to fork from for other projects too, FWIW.

@jimmac I also wrote a search engine tokenizer that compiles down to a JSON database and a JS parser and formatter. It all does the right thing to basically make it a custom search engine that works with plain Jekyll and is GitHub Pages compatible. It does ranking, has related words, is linkable, and supports keyboard navigation.

And this is all done automatically. No need to do anything special.

It's probably worth looking at. 😉

See it in action at

@garrett Sounds like something I'm not even going to attempt to make work. ;)

@jimmac FWIW, I also set up the 404 to break down the URL and do a search too.

@jimmac Perhaps I should check out your repo, copy the files over, and send a PR?

@garrett The problems I suffer don't come from different paths on the test and deployment server, but from the desire to keep images along with posts, because separating assets means inevitably after decades you'll end up with broken images and images with no article. I really want that `jekyll-postfiles` behavior

@jimmac Aha. That's tricky to make it work in the site and in the editor.

If you do live previews and have pretty URLs turned on, I *think* you can make a directory that has the same name as the filename minus the extension, toss the files in there, and reference them without any prefix.

They would show up as broken images in your Markdown editor's preview though. But they should show up correctly on the site (and Jekyll in preview mode).

@jimmac I also have some scripts that use toolbox to set up and run the environment for you locally, so you don't have to pollute your workstation with Ruby.

It works on normal Fedora and also Silverblue.

@garrett Yea can't live without toolbox. Although I've recently found out brew exists for Linux as well now :)

@jimmac Yeah, I played around with brew in a toolbox. I also have a toolbox container that runs Debian and another with Ubuntu inside. But my main development toolbox container is Fedora 33. 😁

@jimmac I also have an Atom feed too. The one on the Cockpit website has some tiny path fixes (for image URLs and internal links) I need to port back to Springboard repo, FWIW.

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!