Wordpress import + custom CSS + newbie = help!

Something that I hope it’s trivial to answer, but I have experience of just a few hours in Jekyll, so…

  • I have a wordpress site, that I exported and imported successfully in Jekyll. I did that by doing “jekyll new .” and then importing using “require “jekyll-import”; JekyllImport::Importers::WordpressDotCom.run({ “source” => “wpexport.xml”} )” in irb
  • In some blog posts in the wordpress site, I have youtube embeds that don’t get imported correctly, so they need a bit of custom CSS. I have a lot of youtube embeds in a lot of blog posts, so I want to write the CSS once.
  • The default jekyll site uses minima theme, so I don’t have direct access to layout/css.

Newbie question: Where do I specify some additional global CSS, on top of any installed theme, that can be used by all blog posts? In what magic file does that CSS live?

The Minima 2.5 customization doc can be found here: GitHub - jekyll/minima at 2.5-stable

Simplest method is to copy Minima’s assets/main.css into your site and customize it:

Aha! Thanks, that was very helpful. So, this “main.scss” is that magic I was talking about. I had some scss already: in /assets/css/styles.scss, but it wasn’t getting picked up. But I just moved/renamed the file to /assets/main.scss and now it works!

Next very low-priority question for whoever has time is, where could I find such information, that “main.scss” is magically applied to everything if you create it and put in under assets? Well, I assume it does at least.

Working with themes can be a little awkward, because a true “Jekyll Theme” is likely not going to appear anywhere on your site. It is even more awkward when someone says “my site isn’t working, can you check it out?” and you see styles and other things that do not even exist in the folder structure.

The idea with themes is they can be separated from the website you are creating, making it easy[er] to change themes or receive updates from the theme developer.

Of course, you can bring the theme local to your repo so you can modify it in any way you want, just know that the original theme developer’s changes may not come through because you are basically overriding all their files.

It is a bit of a read, but I highly recommend you take a short coffee break to understand the thinking here on the Jekyll site:

I also created a little video on themes that you might want to check out here:

1 Like

Thanks Bill, that’s useful, I did read and skim/watch the video! I still have a bit of trouble though understanding how things work, but I’ll start another post as it’s a separate issue…

1 Like