Switch Theme in an Existing Jekyll Installation

Switch theme in an existing Jekyll installation

While you could migrate to an existing installation by forking a new theme and then manually copy and pasting over resources like CSS, JS, HTML in the _includes, _layouts and other files you may need, this probably isn't a great idea as you end up having a mash up of old and new resources, which may not be of the same name, but in the scenario that they are (for example you didn't overwrite an old stylesheet that your post references), it will cause mixed up CSS styles that you'll have to debug and slowly fix.

Since I'm assuming you have a Jekyll install with Git (if you don't you really should), you could create a branch called new-theme and switch to that branch from the master as the working branch. (A simpleton way of having something like this is to just copy your entire Jekyll install and paste it elsewhere as old-Jekyll-install if you don't want to deal with Git branches (but really, you should. Here's a tutorial that helped me learn)

  1. Pull down the files for the new theme.
  2. Manually copy over _posts and your customized changes.
  3. Port over your _config.yml by manually comparing them and moving over what is necessary.
  4. Build the site and see what you're missing, what might be messed up (for example in the past you might have added a few <br \> tags for spacing and you don't want that in the new theme).
  5. Merge with master (or push it to production)

That being said all this is fairly manual and a pain, but at least you won't have to deal with conflicts in resources. The downside of doing this though is that your repository won't be synced with the theme repo. So you won't get upstream updates. I would still suggest that you fork the theme repo, port over your personal customizations for your Jekyll site, and then rename that repo for production. (this would of course no longer be using the 'existing' Jekyll installation)

how can I change jekyll theme name when I searched my github blog?

https://ryankor.github.io/ still display the correct name, "Ryan's Tech", as defined in your _config.yml.

Check "Switch theme in an existing Jekyll installation": your _config.yml seems to be missing a theme: jekyll-theme-hideout line.

How do I install one of Github Pages' Jekyll themes for local preview?

Follow these steps after changing the theme in _config.yml:

  1. Gemfile should have only this content:

    source "https://rubygems.org"
    gem "github-pages"
  2. remove bundler current config: rm -r .bundle/

  3. remove Gemfile.lock: rm Gemfile.lock

  4. Install local dependencies in an isolated folder just for this website: bundle install --path=vendor/bundle

  5. You won't have post and page and home themes, you will need to use just default in all your posts.

  6. Generate and run server: bundle exec jekyll s

how do I install a theme using Jekyll 3.1 and octopress plugins?

Generally, the best way is to fork the theme, and copy over your content in the _posts folder, and your _config file, as per this answer.

It would also be possible to copy over the theme files into the _sass, css, _includes and _layouts folders, since this is where the theme rests, but this would mean a) more work and b) you can quite easily mess it up. Oh, and the js folder, the index.html file, any other pages not using the page layout...

Ultimately, Jekyll is not like Wordpress; It's not easy to just drop in a new theme.

Change theme of my github pages, and pages are empty

Each Jekyll theme has a different set of layouts.

The default theme comes with four layouts:

  1. default
  2. home
  3. page
  4. post

While other layouts can have the same ones or a different set of layouts, in this case the other theme you chose only has one layout, that honors the minimal section of its name (jekyll-theme-minimal):

  1. default

The default installation comes with few examples using different layouts, if you change to the jekyll-theme-minimal you only have one layout available (unless you add more by yourself).

Is there any way to install or covert jekyll themes into hexo?

You won't be able to convert jekyll themes to hexo directly since they are two completely different tools , they even use different languages jekyll is built using ruby so it's plugins are built for ruby to while hexo is built using javascript.

But since themes at the end of the day are just a bunch of html, css and js files that are edited to get the markdown in them while generation you can rip that from an existing jekyll theme and try creating a hexo theme using the same html css and js .



Related Topics



Leave a reply



Submit