Not able to add class="CodeRay" in Octopress - jekyll

I am using kramdown in Octopress for a while. I wanted to add CodeRay to my Octopress. I installed coderay.
➜ octopress git:(source) ✗ sudo gem install coderay
Password:
Successfully installed coderay-1.0.9
1 gem installed
Installing ri documentation for coderay-1.0.9...
Installing RDoc documentation for coderay-1.0.9...
I changed _config.yml
markdown: kramdown
kramdown:
use_coderay: true
coderay:
coderay_line_numbers: table
coderay_css: class
I have added sass/custom/_coderay-github.scss and I can see them in my CSS.
I used the followings but none of them added tag to my html so that it does not render CodeRay css.
~~~
def hello
puts "hello world"
end
~~~
{:lang="ruby"}
Indented:
puts "hello world"
{:lang="ruby"}
Could anyone tell me how to add CodeRay to my Octopress?
I am following this post.
Thank you in advance.

Ok, I found the answer in this page.
~~~
def what?
42
end
~~~
{:.language-ruby}
Or
~~~ ruby
def what?
42
end
~~~

Related

Why is my completely new Jekyll blog blank when I add the supported Hacker theme?

I am trying to get started with a Jekyll blog. I followed these instructions to setup the blog using the default minima theme. This actually worked without any problems, but I wanted to change to the Hacker theme. To do that it simply asks for the following changes to me _config.yml:
remote_theme: pages-themes/hacker#v0.2.0
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
After making these changes I went to the URL https://galenseilis.github.io/ where I see that nothing renders anymore.
The current state can be observed at https://github.com/galenseilis/galenseilis.github.io, but everything should be the default values except where I made changes to the Gemfile and _config.yml. But since I may change the content of the repo as I troubleshoot, so here is a snapshot of these files:
Gemfile
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 4.3.2"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
_config.yml
title: Your awesome title
email: your-email#example.com
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll
# Build settings
# theme: minima
# theme: jekyll-theme-hacker
remote_theme: pages-themes/hacker#v0.2.0
plugins:
- jekyll-feed
- jekyll-remote-theme
Reverting the recommended changes for the Hacker theme back to the original state using minima theme returns the rending of the page. So maybe the changes I have made are insufficient if not incorrect somehow?

Running Jekyll Blog on Windows Hosts at http://127.0.0.1:4000C:/Program Files/Git/blog/

I created a new blog using Jekyll and would like to host it on GitHub Pages. Before I push the changes, I want to preview the site locally on a Windows 10 box. The problem is Jekyll is hosting index.html under the URL http://127.0.0.1:4000C:/Program Files/Git/blog/ and the assets under http://127.0.0.1:4000/assets. For some reason it is appending C:/Program Files/Git to the path for index.html.
I expect it to host under http://127.0.0.1:4000/blog. Any ideas as to what I'm doing wrong?
See the Bash output below. Notice the server address and the errors attempting to download assets.
_config.yml
title: Testing 123
email: testing123#gmail.com
description: >- # this means to ignore newlines until "baseurl:"
Blog Description
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: testing123
github_username: testing123
show_downloads: false
google_analytics: UA-00000000-1
repository: joebuschmann/joebuschmann.github.io
# Build settings
theme: jekyll-theme-minimal
plugins:
- jekyll-feed
Gemfile
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
#gem "jekyll", "~> 4.0.0"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
#gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?

Jekyll generator not loaded

I currently experienced an issue with Jekyll generators. Just implemented one regarding AMP. So I placed it inside the _plugins folder, and named it amp_generate.rb.
Tried to add some puts 'foo' but nothing on my terminal...
Giving a look at jekyll serve -V, it seems the generator never appears...
Any idea? Here is the source code : https://github.com/tiste/www
You're running in safe: true mode (like on github pages) because gem 'github-pages', group: :jekyll_plugins instruct jekyll to run in github pages context.
Simply change to gem 'github-pages'.
You can even simplify your Gemfile to be :
source 'https://rubygems.org'
ruby RUBY_VERSION
gem 'github-pages'

Liquid syntax error for 'gist' tag with github-pages gem for Jekyll

I have a Jekyll site that is hosted on Github Pages. I am trying to get my site to render locally before I push to Github, but I get the following error when running bundle exec jekyll serve --safe:
Liquid Exception: Liquid syntax error (line 13): Unknown tag 'gist'
My _config.yml contains the following (among other things):
gems:
- jekyll-gist
My Gemfile is as follows:
source 'https://rubygems.org'
gem 'github-pages'
And bundle show jekyll-gist shows a path to the gem that is installed.
I'm stumped!
The --safe argument means "Disable custom plugins, and ignore symbolic links", which means it will ignore the jekyll-gist gem.
https://jekyllrb.com/docs/configuration/
You can get around this by amending your _config.yml to match what Github will use when rendering your site on their servers.
github: [metadata]
kramdown:
input: GFM
hard_wrap: false
gems:
- jekyll-coffeescript
- jekyll-gist
- jekyll-mentions
- jekyll-paginate
- jekyll-redirect-from
whitelist:
- jekyll-coffeescript
- jekyll-gist
- jekyll-mentions
- jekyll-paginate
- jekyll-redirect-from
I have pieced this together from a few different sources. Too bad they don't explicitly tell you to do this.

Getting an error with Jekyll serve

Have basically nothing but a _config.yml and index.md file, and when running jekyll serve I'm getting this:
D, [2015-07-08T10:33:29.810161 #14194] DEBUG -- : Celluloid 0.17.0 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
jekyll 2.5.3 | Error: wrong number of arguments (2 for 1)
Please help!
I'm not 100% sure this is the answer for you since I wasn't using Jekyll but I had the same error when I was trying to use compass watch.
Rolling back both Celluloid and Listen did the trick for me.
I added the following to my gemfile:
gem 'listen', '<2.10.0'
gem 'compass', '<0.17.0'