Expand All
Collapse All
As a hacker who likes to structure content
I want to be able to create collections of similar information
And render them
collections: methods: output: true foo: bar
collections: methods: output: true permalink: /:collection/:path/
collections: methods: output: true foo: bar
collections: - methods
collections: - methods
collections: - methods
collections: - methods
collections: - methods
collections: - methods
collections: - methods
As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
title | date | content |
Hackers | 2009-03-27 | My First Exploit |
title | date | layout | content |
Wargames | 2009-03-27 | default | The only winning move is not to play. |
title | date | layout | content |
Wargames | 2009-03-27 | post/simple | The only winning move is not to play. |
title | date | layout | content |
entry1 | 2009-03-27 | post | content for entry1. |
entry2 | 2009-04-27 | post | content for entry2. |
title | date | layout | content |
entry3 | 2009-05-27 | post | content for entry3. |
entry4 | 2009-06-27 | post | content for entry4. |
title | date | layout | content |
entry1 | 2007-12-31 | post | content for entry1. |
entry2 | 2020-01-31 | post | content for entry2. |
In order to use well-formatted data in my blog
As a blog's user
I want to use _data directory in my site
- name: sugar price: 5.3 - name: salt price: 2.5
- name: Jack age: 28 - name: Leon age: 34
[{"name": "Jack", "age": 28},{"name": "Leon", "age": 34}]
name,age Jack,28 Leon,34
- name: Jack age: 28 - name: Leon age: 34
name: Dairy Products
name: Dairy Products
dairy: name: Should not display this
data: - name: Jack age: 28 - name: Leon age: 34
As a hacker who likes to blog
I want to be able to preview drafts locally
In order to see if they look alright before publishing
title | date | layout | content |
Recipe | 2009-03-27 | default | Not baked yet. |
title | date | layout | content |
Recipe | 2009-03-27 | default | Not baked yet. |
title | date | layout | published | content |
Recipe | 2009-03-27 | default | false | Not baked yet. |
title | date | layout | content |
Recipe | 2009-03-27 | simple | Post path: {{ page.path }} |
As a hacker who likes to blog
I want to be able to transform text inside a post or page
In order to perform cool stuff in my posts
title | date | layout | content |
Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
title | date | layout | content |
Star & Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
title | date | layout | content |
Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
title | date | layout | tags | content |
Star Wars | 2009-03-27 | default | [scifi, movies, force] | These aren't the droids you're looking for. |
title | date | layout | content |
Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
title | layout | value | content |
Page-1 | default | 8 | Something |
title | layout | value | content |
Page-2 | default | 6 | Something |
title | layout | content |
Dog | default | Run |
title | layout | content |
Bird | default | Fly |
layout | content |
default | Jump |
title | layout | content |
Dog | default | Run |
title | layout | content |
Bird | default | Fly |
layout | content |
default | Jump |
title | date | content |
default layout | 2013-09-11 | just some post |
title | date | content |
default data | 2013-09-11 | <p>{{page.custom}}</p><div>{{page.author}}</div> |
title | date | content |
about | 2013-10-14 | info on {{page.description}} |
title | date | path | content |
about | 2013-10-14 | local | info on {{page.description}} |
title | date | content |
about | 2013-10-14 | content of site/2013/10/14/about.html |
title | date | path | content |
about1 | 2013-10-14 | local | content of site/special/2013/10/14/about1.html |
about2 | 2013-10-14 | local | content of site/special/2013/10/14/about2.html |
title | date | content |
this is a post | 2013-10-14 | blabla |
title | date | permalink | author | content |
override | 2013-10-14 | /frontmatter.html | some guy | a blog by {{page.author}} |
title | date | category | content |
testpost | 2013-10-14 | blog | blabla |
--- --- Value: {{ page.myval }}
collections: slides: output: true defaults: - scope: path: "" type: slides values: myval: "Test"
--- myval: Override --- Value: {{ page.myval }}
collections: slides: output: true defaults: - scope: path: "" type: slides values: myval: "Test"
As a plugin author
I want to be able to run code during various stages of the build process
Jekyll::Hooks.register :site, :after_reset do |site| pageklass = Class.new(Jekyll::Page) do def initialize(site, base) @site = site @base = base @data = {} @dir = '/' @name = 'foo.html' @content = 'mytinypage' self.process(@name) end end site.pages << pageklass.new(site, site.source) end
Jekyll::Hooks.register :site, :pre_render do |site, payload| payload['site']['injected'] = 'myparam' end
Jekyll::Hooks.register :site, :post_read do |site| site.pages.delete_if { |p| p.name == 'page1.html' } end
Jekyll::Hooks.register :site, :post_write do |site| firstpage = site.pages.first content = File.read firstpage.destination(site.dest) File.write(File.join(site.dest, 'firstpage.html'), content) end
Jekyll::Hooks.register :page, :post_init do |page| page.name = 'renamed.html' page.process(page.name) end
Jekyll::Hooks.register :page, :pre_render do |page, payload| payload['myparam'] = 'special' if page.name == 'page1.html' end
Jekyll::Hooks.register :page, :post_render do |page| page.output = "{{{{{ #{page.output.chomp} }}}}}" end
Jekyll::Hooks.register :page, :post_write do |page| require 'fileutils' filename = page.destination(page.site.dest) FileUtils.mv(filename, "#{filename}.moved") end
# rot13 translate Jekyll::Hooks.register :post, :post_init do |post| post.content.tr!('abcdefghijklmnopqrstuvwxyz', 'nopqrstuvwxyzabcdefghijklm') end
title | date | layout | content |
entry1 | 2015-03-14 | nil | content for entry1. |
# Add myvar = 'old' to posts before 2015-03-15, and myvar = 'new' for # others Jekyll::Hooks.register :post, :pre_render do |post, payload| if post.date < Time.new(2015, 3, 15) payload['myvar'] = 'old' else payload['myvar'] = 'new' end end
title | date | layout | content |
entry1 | 2015-03-14 | nil | {{ myvar }} post |
entry2 | 2015-03-15 | nil | {{ myvar }} post |
# Replace content after rendering Jekyll::Hooks.register :post, :post_render do |post| post.output.gsub! /42/, 'the answer to life, the universe and everything' end
title | date | layout | content |
entry1 | 2015-03-14 | nil | {{ 6 | times: 7 }} |
entry2 | 2015-03-15 | nil | {{ 6 | times: 8 }} |
# Log all post filesystem writes Jekyll::Hooks.register :post, :post_write do |post| filename = post.destination(post.site.dest) open('_site/post-build.log', 'a') do |f| f.puts "Wrote #{filename} at #{Time.now}" end end
title | date | layout | content |
entry1 | 2015-03-14 | nil | entry one |
entry2 | 2015-03-15 | nil | entry two |
Jekyll::Hooks.register [:page, :post], :post_render do |owner| owner.output = "{{{{{ #{owner.output.chomp} }}}}}" end
title | date | layout | content |
entry1 | 2015-03-14 | nil | entry one |
Jekyll::Hooks.register :page, :post_render, priority: :normal do |owner| # first normal runs second owner.output = "1 #{owner.output.chomp}" end Jekyll::Hooks.register :page, :post_render, priority: :high do |owner| # high runs last owner.output = "2 #{owner.output.chomp}" end Jekyll::Hooks.register :page, :post_render do |owner| # second normal runs third (normal is default) owner.output = "3 #{owner.output.chomp}" end Jekyll::Hooks.register :page, :post_render, priority: :low do |owner| # low runs first owner.output = "4 #{owner.output.chomp}" end
Jekyll::Hooks.register :document, :pre_render do |doc, payload| doc.data['text'] = doc.data['text'] << ' are belong to us' end
--- text: all your base ---
--- --- {{ site.memes.first.text }}
Jekyll::Hooks.register :document, :post_render do |doc| doc.output.gsub! /<p>/, '<p class="meme">' end
collections: memes: output: true
--- text: all your base are belong to us --- {{ page.text }}
Jekyll::Hooks.register :document, :post_write do |doc| open('_site/document-build.log', 'a') do |f| f.puts "Wrote document #{doc.collection.docs.index doc} at #{Time.now}" end end
collections: memes: output: true
--- text: all your base are belong to us --- {{ page.text }}
In order to share their content across several pages
As a hacker who likes to blog
I want to be able to include files in my blog posts
title | date | type | content |
Include Files | 2013-03-21 | html | {% include header.html param="myparam" %} |
Ignore params if unused | 2013-03-21 | html | {% include ignore.html date="today" %} |
List multiple parameters | 2013-03-21 | html | {% include params.html date="today" start="tomorrow" %} |
Dont keep parameters | 2013-03-21 | html | {% include ignore.html param="test" %}
{% include header.html %} |
Allow params with spaces and quotes | 2013-04-07 | html | {% include params.html cool="param with spaces" super="\"quoted\"" single='has "quotes"' escaped='\'single\' quotes' %} |
Parameter syntax | 2013-04-12 | html | {% include params.html param1_or_2="value" %} |
Pass a variable | 2013-06-22 | html | {% assign var = 'some text' %}{% include params.html local=var title=page.title %} |
key | value |
include_file1 | snippet.html |
include_file2 | parametrized.html |
key | value |
include_file | one |
key | value |
include_file | one |
As an impatient hacker who likes to blog
I want to be able to make a static site
Without waiting too long for it to build
title | date | layout | content |
Wargames | 2009-03-27 | default | The only winning move is not to play. |
As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
title | date | content | type |
Hackers | 2009-03-27 | # My Title | markdown |
key | value |
paginate | 5 |
gems | [jekyll-paginate] |
title | date | content | type |
Hackers | 2009-03-27 | # My Title | markdown |
In order to paginate my blog
As a blog's user
I want divide the posts in several pages
key | value |
paginate | <num> |
gems | [jekyll-paginate] |
title | date | layout | content |
Wargames | 2009-03-27 | default | The only winning move is not to play. |
Wargames2 | 2009-04-27 | default | The only winning move is not to play2. |
Wargames3 | 2009-05-27 | default | The only winning move is not to play3. |
Wargames4 | 2009-06-27 | default | The only winning move is not to play4. |
num | exist | posts | not_exist |
---|---|---|---|
1 | 4 | 1 | 5 |
2 | 2 | 2 | 3 |
3 | 2 | 1 | 3 |
key | value |
paginate | 1 |
paginate_path | /blog/page-:num |
permalink | /blog/:year/:month/:day/:title |
gems | [jekyll-paginate] |
title | date | layout | content |
Wargames | 2009-03-27 | default | The only winning move is not to play. |
Wargames2 | 2009-04-27 | default | The only winning move is not to play2. |
Wargames3 | 2009-05-27 | default | The only winning move is not to play3. |
Wargames4 | 2009-06-27 | default | The only winning move is not to play4. |
exist | posts | not_exist |
---|---|---|
2 | 1 | 5 |
3 | 1 | 6 |
4 | 1 | 7 |
key | value |
paginate | 1 |
paginate_path | /blog/page/:num |
permalink | /blog/:year/:month/:day/:title |
gems | [jekyll-paginate] |
title | date | layout | content |
Wargames | 2009-03-27 | default | The only winning move is not to play. |
Wargames2 | 2009-04-27 | default | The only winning move is not to play2. |
Wargames3 | 2009-05-27 | default | The only winning move is not to play3. |
Wargames4 | 2009-06-27 | default | The only winning move is not to play4. |
exist | posts | not_exist |
---|---|---|
2 | 1 | 5 |
3 | 1 | 6 |
4 | 1 | 7 |
As a hacker who likes to blog
I want to be able to set permalinks
In order to make my blog URLs awesome
title | date | content |
None Permalink Schema | 2009-03-27 | Totally nothing. |
title | date | content |
Pretty Permalink Schema | 2009-03-27 | Totally wordpress. |
title | category | date | content |
Custom Permalink Schema | stuff | 2009-03-27 | Totally custom. |
title | category | date | content |
Custom Permalink Schema | stuff | 2009-03-27 | Totally custom. |
title | category | date | content |
Custom Permalink Schema | stuff | 2009-03-27 | Totally custom. |
title | date | permalink | content |
Some post | 2013-04-14 | /custom/posts/1/ | bla bla |
title | date | permalink | content |
Some post | 2013-04-14 | /custom/posts/some.html | bla bla |
As a hacker
I want to specify my own plugins that can modify Jekyll's behaviour
key | value |
gems | [jekyll_test_plugin] |
whitelist | [] |
key | value |
gems | [jekyll_test_plugin, jekyll_test_plugin_malicious] |
whitelist | [jekyll_test_plugin] |
As a hacker who likes to blog
I want to be able to embed data into my posts
In order to make the posts slightly dynamic
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | category | content |
Star Wars | 2009-03-27 | simple | film | Luke, I am your father. |
title | date | layout | categories | content |
Star Wars | 2009-03-27 | simple | [film, scifi] | Luke, I am your father. |
title | date | layout | category | content |
Star Wars | 2009-03-27 | simple | movies | Luke, I am your father. |
title | date | layout | tag | content |
Star Wars | 2009-05-18 | simple | twist | Luke, I am your father. |
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | content |
Star Wars | 2009-03-27 | simple | Luke, I am your father. |
title | date | layout | category | content |
Star Wars | 2009-03-27 | simple | movies | Luke, I am your father. |
title | date | layout | category | content |
Star Wars | 2009-03-27 | simple | Movies | Luke, I am your father. |
title | date | layout | categories | content |
Star Wars | 2009-03-27 | simple | ['scifi', 'movies'] | Luke, I am your father. |
title | date | layout | categories | content |
Star Wars | 2009-03-27 | simple | ['movies', 'movies'] | Luke, I am your father. |
title | date | layout | categories | content |
Star Wars | 2009-03-27 | simple | ['scifi', 'Movies'] | Luke, I am your father. |
Star Trek | 2013-03-17 | simple | ['SciFi', 'movies'] | Jean Luc, I am your father. |
title | type | date | content |
my-post | html | 2013-04-12 | Source path: {{ page.path }} |
dir | path_prefix |
---|---|
. | |
dir | dir/ |
dir/nested | dir/nested/ |
title | date | path | content |
override | 2013-04-12 | override-path.html | Custom path: {{ page.path }} |
title | date | layout | published | content |
Star Wars | 2009-03-27 | simple | false | Luke, I am your father. |
title | date | layout | author | content |
Star Wars | 2009-03-27 | simple | Darth Vader | Luke, I am your father. |
title | date | layout | author | content |
Star Wars | 2009-03-27 | ordered | Darth Vader | Luke, I am your father. |
Some like it hot | 2009-04-27 | ordered | Osgood | Nobody is perfect. |
Terminator | 2009-05-27 | ordered | Arnold | Sayonara, baby |
As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
But some people can only focus for a few moments
So just give them a taste
title | date | layout | content |
entry1 | 2007-12-31 | post | content for entry1. |
title | date | layout | content |
entry1 | 2007-12-31 | post | content for entry1. |
title | date | layout | content |
entry1 | 2007-12-31 | post | content for entry1. |
As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
But I want to make it as simply as possible
So render with Liquid and place in Layouts
As a hacker who likes to blog
I want to be able to configure jekyll
In order to make setting up a site easier
key | value |
source | <source> |
destination | <dest> |
source | dest | file_exist |
---|---|---|
mysite_source | mysite | |
mysite | mysite_dest | |
mysite/ | mysite | not |
mysite | ./mysite | not |
mysite/source | mysite | not |
mysite | mysite/dest |
value |
README |
Rakefile |
title | date | layout | content |
foo | 2014-04-27 11:34 | default | {% highlight text %} test {% endhighlight %} |
key | value |
time | 2010-01-01 |
future | false |
title | date | layout | content |
entry1 | 2007-12-31 | post | content for entry1. |
entry2 | 2020-01-31 | post | content for entry2. |
key | value |
time | 2010-01-01 |
future | true |
title | date | layout | content |
entry1 | 2007-12-31 | post | content for entry1. |
entry2 | 2020-01-31 | post | content for entry2. |
key | value |
timezone | America/New_York |
title | date | layout | content |
entry1 | 2013-04-09 23:22 -0400 | post | content for entry1. |
entry2 | 2013-04-10 03:14 -0400 | post | content for entry2. |
key | value |
timezone | Pacific/Honolulu |
title | date | layout | content |
entry1 | 2013-04-09 23:22 +0400 | post | content for entry1. |
entry2 | 2013-04-10 03:14 +0400 | post | content for entry2. |
key | value |
limit_posts | 2 |
title | date | content |
Apples | 2009-03-27 | An article about apples |
Oranges | 2009-04-01 | An article about oranges |
Bananas | 2009-04-05 | An article about bananas |
value |
.gitignore |
.foo |
key | value |
time | 2010-01-01 |
future | true |
layouts | _theme |
title | date | layout | content |
entry1 | 2007-12-31 | post | content for entry1. |
entry2 | 2020-01-31 | post | content for entry2. |
As a hacker who likes to blog
I want to be able to embed data into my site
In order to make the site slightly dynamic
dir | path |
---|---|
. | index.html |
dir | dir/about.html |
dir/nested | dir/nested/page.html |
title | date | content |
First Post | 2009-03-25 | My First Post |
Second Post | 2009-03-26 | My Second Post |
Third Post | 2009-03-27 | My Third Post |
title | date | content |
First Post | 2009-03-25 | My First Post |
Second Post | 2009-03-26 | My Second Post |
Third Post | 2009-03-27 | My Third Post |
title | date | category | content |
Awesome Hack | 2009-03-26 | code | puts 'Hello World' |
Delicious Beer | 2009-03-26 | food | 1) Yuengling |
title | date | tag | content |
Delicious Beer | 2009-03-26 | beer | 1) Yuengling |
title | date | content |
first | 2009-02-26 | first |
A | 2009-03-26 | A |
B | 2009-03-26 | B |
C | 2009-03-26 | C |
last | 2009-04-26 | last |