org-mode converter for Jekyll.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib change to array string concatenation Jan 12, 2018
script update release script Oct 11, 2016
spec change to gem format Oct 11, 2016
.gitignore change to gem format Oct 11, 2016
.travis.yml
Gemfile update gem file Jan 12, 2018
LICENSE
README.org Update README to fix minor errors Aug 26, 2018
Rakefile
VERSION bump version 1.0.2 Jan 12, 2018
jekyll-org.gemspec Regenerate gemspec for version 1.0.2 Jan 12, 2018

README.org

jekyll-org

Overview

This plugin adds Org mode support to Jekyll and lets you write posts and pages in Org.

Requirements

  • Jekyll
  • org-ruby

Installation

Short version

For experienced Jekyll users, you need to do 2 things to get jekyll-org to work :

  • Include the gem in your _config.yml
  • Include the gem in Gemfile

Long version

To use jekyll-org with Jekyll, you need to have Ruby RubyGems and Jekyll installed. See how to do that here.

Create a new Jekyll project my-site run:

jekyll new my-site

Create a Gemfile in the root of the project, and add at least the following lines:

source 'https://rubygems.org'

gem 'jekyll' , '>= 3.0.0'
gem 'jekyll-org', '>= 1.0.2'

Install the gems with bundler:

bundle install

To use the new converter add the following line to your _config.yml:

plugins: 
  - jekyll-org

Usage

Create a new file with .org extension in _posts, and write the post with Org. That is all! Generate your Jekyll site as you usually do.

Front matter

Instead of YAML the front matter is configured in the usual Org way, with no lines:

#+TITLE: Jekyll and Org together
#+LAYOUT: post
#+TAGS: jekyll org-mode

This is a blog post about Jekyll and Org mode.

Liquid templating

By default the all content is exported to raw HTML with org-ruby, but you can add #+liquid: whatevervalue= in the header. Then you can use Liquid tags.

For example, if your Org file contains

#+liquid: enabled
#+foo: hello world

{{ page.foo }}

or

{{ site.time | date_to_xmlschema }}

then you will get output like

<p>hello world</p>
<p>or</p>
<p>2014-07-02T08:20:28+08:00</p>

Source code highlighting

Add a source code block as you would in Org, for example Ruby:

require 'rubygems'
require 'org-ruby'
data = IO.read(filename)
puts Orgmode::Parser.new(data).to_html

Then the output will have code highlighting:

require 'rubygems'
require 'org-ruby'
data = IO.read(filename)
puts Orgmode::Parser.new(data).to_html

Author

eggcaker <eggcaker@gmail.com>

License

MIT