How to use remote theme?

Does anyone know how to use remote themes?

Have you read the documentation? They’re pretty straight forward if you ask me.

It doesn’t support GitLab.

Couldn’t you just use a Ruby gem theme? GitLab supports them. Remote theme is more of a way around GitHub not supporting 3rd party theme gems.

If given the choice I’d go with a Ruby theme gem.

How to convert a customized theme into gem?

Jekyll’s site is a good place to start with any of your questions. They cover how to convert a customized site into a Ruby gem.

If you Google around there are also several blog post tutorials out there if you need more direction.

And finally, take a peek at Jekyll’s default theme Minima’s source. About the only difference is the presence of a .gemspec file that defines all the theme’s info and dependencies.

I have created a Ruby gem, thanks @mmistakes.

But I want to ask should I keep the icons inside a gem. What’s your suggestion?

Not sure what you mean by icons. But if they are assets needed for the theme’s layout or UI then yes, bundle them in the gem.

Anything that isn’t user-generated or content related (posts, pages, assets for posts/pages) then you should bundle it in. This would be all layouts, includes, CSS, JavaScript, fonts, and images needed for the UI.

Here’s the screenshot of the _inclues directory, in which I have few icons and currently I have bundled them in the gem.

image

I have bundled them, what if user add his own icons? What will happen? Will it create some kind of conflicts? How to tell the user that there are icons already bundled inside the gem.

It won’t cause any conflicts. I suggest you read Jekyll’s full docs on themes (both Ruby gem and remote) work… it explains all of this well.

Any _includes and _layouts included in the theme can be overwritten locally. Meaning if for some reason I was using your theme and wanted to use a different version of your web.svg icon bundled in.

I could add my own version locally at _includes/icons/web.svg and Jekyll will use that instead. The same goes for any other include, layout, or asset you’ve bundled in the theme.

If the user wanted to add their own icons that aren’t in the theme bundle they can do that too. They’d just drop them into the appropriate folder and Jekyll will use them the same way as if you weren’t using a gem/remote theme.

All that’s really happening is Jekyll downloads the includes/layouts/assets from the gem/remote theme for you to use. Anything with the same path/filename in your local structure overwrites the bundled stuff.

1 Like

Hey @mmistakes,

Is there any way to add the option that when the users install the gem it add some files to the directory?