remove samples

I guess only one sample post file will do. Also if users leave this content up, Google may not like the duplicate content =/
This commit is contained in:
Jade Dominguez 2012-01-18 16:45:24 -08:00
parent bbf4212768
commit e70aa41d12
12 changed files with 0 additions and 634 deletions

View file

@ -1,10 +0,0 @@
---
layout : post
categories : api
tags : api
---
The Jekyll Bootstrap Theme API documents how themes should be formatted
in order to be plugged into jekyll-bootstrap.
## Philosophy

View file

@ -1,65 +0,0 @@
---
layout : post
categories : api
tags : api
---
The Jekyll Bootstrap API consists of custom includes and development
strategies meant to provide a more modular and sensible coding experience
when working with Liquid and Jekyll.
## Philosophy
Jekyll-bootstrap uses an 'include' helper strategy to encapsulate frequently used
code logic. This makes for more modular and DRY code.
The 'include' helper is the same concept as rails' view helper modules,
just obviously much more constrained due to Liquid.
## Include-helper Strategy
### Define a new "method"
The include helper strategy is meant to emulate a ruby method.
First encapsulate your liquid code logic in a Jekyll include file.
example: `helpers/tags_list.html` which is a helper to list tags and their total counts.
{% capture text %}|.% for tag in tags_list %.|
<li><a href="|.{ site.var.tags_path }.||.{ tag[0] }.|-ref">|.{ tag[0] }.| <span>|.{tag[1].size}.|</span></a></li>
|.% endfor %.|
|.% assign tags_list = null %.|{% endcapture %}
{% include helpers/liquid_raw.html %}
In order to emulate passing arguments to the method, your include should reference localized variables whenever possible.
Now we can pass in arguments by defining the local variables immediately before calling the include file:
### Invoking the Method.
{% capture text %}<ul>
|.% assign tags_list = site.tags %.|
|.% include helpers/tags_list.html %.|
</ul>{% endcapture %}
{% include helpers/liquid_raw.html %}
You can define as many "arguments" as you want, just remember to nullify them all at the end of your include to preserve modularity.
### Gotchas
In Liquid, it is impossible to inline assign a variable to anything other than a string.
This means you can't pass in arrays, hashes, etc.
However, as shown above, you can pass-by-reference, and assign local variables to variables that already exist.
So to pass in data-structures, you need to define them in your YAML Front Matter, or \_config.html file first, then pass them in by reference.
## Contibuting
If you have a good idea for another helper, please follow the outlines above,
then submit a pull request to [Jekyll-Bootstrap](http://github.com/plusjade/jekyll-bootstrap) and I'll include it.
## Current Jekyll-Bootstrap Helpers
<ul>
{% assign pages_list = site.categories.helpers %}
{% include helpers/pages_list.html %}
</ul>

View file

@ -1,38 +0,0 @@
---
layout : post
categories : api
tags : api
---
Here we'll get familiar with the Liquid syntax and learn about all the methods and logic available to us.
## Introduction
Jekyll uses the standard Liquid templating language package and includes a few other helpful extensions of its own.
Jekyll-bootstrap does not support plugin development so only the standard filters and logic will be available to us.
Remember we are the end-users!
## Liquid Crash Course
The following link contains a comprehensive course in everything available in Liquid.
The standard library is also available in Jekyll.
<http://github.com/Shopify/liquid/wiki/Liquid-for-Designers>
## Liquid Extensions Provided With Jekyll
Jekyll introduces a few other filters and tags as outlined here:
<http://github.com/mojombo/jekyll/wiki/Liquid-Extensions>
## Examples
Finally we take a look out the included helper examples and their source to see
how we can display our post and site information in a more strategic manner.
<ul>
{% assign pages_list = site.categories.helpers %}
{% include helpers/pages_list.html %}
</ul>

View file

@ -1,172 +0,0 @@
---
layout : post
categories : api
tags : [templating, liquid]
---
The Template data API is a comprehensive list of all data accessible in templates through using the Liquid templating language.
The next lesson will focus on [accessing Jekyll data via Liquid]({{page.previous.url}})
## Global Page/Post Data
Every content file that Jekyll processes is either a page or a post.
In both cases the data relative to the specific page or post being rendered
within the template is accessible through the `page` variable.
The page variable is a globally accessible variable available to all templates, posts, pages, and includes being rendered
for the given post/page instance.
/* The following format represents a Jekyll::Post or Jekyll::Page object. Jekyll::Post and Jekyll::Page objects may be nested in other variables in which case you can expect this same format: */
page = {
"layout"=>"post",
"categories"=>["lessons"],
"title"=>"Jekyll Liquid Api",
"url"=>"/lessons/jekyll-liquid-api.html",
"date"=>2011-01-27 00:00:00 -0800,
"id"=>"/lessons/jekyll-liquid-api",
"next"=> #Jekyll:Post @id="/lessons/template-data-api",
"previous"=> #Jekyll:Post @id="/lessons/configuring-urls",
"tags"=>["tagname1", "tagname2"],
"custom_variable"=> ["a", "custom", "defined", "data-structure"],
"content"=>"... this is the unparsed raw html page/post content ..."
}
### Setting Custom Data
You can set custom variables through the post or page Yaml Front matter and they will be included
in the page hash.
One important thing to note is that each Jekyll "rendering" instance is treating as a page/post object.
ALL YAML Front matter is merged into the current page/post instance.
So if you define custom data in the post file, then define custom data in the sub-template,
and also in the root template, all data will merge into the same page hash.
## Content Data
Jekyll uses a special variable named `content` to refer to the current page/post content.
The difference between `content` and `page.content` is the former is parsed with markdown or textile while the latter is raw.
The `content` variable is only accessible in template files and include files provided the include is included into a template.
### Content in Primary Templates.
When calling `content` in a primary template the content includes any sub-templates
previously rendered by the page/post.
### Content in Sub-Templates.
When calling `content` in a sub-template `content` includes any sub-sub-templates
previously rendered by the page/post. If there are none, `content` just reflects
the page/post as processed by markdown or textile.
## Global Site Data
This data is available anywhere liquid is available. This includes templates, posts, pages, and includes.
site = {
"related_posts"=>
[...(Array of liquified Jekyll::Post objects)...],
"safe"=>false,
"auto"=>true,
"server"=>true,
"server_port"=>4000,
"source"=>"/Users/jade/Dropbox/github/jekyll-bootstrap",
"destination"=>"/Users/jade/Dropbox/github/jekyll-bootstrap/_site",
"plugins"=>"/Users/jade/Dropbox/github/jekyll-bootstrap/_plugins",
"future"=>true,
"lsi"=>false,
"pygments"=>false,
"markdown"=>"maruku",
"permalink"=>"/:categories/:title.html",
"markdown_ext"=>"markdown,mkd,mkdn,md",
"textile_ext"=>"textile",
"maruku"=>
{
"use_tex"=>false,
"use_divs"=>false,
"png_engine"=>"blahtex",
"png_dir"=>"images/latex",
"png_url"=>"/images/latex"
},
"rdiscount"=>
{
"extensions"=>[]
},
"redcarpet"=>
{
"extensions"=>[]
},
"kramdown"=>
{
"auto_ids"=>true,
"footnote_nr"=>1,
"entity_output"=>"as_char",
"toc_levels"=>"1..6",
"use_coderay"=>false,
"coderay"=>
{
"coderay_wrap"=>"div",
"coderay_line_numbers"=>"inline",
"coderay_line_number_start"=>1,
"coderay_tab_width"=>4,
"coderay_bold_every"=>10,
"coderay_css"=>"style"
}
},
"time"=>2011-12-20 14:03:53 -0800,
"posts"=>
[...(Array of liquified Jekyll::Post objects)...],
"pages"=>
[...(Array of liquified Jekyll::Page objects)...],
"html_pages"=>
[...(Array of liquified Jekyll::Page objects)...],
"categories"=>
{"examples"=>
[...(Array of liquified Jekyll::Post objects)...],
"lessons"=>
[...(Array of liquified Jekyll::Post objects)...],
"tags"=>
{
"permalinks"=>
[...(Array of liquified Jekyll::Post objects)...],
"urls"=>
[...(Array of liquified Jekyll::Post objects)...],
"templating"=>
[...(Array of liquified Jekyll::Post objects)...],
"liquid"=>
[...(Array of liquified Jekyll::Post objects)...],
"posts"=>
[...(Array of liquified Jekyll::Post objects)...]
}
}
### Sitewide Custom Data
Set sitewide custom data using the config file.
Variables held in the config file get merged into the site variable.
## Categories
Categories may only be applied to posts and are available on a per-post basis as well as aggregated
in a sitewide global variable, i.e. all categories available for the website.
When iterating over categories the order is alpha descending
## Tags
Tags may only be applied to posts and are available on a per-post basis as well as aggregated
in a sitewide global variable, i.e. all tags available for the website.
When iterating over tags the order is alpha descending.

View file

@ -1,34 +0,0 @@
---
layout : post
categories : helpers
---
The posts collate helper organizes and lists posts in month/year clusters.
The posts collate helper follows the [Jekyll-bootstrap include helper](/api/bootstrap-api.html) strategy.
## Usage
### Collate All Posts in Reverse Chronological Order
By default all posts are organized in reverse-chronological order - newest to oldest.
{% capture text %}|.% assign posts_collate = site.posts %.|
|.% include helpers/posts_collate.html %.|{% endcapture %}
{% include helpers/liquid_raw.html %}
### Collate a Sub-Set of Posts
To collate a sub-set of posts, just pass in the sub-set.
Bellow, only posts tagged "jekyll" will be collated:
{% capture text %}|.% assign posts_collate = site.tags.jekyll %.|
|.% include helpers/posts_collate.html %.|{% endcapture %}
{% include helpers/liquid_raw.html %}
## Source
The source code is available at:
./_includes/helpers/posts_collate.html

View file

@ -1,49 +0,0 @@
---
layout : post
categories : helpers
---
The categories list helper provides a convenient way to list categories.
The categories list helper follows the [Jekyll-bootstrap include helper](/lessons/bootstrap-api.html) strategy.
## Usage
### List Sitewide Categories
List site-wide categories by passing in the `site.categories` variable:
{% capture text %}<ul>
|.% assign categories_list = site.categories %.|
|.% include helpers/categories_list.html %.|
</ul>{% endcapture %}
{% include helpers/liquid_raw.html %}
### List Categories for a Specific Post
You can also list categories specific to a post:
{% capture text %}<ul>
|.% assign categories_list = page.categories %.|
|.% include helpers/categories_list.html %.|
</ul>{% endcapture %}
{% include helpers/liquid_raw.html %}
### List Categories Per Post Iteratively
Finally let's iterate through all posts:
{% capture text %}|.% for post in site.posts %.|
<h3>Categories for: |.{post.title}.|</h3>
<ul>
|.% assign categories_list = post.categories %.|
|.% include helpers/categories_list.html %.|
</ul>
|.% endfor %.|{% endcapture %}
{% include helpers/liquid_raw.html %}
## Source
The source code is available at:
./_includes/helpers/categories_list.html

View file

@ -1,43 +0,0 @@
---
layout : post
categories : helpers
---
The pages list helper provides a convenient way to list pages.
The pages list helper follows the [Jekyll-bootstrap include helper](/lessons/bootstrap-api.html) strategy.
## Usage
### List All Pages
{% capture text %}<ul>
|.% assign pages_list = site.pages %.|
|.% include helpers/pages_list.html %.|
</ul>{% endcapture %}
{% include helpers/liquid_raw.html %}
### List Pages From a Sub-Group
Pages cannot have categories. However we can setup a similar functionality
by manually associating a page to a "group". Do this in the page's yaml front matter:
---
layout: default
title: A Nice Title
group: project
---
You then pass the group name to the pages\_list helper:
{% capture text %}<ul>
|.% assign pages_list = site.pages %.|
|.% assign group = 'project' %.|
|.% include helpers/pages_list.html %.|
</ul>{% endcapture %}
{% include helpers/liquid_raw.html %}
## Source
The source code is available at:
./_includes/helpers/pages_list.html

View file

@ -1,50 +0,0 @@
---
layout : post
categories : helpers
---
The tag list helper lists tags and their total counts.
The tag list helper follows the [Jekyll-bootstrap include helper](/lessons/bootstrap-api.html) strategy.
## Usage
### List Sitewide Tags
You can list sitewide tags by passing in the `site.tags` variable:
{% capture text %}<ul>
|.% assign tags_list = site.tags %.|
|.% include helpers/tags_list.html %.|
</ul>{% endcapture %}
{% include helpers/liquid_raw.html %}
### List Tags for a Specific Post
You can also list tags specific to a post:
{% capture text %}<ul>
|.% assign tags_list = page.tags %.|
|.% include helpers/tags_list.html %.|
</ul>{% endcapture %}
{% include helpers/liquid_raw.html %}
### List Tags Per Post Iteratively
Finally let's iterate through all posts:
{% capture text %}|.% for post in site.posts %.|
<h3>Tags for: |.{post.title}.|</h3>
<ul>
|.% assign tags_list = post.tags %.|
|.% include helpers/tags_list.html %.|
</ul>
|.% endfor %.|{% endcapture %}
{% include helpers/liquid_raw.html %}
## Source
The source code is available at:
./_includes/helpers/tags_list.html

View file

@ -1,36 +0,0 @@
---
layout: post
categories : usage
---
Deploying a jekyll-based website comes in two flavors.
You can deploy to GitHub Pages or you can deploy to your own custom server.
## Deploy Jekyll to GitHub Pages
You can deploy Jekyll to your GitHub account and GitHub will parse your repo through Jekyll and host the result on username.github.com
This is very nice of GitHub and the most convenient strategy.
However you cannot extend jekyll via plugins with this version because GitHub will not run them for security reasons.
[GitHub Pages](http://pages.github.com) provides a comprehension tutorial to deploying your Jekyll repository to GitHub Pages.
### Jekyll-Bootstrap is Built to Run on GitHub Pages.
<http://jekyllbootstrap.com> itself, is running via GitHub pages.
You can see that this website is also available at: <http://plusjade.github.com/jekyll-bootstrap>.
If you follow the development practices outlined in Jekyll-bootstrap all you have to do is
clone the jekyll-bootstrap framework, clear out the posts and pages and add in your own content.
Then push this to github as per the [GitHub Pages](http://pages.github.com) tutorial.
Please [contact me](http://plusjade.com) if you run into any trouble.
## Deploy Jekyll to Your Custom Server
The main reason you'd want to host your website yourself is because you can then run custom plugins and customize Jekyll to your heart's content.
Please see the original docs for [custom Jekyll deployment strategies](https://github.com/mojombo/jekyll/wiki/Deployment).

View file

@ -1,26 +0,0 @@
---
layout : post
categories : usage
tags : [permalinks, urls]
---
URL configuration is an important aspect of Jekyll as users usually require
total control over how links to their content are handled. Fortunately Jekyll provides extensive customization options as to how your permalinks will be generated:
[Jekyll Permalinks](https://github.com/mojombo/jekyll/wiki/Permalinks)
## Jekyll-Bootstrap's URL Configuration
A peek into `_config.yml` notes that Jekyll-bootrap uses this configuration:
permalink: /:categories/:title.html
This means any category specified on a post will be included within the url, followed by the post title.
Traditionally a blog will namespace its post by date, for example:
permalink: /:categories/:year/:month/:day/:title/
Play around with what url configuration works best for you.

View file

@ -1,31 +0,0 @@
---
layout: post
categories : usage
---
## Creating Your Layout
Jekyll-bootstrap uses [twitter bootstrap](http://twitter.github.com/bootstrap) to provide the layout structure.
This is because I am not a designer. (designers please contribute themes to Jekyll-bootstrap!)
To get up and running the fastest you might just take a peak at the twitter bootstrap design elements
and setup a quick template that you are happy with.
### Static Assets
The `assets` folder follows a logical structure:
`css` folder contain css, `javascripts` folder contain javascript files etc.
You can link to these static assets following the logical directory path.
### Create a Base Template
The base template in Jekyll-bootstrap is at: `/_layouts/default.html`
You can see how the global layout is defined and how assets are linked to.
### Create a Post Template
The post template in Jekyll-bootstrap is at: `/_layouts/post.html`
This template is a sub-template that all posts refer to. You can see the post template defines
the default template its parent layout.

View file

@ -1,80 +0,0 @@
---
layout: post
categories : usage
---
## 1. Install Jekyll-Bootstrap
[Install Jekyll-Bootsrap](/index.html#start-now) if you haven't already.
Jekyll-bootstrap is a clean base framework for your blog.
It includes two themes, some useful pages, and bootstrap include-helpers.
## 2. Run Jekyll Locally
In order to preview your blog locally you'll need to install the jekyll gem. Note gem dependencies will also be installed.
$ gem install jekyll
If you run into a problem please consult the original [Jekyll installation documentation](https://github.com/mojombo/jekyll/wiki/Install).
You can also [contact me](http://github.com/plusjade) through github.
Once the gem is installed you can navigate to your Jekyll-bootstrap directory
and run jekyll:
$ cd jekyll-bootstrap
$ jekyll --server
Your blog is now available at: [http://localhost:4000/](http://localhost:4000/).
## 2. Choose a Theme
Jekyll-bootstrap has a basic theming system that I'll be steadily improving.
You can read about how to choose and customize a theme in the [Theming](/usages/theming.html) section.
## 3. Create Some Content
### Create a Post
Create a file with valid date and title in the filename and place it into the `_posts` folder.
Jekyll-bootstrap provides many post files for you to copy from to better understand the formatting requirements.
### Create a Page
Create a file anywhere in the root directory, for example `/about.md` and remember to provide
valid YAML Front Matter so Jekyll recognizes the file as a page.
Jekyll-bootstrap provides many page examples for reference.
You can study the source and customize it for your own needs.
<ul>
{% assign pages_list = site.pages %}
{% include helpers/pages_list.html %}
</ul>
## 4. Publish
After you've added posts or made changes to your theme or other files, simply commit them to your git repo and push the commits up to GitHub.
A GitHub post-commit hook will automatically deploy your changes to your hosted blog. You will receive a success or failure notice for every commit you make to your blog.
## 5. Customize
Jekyll-bootstrap can be used as-is as a basic blogging platform with little need
to understand what's going on under the hood.
However I'm betting you want to get your hands dirty.
The following outlines the deeper Jekyll-Bootstrap documentation.
### Jekyll Introduction
The [{{site.categories.lessons.first.title}}]({{site.categories.lessons.first.url}}) is meant for core understanding of how and why Jekyll works the way it does.
You must start with this in order to understand everything else in Jekyll-Bootstrap.
### The API Section
The API pages document main data-structures and design strategies used in Jekyll and Jekyll-Bootstrap.