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)
- Pull down the files for the new theme.
- Manually copy over
_posts
and your customized changes. - Port over your
_config.yml
by manually comparing them and moving over what is necessary. - 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). - 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
:
Gemfile
should have only this content:source "https://rubygems.org"
gem "github-pages"remove bundler current config:
rm -r .bundle/
remove Gemfile.lock:
rm Gemfile.lock
Install local dependencies in an isolated folder just for this website:
bundle install --path=vendor/bundle
You won't have
post
andpage
andhome
themes, you will need to use justdefault
in all your posts.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:
- default
- home
- page
- 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):
- 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
Why Doesn't Ruby Have a Real Stringbuffer or Stringio
How to Check the Database Type in a Rails Migration
Difference Between Integer(Value) and Value.To_I
What Does "+=" (Plus Equals) Mean
How to Remove '---' on Top of a Yaml File
The Compiler Failed to Generate an Executable File. (Runtimeerror)
Why Can't I Access a Local Variable Inside a Method in Ruby
Detect Key Press (Non-Blocking) W/O Getc/Gets in Ruby
Selenium Scroll Element into (Center Of) View
How to Downgrade from Ruby 1.9.2 to Ruby 1.8.7 to Run Rails 2.0.2
Nokogiri - Error: Failed to Build Gem Native Extension
Is There a 'Pipe' Equivalent in Ruby
Elegant Chained 'Or's for Tests on Same Variable in Ruby
Selenium-Webdriver Ruby --> How to Wait for Images to Be Fully Loaded After Click
What Are <-- Ruby Strings Called? and How to Insert Variables in Them
Why Does Ruby String#Split Not Treat Consecutive Trailing Delimiters as Separate Entities