monad 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTING.markdown +91 -0
- data/Gemfile +1 -1
- data/History.markdown +772 -0
- data/{README.md → README.markdown} +5 -2
- data/Rakefile +163 -1
- data/bin/monad +86 -30
- data/features/create_sites.feature +54 -25
- data/features/data.feature +65 -0
- data/features/data_sources.feature +10 -10
- data/features/drafts.feature +5 -5
- data/features/embed_filters.feature +10 -10
- data/features/include_tag.feature +48 -0
- data/features/markdown.feature +5 -5
- data/features/pagination.feature +38 -10
- data/features/permalinks.feature +31 -11
- data/features/post_data.feature +41 -41
- data/features/post_excerpts.feature +50 -0
- data/features/site_configuration.feature +47 -26
- data/features/site_data.feature +30 -24
- data/features/step_definitions/{monad_steps.rb → jekyll_steps.rb} +66 -52
- data/features/support/env.rb +27 -8
- data/lib/jekyll.rb +99 -0
- data/lib/jekyll/cleaner.rb +73 -0
- data/lib/{monad → jekyll}/command.rb +6 -6
- data/lib/{monad → jekyll}/commands/build.rb +9 -9
- data/lib/jekyll/commands/doctor.rb +67 -0
- data/lib/jekyll/commands/new.rb +67 -0
- data/lib/jekyll/commands/serve.rb +65 -0
- data/lib/{monad → jekyll}/configuration.rb +60 -18
- data/lib/{monad → jekyll}/converter.rb +1 -1
- data/lib/{monad → jekyll}/converters/identity.rb +1 -1
- data/lib/{monad → jekyll}/converters/markdown.rb +2 -2
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +29 -0
- data/lib/{monad → jekyll}/converters/markdown/maruku_parser.rb +12 -8
- data/lib/{monad → jekyll}/converters/markdown/rdiscount_parser.rb +4 -2
- data/lib/{monad → jekyll}/converters/markdown/redcarpet_parser.rb +1 -1
- data/lib/{monad → jekyll}/converters/textile.rb +1 -1
- data/lib/{monad → jekyll}/convertible.rb +39 -17
- data/lib/{monad → jekyll}/core_ext.rb +22 -4
- data/lib/jekyll/deprecator.rb +36 -0
- data/lib/{monad → jekyll}/draft.rb +1 -1
- data/lib/{monad → jekyll}/drivers/json_driver.rb +1 -1
- data/lib/{monad → jekyll}/drivers/yaml_driver.rb +1 -1
- data/lib/{monad → jekyll}/errors.rb +1 -1
- data/lib/jekyll/excerpt.rb +113 -0
- data/lib/{monad → jekyll}/filters.rb +16 -6
- data/lib/{monad → jekyll}/generator.rb +1 -1
- data/lib/jekyll/generators/pagination.rb +214 -0
- data/lib/{monad → jekyll}/layout.rb +4 -1
- data/lib/{monad → jekyll}/mime.types +0 -0
- data/lib/{monad → jekyll}/page.rb +36 -39
- data/lib/{monad → jekyll}/plugin.rb +1 -1
- data/lib/{monad → jekyll}/post.rb +58 -123
- data/lib/jekyll/related_posts.rb +59 -0
- data/lib/{monad → jekyll}/site.rb +120 -123
- data/lib/{monad → jekyll}/static_file.rb +1 -1
- data/lib/jekyll/stevenson.rb +89 -0
- data/lib/jekyll/tags/gist.rb +48 -0
- data/lib/{monad → jekyll}/tags/highlight.rb +3 -3
- data/lib/jekyll/tags/include.rb +135 -0
- data/lib/{monad → jekyll}/tags/post_url.rb +8 -6
- data/lib/jekyll/url.rb +67 -0
- data/lib/monad.rb +36 -27
- data/lib/site_template/_config.yml +2 -1
- data/lib/site_template/_layouts/default.html +21 -23
- data/lib/site_template/_layouts/post.html +1 -1
- data/lib/site_template/_posts/{0000-00-00-welcome-to-monad.markdown.erb → 0000-00-00-welcome-to-jekyll.markdown.erb} +6 -6
- data/lib/site_template/css/main.css +22 -27
- data/lib/site_template/index.html +2 -2
- data/monad.gemspec +153 -52
- data/site/.gitignore +4 -0
- data/site/CNAME +1 -0
- data/site/README +1 -0
- data/site/_config.yml +6 -0
- data/site/_includes/analytics.html +32 -0
- data/site/_includes/docs_contents.html +16 -0
- data/site/_includes/docs_contents_mobile.html +23 -0
- data/site/_includes/docs_option.html +11 -0
- data/site/_includes/docs_ul.html +20 -0
- data/site/_includes/footer.html +15 -0
- data/site/_includes/header.html +18 -0
- data/site/_includes/news_contents.html +23 -0
- data/site/_includes/news_contents_mobile.html +11 -0
- data/site/_includes/news_item.html +24 -0
- data/site/_includes/primary-nav-items.html +14 -0
- data/site/_includes/section_nav.html +22 -0
- data/site/_includes/top.html +17 -0
- data/site/_layouts/default.html +12 -0
- data/site/_layouts/docs.html +23 -0
- data/site/_layouts/news.html +19 -0
- data/site/_layouts/news_item.html +27 -0
- data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +23 -0
- data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +27 -0
- data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +28 -0
- data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +25 -0
- data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +27 -0
- data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +31 -0
- data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +20 -0
- data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +20 -0
- data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +23 -0
- data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +19 -0
- data/site/css/gridism.css +110 -0
- data/site/css/normalize.css +1 -0
- data/site/css/pygments.css +70 -0
- data/site/css/style.css +946 -0
- data/site/docs/configuration.md +373 -0
- data/site/docs/contributing.md +128 -0
- data/site/docs/datafiles.md +63 -0
- data/site/docs/deployment-methods.md +109 -0
- data/site/docs/drafts.md +20 -0
- data/site/docs/extras.md +56 -0
- data/site/docs/frontmatter.md +180 -0
- data/site/docs/github-pages.md +91 -0
- data/site/docs/heroku.md +9 -0
- data/site/docs/history.md +722 -0
- data/site/docs/index.md +52 -0
- data/site/docs/installation.md +76 -0
- data/site/docs/migrations.md +257 -0
- data/site/docs/pages.md +86 -0
- data/site/docs/pagination.md +211 -0
- data/site/docs/permalinks.md +180 -0
- data/site/docs/plugins.md +508 -0
- data/site/docs/posts.md +181 -0
- data/site/docs/quickstart.md +32 -0
- data/site/docs/resources.md +46 -0
- data/site/docs/sites.md +29 -0
- data/site/docs/structure.md +190 -0
- data/site/docs/templates.md +319 -0
- data/site/docs/troubleshooting.md +150 -0
- data/site/docs/upgrading.md +146 -0
- data/site/docs/usage.md +63 -0
- data/site/docs/variables.md +322 -0
- data/site/favicon.png +0 -0
- data/site/feed.xml +36 -0
- data/site/freenode.txt +1 -0
- data/site/img/article-footer.png +0 -0
- data/site/img/footer-arrow.png +0 -0
- data/site/img/footer-logo.png +0 -0
- data/site/img/logo-2x.png +0 -0
- data/site/img/octojekyll.png +0 -0
- data/site/img/tube.png +0 -0
- data/site/img/tube1x.png +0 -0
- data/site/index.html +90 -0
- data/site/js/modernizr-2.5.3.min.js +4 -0
- data/site/news/index.html +10 -0
- data/site/news/releases/index.html +10 -0
- data/test/helper.rb +6 -3
- data/test/source/+/foo.md +7 -0
- data/test/source/_data/languages.yml +2 -0
- data/test/source/_data/members.yaml +7 -0
- data/test/source/_data/products.yml +4 -0
- data/test/source/_includes/params.html +7 -0
- data/test/source/_layouts/default.html +1 -1
- data/test/source/_layouts/post/simple.html +1 -0
- data/test/source/_plugins/dummy.rb +1 -1
- data/test/source/_posts/2013-01-02-post-excerpt.markdown +1 -1
- data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +23 -0
- data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
- data/test/source/deal.with.dots.html +1 -1
- data/test/source/products.yml +4 -0
- data/test/test_configuration.rb +46 -11
- data/test/test_convertible.rb +2 -2
- data/test/test_excerpt.rb +78 -0
- data/test/test_filters.rb +4 -4
- data/test/test_generated_site.rb +13 -13
- data/test/test_json_driver.rb +9 -9
- data/test/test_kramdown.rb +32 -5
- data/test/test_new_command.rb +8 -8
- data/test/test_page.rb +12 -3
- data/test/test_pager.rb +34 -33
- data/test/test_post.rb +34 -26
- data/test/test_redcloth.rb +3 -3
- data/test/test_related_posts.rb +47 -0
- data/test/test_site.rb +102 -44
- data/test/test_tags.rb +168 -23
- data/test/test_url.rb +28 -0
- data/test/test_yaml_driver.rb +6 -6
- metadata +215 -137
- data/lib/monad/commands/doctor.rb +0 -29
- data/lib/monad/commands/new.rb +0 -50
- data/lib/monad/commands/serve.rb +0 -33
- data/lib/monad/converters/markdown/kramdown_parser.rb +0 -44
- data/lib/monad/deprecator.rb +0 -32
- data/lib/monad/generators/pagination.rb +0 -143
- data/lib/monad/logger.rb +0 -54
- data/lib/monad/tags/gist.rb +0 -30
- data/lib/monad/tags/include.rb +0 -37
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Data Files
|
|
4
|
+
prev_section: variables
|
|
5
|
+
next_section: migrations
|
|
6
|
+
permalink: /docs/datafiles/
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
In addition to the [built-in variables](../variables/) available from Jekyll,
|
|
10
|
+
you can specify your own custom data that can be accessed via the [Liquid
|
|
11
|
+
templating system](http://wiki.github.com/shopify/liquid/liquid-for-designers).
|
|
12
|
+
|
|
13
|
+
Jekyll supports loading data from [YAML](http://yaml.org/) files located in the
|
|
14
|
+
`_data` directory.
|
|
15
|
+
|
|
16
|
+
This powerful features allows you to avoid repetition in your templates and to
|
|
17
|
+
set site specific options without changing `_config.yml`.
|
|
18
|
+
|
|
19
|
+
Plugins/themes can also leverage Data Files to set configuration variables.
|
|
20
|
+
|
|
21
|
+
## The Data Folder
|
|
22
|
+
|
|
23
|
+
As explained on the [directory structure](../structure/) page, the `_data`
|
|
24
|
+
folder is where you can store additional data for Jekyll to use when generating
|
|
25
|
+
your site. These files must be YAML files (using either the `.yml` or `.yaml`
|
|
26
|
+
extension) and they will be accessible via `site.data`.
|
|
27
|
+
|
|
28
|
+
## Example: List of members
|
|
29
|
+
|
|
30
|
+
Here is a basic example of using Data Files to avoid copy-pasting large chunks of
|
|
31
|
+
code in your Jekyll templates:
|
|
32
|
+
|
|
33
|
+
In `_data/members.yml`:
|
|
34
|
+
|
|
35
|
+
{% highlight yaml %}
|
|
36
|
+
- name: Tom Preston-Werner
|
|
37
|
+
github: mojombo
|
|
38
|
+
|
|
39
|
+
- name: Parker Moore
|
|
40
|
+
github: parkr
|
|
41
|
+
|
|
42
|
+
- name: Liu Fengyun
|
|
43
|
+
github: liufengyun
|
|
44
|
+
{% endhighlight %}
|
|
45
|
+
|
|
46
|
+
This data can be accessed via `site.data.members` (notice that the filename
|
|
47
|
+
determines the variable name).
|
|
48
|
+
|
|
49
|
+
You can now render the list of members in a template:
|
|
50
|
+
|
|
51
|
+
{% highlight html %}
|
|
52
|
+
{% raw %}
|
|
53
|
+
<ul>
|
|
54
|
+
{% for member in site.data.members %}
|
|
55
|
+
<li>
|
|
56
|
+
<a href="https://github.com/{{ member.github }}">
|
|
57
|
+
{{ member.name }}
|
|
58
|
+
</a>
|
|
59
|
+
</li>
|
|
60
|
+
{% end %}
|
|
61
|
+
</ul>
|
|
62
|
+
{% endraw %}
|
|
63
|
+
{% endhighlight %}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Deployment methods
|
|
4
|
+
prev_section: github-pages
|
|
5
|
+
next_section: troubleshooting
|
|
6
|
+
permalink: /docs/deployment-methods/
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. A few of the most common deployment techniques are described below.
|
|
10
|
+
|
|
11
|
+
## Web hosting providers (FTP)
|
|
12
|
+
|
|
13
|
+
Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the `jekyll` command and copy the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
|
|
14
|
+
|
|
15
|
+
### FTP using Glynn
|
|
16
|
+
|
|
17
|
+
There is a project called [Glynn](https://github.com/dmathieu/glynn), which lets you easily generate your Jekyll powered website’s static files and
|
|
18
|
+
send them to your host through FTP.
|
|
19
|
+
|
|
20
|
+
## Self-managed web server
|
|
21
|
+
|
|
22
|
+
If you have direct access yourself to the deployment web server yourself, the process is essentially the same, except you might have other methods available to you (such as `scp`, or even direct filesystem access) for transferring the files. Just remember to make sure the contents of the generated `_site` folder get placed in the appropriate web root directory for your web server.
|
|
23
|
+
|
|
24
|
+
## Automated methods
|
|
25
|
+
|
|
26
|
+
There are also a number of ways to easily automate the deployment of a Jekyll site. If you’ve got another method that isn’t listed below, we’d love it if you [contributed](../contributing/) so that everyone else can benefit too.
|
|
27
|
+
|
|
28
|
+
### Git post-update hook
|
|
29
|
+
|
|
30
|
+
If you store your jekyll site in [Git](http://git-scm.com/) (you are using version control, right?), it’s pretty easy to automate the
|
|
31
|
+
deployment process by setting up a post-update hook in your Git
|
|
32
|
+
repository, [like
|
|
33
|
+
this](http://web.archive.org/web/20091223025644/http://www.taknado.com/en/2009/03/26/deploying-a-jekyll-generated-site/).
|
|
34
|
+
|
|
35
|
+
### Git post-receive hook
|
|
36
|
+
|
|
37
|
+
To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
|
|
38
|
+
|
|
39
|
+
{% highlight bash %}
|
|
40
|
+
laptop$ ssh deployer@myserver.com
|
|
41
|
+
server$ mkdir myrepo.git
|
|
42
|
+
server$ cd myrepo.git
|
|
43
|
+
server$ git --bare init
|
|
44
|
+
server$ cp hooks/post-receive.sample hooks/post-receive
|
|
45
|
+
server$ mkdir /var/www/myrepo
|
|
46
|
+
{% endhighlight %}
|
|
47
|
+
|
|
48
|
+
Next, add the following lines to hooks/post-receive and be sure Jekyll is
|
|
49
|
+
installed on the server:
|
|
50
|
+
|
|
51
|
+
{% highlight bash %}
|
|
52
|
+
GIT_REPO=$HOME/myrepo.git
|
|
53
|
+
TMP_GIT_CLONE=$HOME/tmp/myrepo
|
|
54
|
+
PUBLIC_WWW=/var/www/myrepo
|
|
55
|
+
|
|
56
|
+
git clone $GIT_REPO $TMP_GIT_CLONE
|
|
57
|
+
jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
|
|
58
|
+
rm -Rf $TMP_GIT_CLONE
|
|
59
|
+
exit
|
|
60
|
+
{% endhighlight %}
|
|
61
|
+
|
|
62
|
+
Finally, run the following command on any users laptop that needs to be able to
|
|
63
|
+
deploy using this hook:
|
|
64
|
+
|
|
65
|
+
{% highlight bash %}
|
|
66
|
+
laptops$ git remote add deploy deployer@myserver.com:~/myrepo.git
|
|
67
|
+
{% endhighlight %}
|
|
68
|
+
|
|
69
|
+
Deploying is now as easy as telling nginx or Apache to look at
|
|
70
|
+
`/var/www/myrepo` and running the following:
|
|
71
|
+
|
|
72
|
+
{% highlight bash %}
|
|
73
|
+
laptops$ git push deploy master
|
|
74
|
+
{% endhighlight %}
|
|
75
|
+
|
|
76
|
+
### Rake
|
|
77
|
+
|
|
78
|
+
Another way to deploy your Jekyll site is to use [Rake](https://github.com/jimweirich/rake), [HighLine](https://github.com/JEG2/highline), and
|
|
79
|
+
[Net::SSH](http://net-ssh.rubyforge.org/). A more complex example of deploying Jekyll with Rake that deals with multiple branches can be found in [Git Ready](https://github.com/gitready/gitready/blob/en/Rakefile).
|
|
80
|
+
|
|
81
|
+
### rsync
|
|
82
|
+
|
|
83
|
+
Once you’ve generated the `_site` directory, you can easily rsync it using a `tasks/deploy` shell script similar to [this deploy script here](http://github.com/henrik/henrik.nyh.se/blob/master/tasks/deploy). You’d obviously need to change the values to reflect your site’s details. There is even [a matching TextMate command](http://gist.github.com/214959) that will help you run
|
|
84
|
+
this script from within Textmate.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Rack-Jekyll
|
|
88
|
+
|
|
89
|
+
[Rack-Jekyll](http://github.com/bry4n/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](http://github.com/rtomakyo/shotgun/), [rackup](http://github.com/rack/rack), [mongrel](http://github.com/mongrel/mongrel), [unicorn](http://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
|
|
90
|
+
|
|
91
|
+
Read [this post](http://blog.crowdint.com/2010/08/02/instant-blog-using-jekyll-and-heroku.html) on how to deploy to Heroku using Rack-Jekyll.
|
|
92
|
+
|
|
93
|
+
## Jekyll-Admin for Rails
|
|
94
|
+
|
|
95
|
+
If you want to maintain Jekyll inside your existing Rails app, [Jekyll-Admin](http://github.com/zkarpinski/Jekyll-Admin) contains drop in code to make this possible. See Jekyll-Admin’s [README](http://github.com/zkarpinski/Jekyll-Admin/blob/master/README) for more details.
|
|
96
|
+
|
|
97
|
+
## Amazon S3
|
|
98
|
+
|
|
99
|
+
If you want to host your site in Amazon S3, you can do so with
|
|
100
|
+
[s3_website](https://github.com/laurilehmijoki/s3_website) application. It will
|
|
101
|
+
push your site to Amazon S3 where it can be served like any web server,
|
|
102
|
+
dynamically scaling to almost unlimited traffic. This approach has the
|
|
103
|
+
benefit of being about the cheapest hosting option available for
|
|
104
|
+
low-volume blogs as you only pay for what you use.
|
|
105
|
+
|
|
106
|
+
<div class="note">
|
|
107
|
+
<h5>ProTip™: Use GitHub Pages for zero-hassle Jekyll hosting</h5>
|
|
108
|
+
<p>GitHub Pages are powered by Jekyll behind the scenes, so if you’re looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to <a href="../github-pages/">host your Jekyll-powered website for free</a>.</p>
|
|
109
|
+
</div>
|
data/site/docs/drafts.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Working with drafts
|
|
4
|
+
permalink: /docs/drafts/
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Drafts are posts without a date. They're posts you're still working on and don't want to
|
|
8
|
+
publish yet. To get up and running with drafts, create a `_drafts` folder in your site's
|
|
9
|
+
root (as described in the [site structure](/docs/structure/) section) and create your
|
|
10
|
+
first draft:
|
|
11
|
+
|
|
12
|
+
{% highlight text %}
|
|
13
|
+
|-- _drafts/
|
|
14
|
+
| |-- a-draft-post.md
|
|
15
|
+
{% endhighlight %}
|
|
16
|
+
|
|
17
|
+
To preview your site with drafts, simply run `jekyll serve` or `jekyll build` with
|
|
18
|
+
the `--drafts` switch. Each will be assigned the value of `Time.now`
|
|
19
|
+
for its date, and thus you will see them generated as the latest posts.
|
|
20
|
+
|
data/site/docs/extras.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Extras
|
|
4
|
+
prev_section: plugins
|
|
5
|
+
next_section: github-pages
|
|
6
|
+
permalink: /docs/extras/
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
There are a number of (optional) extra features that Jekyll supports that you
|
|
10
|
+
may want to install, depending on how you plan to use Jekyll.
|
|
11
|
+
|
|
12
|
+
## LaTeX Support
|
|
13
|
+
|
|
14
|
+
Maruku comes with optional support for LaTeX to PNG rendering via blahtex
|
|
15
|
+
(Version 0.6) which must be in your `$PATH` along with `dvips`. If you need
|
|
16
|
+
Maruku to not assume a fixed location for `dvips`, check out [Remi’s Maruku
|
|
17
|
+
fork](http://github.com/remi/maruku).
|
|
18
|
+
|
|
19
|
+
## RDiscount
|
|
20
|
+
|
|
21
|
+
If you prefer to use [RDiscount](http://github.com/rtomayko/rdiscount) instead
|
|
22
|
+
of [Maruku](http://github.com/bhollis/maruku) for Markdown, just make sure you have
|
|
23
|
+
it installed:
|
|
24
|
+
|
|
25
|
+
{% highlight bash %}
|
|
26
|
+
$ [sudo] gem install rdiscount
|
|
27
|
+
{% endhighlight %}
|
|
28
|
+
|
|
29
|
+
And then specify RDiscount as the Markdown engine in your `_config.yml` file to
|
|
30
|
+
have Jekyll run with that option.
|
|
31
|
+
|
|
32
|
+
{% highlight yaml %}
|
|
33
|
+
# In _config.yml
|
|
34
|
+
markdown: rdiscount
|
|
35
|
+
{% endhighlight %}
|
|
36
|
+
|
|
37
|
+
## Kramdown
|
|
38
|
+
|
|
39
|
+
You can also use [Kramdown](http://kramdown.rubyforge.org/) instead of Maruku
|
|
40
|
+
for Markdown. Make sure that Kramdown is installed:
|
|
41
|
+
|
|
42
|
+
{% highlight bash %}
|
|
43
|
+
$ [sudo] gem install kramdown
|
|
44
|
+
{% endhighlight %}
|
|
45
|
+
|
|
46
|
+
Then you can specify Kramdown as the Markdown engine in `_config.yml`.
|
|
47
|
+
|
|
48
|
+
{% highlight yaml %}
|
|
49
|
+
# In _config.yml
|
|
50
|
+
markdown: kramdown
|
|
51
|
+
{% endhighlight %}
|
|
52
|
+
|
|
53
|
+
Kramdown has various options for customizing the HTML output. The
|
|
54
|
+
[Configuration](/docs/configuration/) page lists the default options used by
|
|
55
|
+
Jekyll. A complete list of options is also available on the [Kramdown
|
|
56
|
+
website](http://kramdown.rubyforge.org/options.html).
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Front-matter
|
|
4
|
+
prev_section: configuration
|
|
5
|
+
next_section: posts
|
|
6
|
+
permalink: /docs/frontmatter/
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
The front-matter is where Jekyll starts to get really cool. Any file that
|
|
10
|
+
contains a [YAML](http://yaml.org/) front matter block will be processed by
|
|
11
|
+
Jekyll as a special file. The front matter must be the first thing in the file
|
|
12
|
+
and must take the form of valid YAML set between triple-dashed lines. Here is a
|
|
13
|
+
basic example:
|
|
14
|
+
|
|
15
|
+
{% highlight yaml %}
|
|
16
|
+
---
|
|
17
|
+
layout: post
|
|
18
|
+
title: Blogging Like a Hacker
|
|
19
|
+
---
|
|
20
|
+
{% endhighlight %}
|
|
21
|
+
|
|
22
|
+
Between these triple-dashed lines, you can set predefined variables (see below
|
|
23
|
+
for a reference) or even create custom ones of your own. These variables will
|
|
24
|
+
then be available to you to access using Liquid tags both further down in the
|
|
25
|
+
file and also in any layouts or includes that the page or post in question
|
|
26
|
+
relies on.
|
|
27
|
+
|
|
28
|
+
<div class="note warning">
|
|
29
|
+
<h5>UTF-8 Character Encoding Warning</h5>
|
|
30
|
+
<p>
|
|
31
|
+
If you use UTF-8 encoding, make sure that no <code>BOM</code> header
|
|
32
|
+
characters exist in your files or very, very bad things will happen to
|
|
33
|
+
Jekyll. This is especially relevant if you’re running Jekyll on Windows.
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="note">
|
|
38
|
+
<h5>ProTip™: Front Matter Variables Are Optional</h5>
|
|
39
|
+
<p>
|
|
40
|
+
If you want to use <a href="../variables/">Liquid tags and variables</a> but
|
|
41
|
+
don’t need anything in your front-matter, just leave it empty! The set of
|
|
42
|
+
triple-dashed lines with nothing in between will still get Jekyll to process
|
|
43
|
+
your file. (This is useful for things like CSS and RSS feeds!)
|
|
44
|
+
</p>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
## Predefined Global Variables
|
|
48
|
+
|
|
49
|
+
There are a number of predefined global variables that you can set in the
|
|
50
|
+
front-matter of a page or post.
|
|
51
|
+
|
|
52
|
+
<div class="mobile-side-scroller">
|
|
53
|
+
<table>
|
|
54
|
+
<thead>
|
|
55
|
+
<tr>
|
|
56
|
+
<th>Variable</th>
|
|
57
|
+
<th>Description</th>
|
|
58
|
+
</tr>
|
|
59
|
+
</thead>
|
|
60
|
+
<tbody>
|
|
61
|
+
<tr>
|
|
62
|
+
<td>
|
|
63
|
+
<p><code>layout</code></p>
|
|
64
|
+
</td>
|
|
65
|
+
<td>
|
|
66
|
+
<p>
|
|
67
|
+
|
|
68
|
+
If set, this specifies the layout file to use. Use the layout file
|
|
69
|
+
name without the file extension. Layout files must be placed in the
|
|
70
|
+
<code>_layouts</code> directory.
|
|
71
|
+
|
|
72
|
+
</p>
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
<tr>
|
|
76
|
+
<td>
|
|
77
|
+
<p><code>permalink</code></p>
|
|
78
|
+
</td>
|
|
79
|
+
<td>
|
|
80
|
+
<p>
|
|
81
|
+
|
|
82
|
+
If you need your processed blog post URLs to be something other than
|
|
83
|
+
the default <code>/year/month/day/title.html</code> then you can set
|
|
84
|
+
this variable and it will be used as the final URL.
|
|
85
|
+
|
|
86
|
+
</p>
|
|
87
|
+
</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td>
|
|
91
|
+
<p><code>published</code></p>
|
|
92
|
+
</td>
|
|
93
|
+
<td>
|
|
94
|
+
<p>
|
|
95
|
+
Set to false if you don’t want a specific post to show up when the
|
|
96
|
+
site is generated.
|
|
97
|
+
</p>
|
|
98
|
+
</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td>
|
|
102
|
+
<p style="margin-bottom: 5px;"><code>category</code></p>
|
|
103
|
+
<p><code>categories</code></p>
|
|
104
|
+
</td>
|
|
105
|
+
<td>
|
|
106
|
+
<p>
|
|
107
|
+
|
|
108
|
+
Instead of placing posts inside of folders, you can specify one or
|
|
109
|
+
more categories that the post belongs to. When the site is generated
|
|
110
|
+
the post will act as though it had been set with these categories
|
|
111
|
+
normally. Categories (plural key) can be specified as a <a
|
|
112
|
+
href="http://en.wikipedia.org/wiki/YAML#Lists">YAML list</a> or a
|
|
113
|
+
space-separated string.
|
|
114
|
+
|
|
115
|
+
</p>
|
|
116
|
+
</td>
|
|
117
|
+
</tr>
|
|
118
|
+
<tr>
|
|
119
|
+
<td>
|
|
120
|
+
<p><code>tags</code></p>
|
|
121
|
+
</td>
|
|
122
|
+
<td>
|
|
123
|
+
<p>
|
|
124
|
+
|
|
125
|
+
Similar to categories, one or multiple tags can be added to a post.
|
|
126
|
+
Also like categories, tags can be specified as a YAML list or a space-
|
|
127
|
+
separated string.
|
|
128
|
+
|
|
129
|
+
</p>
|
|
130
|
+
</td>
|
|
131
|
+
</tr>
|
|
132
|
+
</tbody>
|
|
133
|
+
</table>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
## Custom Variables
|
|
138
|
+
|
|
139
|
+
Any variables in the front matter that are not predefined are mixed into the
|
|
140
|
+
data that is sent to the Liquid templating engine during the conversion. For
|
|
141
|
+
instance, if you set a title, you can use that in your layout to set the page
|
|
142
|
+
title:
|
|
143
|
+
|
|
144
|
+
{% highlight html %}
|
|
145
|
+
<!DOCTYPE HTML>
|
|
146
|
+
<html>
|
|
147
|
+
<head>
|
|
148
|
+
<title>{% raw %}{{ page.title }}{% endraw %}</title>
|
|
149
|
+
</head>
|
|
150
|
+
<body>
|
|
151
|
+
...
|
|
152
|
+
{% endhighlight %}
|
|
153
|
+
|
|
154
|
+
## Predefined Variables for Posts
|
|
155
|
+
|
|
156
|
+
These are available out-of-the-box to be used in the front-matter for a post.
|
|
157
|
+
|
|
158
|
+
<div class="mobile-side-scroller">
|
|
159
|
+
<table>
|
|
160
|
+
<thead>
|
|
161
|
+
<tr>
|
|
162
|
+
<th>Variable</th>
|
|
163
|
+
<th>Description</th>
|
|
164
|
+
</tr>
|
|
165
|
+
</thead>
|
|
166
|
+
<tbody>
|
|
167
|
+
<tr>
|
|
168
|
+
<td>
|
|
169
|
+
<p><code>date</code></p>
|
|
170
|
+
</td>
|
|
171
|
+
<td>
|
|
172
|
+
<p>
|
|
173
|
+
A date here overrides the date from the name of the post. This can be
|
|
174
|
+
used to ensure correct sorting of posts.
|
|
175
|
+
</p>
|
|
176
|
+
</td>
|
|
177
|
+
</tr>
|
|
178
|
+
</tbody>
|
|
179
|
+
</table>
|
|
180
|
+
</div>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: GitHub Pages
|
|
4
|
+
prev_section: extras
|
|
5
|
+
next_section: deployment-methods
|
|
6
|
+
permalink: /docs/github-pages/
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
[GitHub Pages](http://pages.github.com) are public web pages for users,
|
|
10
|
+
organizations, and repositories, that are freely hosted on GitHub's
|
|
11
|
+
[github.io]() domain or on a custom domain name of your choice. GitHub Pages are
|
|
12
|
+
powered by Jekyll behind the scenes, so in addition to supporting regular HTML
|
|
13
|
+
content, they’re also a great way to host your Jekyll-powered website for free.
|
|
14
|
+
|
|
15
|
+
## Deploying Jekyll to GitHub Pages
|
|
16
|
+
|
|
17
|
+
GitHub Pages work by looking at certain branches of repositories on GitHub.
|
|
18
|
+
There are two basic types available: user/organization pages and project pages.
|
|
19
|
+
The way to deploy these two types of sites are nearly identical, except for a
|
|
20
|
+
few minor details.
|
|
21
|
+
|
|
22
|
+
### User and Organization Pages
|
|
23
|
+
|
|
24
|
+
User and organization pages live in a special GitHub repository dedicated to
|
|
25
|
+
only the GitHub Pages files. This repository must be named after the account
|
|
26
|
+
name. For example, [@mojombo’s user page
|
|
27
|
+
repository](https://github.com/mojombo/mojombo.github.io) has the name
|
|
28
|
+
`mojombo.github.io`.
|
|
29
|
+
|
|
30
|
+
Content from the `master` branch of your repository will be used to build and
|
|
31
|
+
publish the GitHub Pages site, so make sure your Jekyll site is stored there.
|
|
32
|
+
|
|
33
|
+
<div class="note info">
|
|
34
|
+
<h5>Custom domains do not affect repository names</h5>
|
|
35
|
+
<p>
|
|
36
|
+
GitHub Pages are initially configured to live under the
|
|
37
|
+
<code>username.github.io</code> subdomain, which is why repositories must
|
|
38
|
+
be named this way <strong>even if a custom domain is being used</strong>.
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
### Project Pages
|
|
43
|
+
|
|
44
|
+
Unlike user and organization Pages, Project Pages are kept in the same
|
|
45
|
+
repository as the project they are for, except that the website content is
|
|
46
|
+
stored in a specially named `gh-pages` branch. The content of this branch will
|
|
47
|
+
be rendered using Jekyll, and the output will become available under a subpath
|
|
48
|
+
of your user pages subdomain, such as `username.github.io/project` (unless a
|
|
49
|
+
custom domain is specified—see below).
|
|
50
|
+
|
|
51
|
+
The Jekyll project repository itself is a perfect example of this branch
|
|
52
|
+
structure—the [master branch]({{ site.repository }}) contains the
|
|
53
|
+
actual software project for Jekyll, however the Jekyll website (that you’re
|
|
54
|
+
looking at right now) is contained in the [gh-pages
|
|
55
|
+
branch]({{ site.repository }}/tree/gh-pages) of the same repository.
|
|
56
|
+
|
|
57
|
+
### Project Page URL Structure
|
|
58
|
+
|
|
59
|
+
Sometimes it's nice to preview your Jekyll site before you push your `gh-pages`
|
|
60
|
+
branch to GitHub. However, the subdirectory-like URL structure GitHub uses for
|
|
61
|
+
Project Pages complicates the proper resolution of URLs. Here is an approach to
|
|
62
|
+
utilizing the GitHub Project Page URL structure (`username.github.io/project-name/`)
|
|
63
|
+
whilst maintaining the ability to preview your Jekyll site locally.
|
|
64
|
+
|
|
65
|
+
1. In `_config.yml`, set the `baseurl` option to `/project-name` -- note the
|
|
66
|
+
leading slash and the **absence** of a trailing slash.
|
|
67
|
+
2. When referencing JS or CSS files, do it like this:
|
|
68
|
+
`{% raw %}{{ site.baseurl}}/path/to/css.css{% endraw %}` -- note the slash
|
|
69
|
+
immediately following the variable (just before "path").
|
|
70
|
+
3. When doing permalinks or internal links, do it like this:
|
|
71
|
+
`{% raw %}{{ site.baseurl }}{{ post.url }}{% endraw %}` -- note that there
|
|
72
|
+
is **no** slash between the two variables.
|
|
73
|
+
4. Finally, if you'd like to preview your site before committing/deploying using
|
|
74
|
+
`jekyll serve`, be sure to pass an **empty string** to the `--baseurl` option,
|
|
75
|
+
so that you can view everything at `localhost:4000` normally (without
|
|
76
|
+
`/project-name` at the beginning): `jekyll serve --baseurl ''`
|
|
77
|
+
|
|
78
|
+
This way you can preview your site locally from the site root on localhost,
|
|
79
|
+
but when GitHub generates your pages from the gh-pages branch all the URLs
|
|
80
|
+
will start with `/project-name` and resolve properly.
|
|
81
|
+
|
|
82
|
+
<div class="note">
|
|
83
|
+
<h5>GitHub Pages Documentation, Help, and Support</h5>
|
|
84
|
+
<p>
|
|
85
|
+
For more information about what you can do with GitHub Pages, as well as for
|
|
86
|
+
troubleshooting guides, you should check out <a
|
|
87
|
+
href="https://help.github.com/categories/20/articles">GitHub’s Pages Help
|
|
88
|
+
section</a>. If all else fails, you should contact <a
|
|
89
|
+
href="https://github.com/contact">GitHub Support</a>.
|
|
90
|
+
</p>
|
|
91
|
+
</div>
|