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.
Files changed (188) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.markdown +91 -0
  3. data/Gemfile +1 -1
  4. data/History.markdown +772 -0
  5. data/{README.md → README.markdown} +5 -2
  6. data/Rakefile +163 -1
  7. data/bin/monad +86 -30
  8. data/features/create_sites.feature +54 -25
  9. data/features/data.feature +65 -0
  10. data/features/data_sources.feature +10 -10
  11. data/features/drafts.feature +5 -5
  12. data/features/embed_filters.feature +10 -10
  13. data/features/include_tag.feature +48 -0
  14. data/features/markdown.feature +5 -5
  15. data/features/pagination.feature +38 -10
  16. data/features/permalinks.feature +31 -11
  17. data/features/post_data.feature +41 -41
  18. data/features/post_excerpts.feature +50 -0
  19. data/features/site_configuration.feature +47 -26
  20. data/features/site_data.feature +30 -24
  21. data/features/step_definitions/{monad_steps.rb → jekyll_steps.rb} +66 -52
  22. data/features/support/env.rb +27 -8
  23. data/lib/jekyll.rb +99 -0
  24. data/lib/jekyll/cleaner.rb +73 -0
  25. data/lib/{monad → jekyll}/command.rb +6 -6
  26. data/lib/{monad → jekyll}/commands/build.rb +9 -9
  27. data/lib/jekyll/commands/doctor.rb +67 -0
  28. data/lib/jekyll/commands/new.rb +67 -0
  29. data/lib/jekyll/commands/serve.rb +65 -0
  30. data/lib/{monad → jekyll}/configuration.rb +60 -18
  31. data/lib/{monad → jekyll}/converter.rb +1 -1
  32. data/lib/{monad → jekyll}/converters/identity.rb +1 -1
  33. data/lib/{monad → jekyll}/converters/markdown.rb +2 -2
  34. data/lib/jekyll/converters/markdown/kramdown_parser.rb +29 -0
  35. data/lib/{monad → jekyll}/converters/markdown/maruku_parser.rb +12 -8
  36. data/lib/{monad → jekyll}/converters/markdown/rdiscount_parser.rb +4 -2
  37. data/lib/{monad → jekyll}/converters/markdown/redcarpet_parser.rb +1 -1
  38. data/lib/{monad → jekyll}/converters/textile.rb +1 -1
  39. data/lib/{monad → jekyll}/convertible.rb +39 -17
  40. data/lib/{monad → jekyll}/core_ext.rb +22 -4
  41. data/lib/jekyll/deprecator.rb +36 -0
  42. data/lib/{monad → jekyll}/draft.rb +1 -1
  43. data/lib/{monad → jekyll}/drivers/json_driver.rb +1 -1
  44. data/lib/{monad → jekyll}/drivers/yaml_driver.rb +1 -1
  45. data/lib/{monad → jekyll}/errors.rb +1 -1
  46. data/lib/jekyll/excerpt.rb +113 -0
  47. data/lib/{monad → jekyll}/filters.rb +16 -6
  48. data/lib/{monad → jekyll}/generator.rb +1 -1
  49. data/lib/jekyll/generators/pagination.rb +214 -0
  50. data/lib/{monad → jekyll}/layout.rb +4 -1
  51. data/lib/{monad → jekyll}/mime.types +0 -0
  52. data/lib/{monad → jekyll}/page.rb +36 -39
  53. data/lib/{monad → jekyll}/plugin.rb +1 -1
  54. data/lib/{monad → jekyll}/post.rb +58 -123
  55. data/lib/jekyll/related_posts.rb +59 -0
  56. data/lib/{monad → jekyll}/site.rb +120 -123
  57. data/lib/{monad → jekyll}/static_file.rb +1 -1
  58. data/lib/jekyll/stevenson.rb +89 -0
  59. data/lib/jekyll/tags/gist.rb +48 -0
  60. data/lib/{monad → jekyll}/tags/highlight.rb +3 -3
  61. data/lib/jekyll/tags/include.rb +135 -0
  62. data/lib/{monad → jekyll}/tags/post_url.rb +8 -6
  63. data/lib/jekyll/url.rb +67 -0
  64. data/lib/monad.rb +36 -27
  65. data/lib/site_template/_config.yml +2 -1
  66. data/lib/site_template/_layouts/default.html +21 -23
  67. data/lib/site_template/_layouts/post.html +1 -1
  68. data/lib/site_template/_posts/{0000-00-00-welcome-to-monad.markdown.erb → 0000-00-00-welcome-to-jekyll.markdown.erb} +6 -6
  69. data/lib/site_template/css/main.css +22 -27
  70. data/lib/site_template/index.html +2 -2
  71. data/monad.gemspec +153 -52
  72. data/site/.gitignore +4 -0
  73. data/site/CNAME +1 -0
  74. data/site/README +1 -0
  75. data/site/_config.yml +6 -0
  76. data/site/_includes/analytics.html +32 -0
  77. data/site/_includes/docs_contents.html +16 -0
  78. data/site/_includes/docs_contents_mobile.html +23 -0
  79. data/site/_includes/docs_option.html +11 -0
  80. data/site/_includes/docs_ul.html +20 -0
  81. data/site/_includes/footer.html +15 -0
  82. data/site/_includes/header.html +18 -0
  83. data/site/_includes/news_contents.html +23 -0
  84. data/site/_includes/news_contents_mobile.html +11 -0
  85. data/site/_includes/news_item.html +24 -0
  86. data/site/_includes/primary-nav-items.html +14 -0
  87. data/site/_includes/section_nav.html +22 -0
  88. data/site/_includes/top.html +17 -0
  89. data/site/_layouts/default.html +12 -0
  90. data/site/_layouts/docs.html +23 -0
  91. data/site/_layouts/news.html +19 -0
  92. data/site/_layouts/news_item.html +27 -0
  93. data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +23 -0
  94. data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +27 -0
  95. data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +28 -0
  96. data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +25 -0
  97. data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +27 -0
  98. data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +31 -0
  99. data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +20 -0
  100. data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +20 -0
  101. data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +23 -0
  102. data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +19 -0
  103. data/site/css/gridism.css +110 -0
  104. data/site/css/normalize.css +1 -0
  105. data/site/css/pygments.css +70 -0
  106. data/site/css/style.css +946 -0
  107. data/site/docs/configuration.md +373 -0
  108. data/site/docs/contributing.md +128 -0
  109. data/site/docs/datafiles.md +63 -0
  110. data/site/docs/deployment-methods.md +109 -0
  111. data/site/docs/drafts.md +20 -0
  112. data/site/docs/extras.md +56 -0
  113. data/site/docs/frontmatter.md +180 -0
  114. data/site/docs/github-pages.md +91 -0
  115. data/site/docs/heroku.md +9 -0
  116. data/site/docs/history.md +722 -0
  117. data/site/docs/index.md +52 -0
  118. data/site/docs/installation.md +76 -0
  119. data/site/docs/migrations.md +257 -0
  120. data/site/docs/pages.md +86 -0
  121. data/site/docs/pagination.md +211 -0
  122. data/site/docs/permalinks.md +180 -0
  123. data/site/docs/plugins.md +508 -0
  124. data/site/docs/posts.md +181 -0
  125. data/site/docs/quickstart.md +32 -0
  126. data/site/docs/resources.md +46 -0
  127. data/site/docs/sites.md +29 -0
  128. data/site/docs/structure.md +190 -0
  129. data/site/docs/templates.md +319 -0
  130. data/site/docs/troubleshooting.md +150 -0
  131. data/site/docs/upgrading.md +146 -0
  132. data/site/docs/usage.md +63 -0
  133. data/site/docs/variables.md +322 -0
  134. data/site/favicon.png +0 -0
  135. data/site/feed.xml +36 -0
  136. data/site/freenode.txt +1 -0
  137. data/site/img/article-footer.png +0 -0
  138. data/site/img/footer-arrow.png +0 -0
  139. data/site/img/footer-logo.png +0 -0
  140. data/site/img/logo-2x.png +0 -0
  141. data/site/img/octojekyll.png +0 -0
  142. data/site/img/tube.png +0 -0
  143. data/site/img/tube1x.png +0 -0
  144. data/site/index.html +90 -0
  145. data/site/js/modernizr-2.5.3.min.js +4 -0
  146. data/site/news/index.html +10 -0
  147. data/site/news/releases/index.html +10 -0
  148. data/test/helper.rb +6 -3
  149. data/test/source/+/foo.md +7 -0
  150. data/test/source/_data/languages.yml +2 -0
  151. data/test/source/_data/members.yaml +7 -0
  152. data/test/source/_data/products.yml +4 -0
  153. data/test/source/_includes/params.html +7 -0
  154. data/test/source/_layouts/default.html +1 -1
  155. data/test/source/_layouts/post/simple.html +1 -0
  156. data/test/source/_plugins/dummy.rb +1 -1
  157. data/test/source/_posts/2013-01-02-post-excerpt.markdown +1 -1
  158. data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +23 -0
  159. data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
  160. data/test/source/deal.with.dots.html +1 -1
  161. data/test/source/products.yml +4 -0
  162. data/test/test_configuration.rb +46 -11
  163. data/test/test_convertible.rb +2 -2
  164. data/test/test_excerpt.rb +78 -0
  165. data/test/test_filters.rb +4 -4
  166. data/test/test_generated_site.rb +13 -13
  167. data/test/test_json_driver.rb +9 -9
  168. data/test/test_kramdown.rb +32 -5
  169. data/test/test_new_command.rb +8 -8
  170. data/test/test_page.rb +12 -3
  171. data/test/test_pager.rb +34 -33
  172. data/test/test_post.rb +34 -26
  173. data/test/test_redcloth.rb +3 -3
  174. data/test/test_related_posts.rb +47 -0
  175. data/test/test_site.rb +102 -44
  176. data/test/test_tags.rb +168 -23
  177. data/test/test_url.rb +28 -0
  178. data/test/test_yaml_driver.rb +6 -6
  179. metadata +215 -137
  180. data/lib/monad/commands/doctor.rb +0 -29
  181. data/lib/monad/commands/new.rb +0 -50
  182. data/lib/monad/commands/serve.rb +0 -33
  183. data/lib/monad/converters/markdown/kramdown_parser.rb +0 -44
  184. data/lib/monad/deprecator.rb +0 -32
  185. data/lib/monad/generators/pagination.rb +0 -143
  186. data/lib/monad/logger.rb +0 -54
  187. data/lib/monad/tags/gist.rb +0 -30
  188. data/lib/monad/tags/include.rb +0 -37
@@ -0,0 +1,181 @@
1
+ ---
2
+ layout: docs
3
+ title: Writing posts
4
+ prev_section: frontmatter
5
+ next_section: pages
6
+ permalink: /docs/posts/
7
+ ---
8
+
9
+ One of Jekyll’s best aspects is that it is “blog aware”. What does this mean,
10
+ exactly? Well, simply put, it means that blogging is baked into Jekyll’s
11
+ functionality. If you write articles and publish them online, this means that
12
+ you can publish and maintain a blog simply by managing a folder of text-files on
13
+ your computer. Compared to the hassle of configuring and maintaining databases
14
+ and web-based CMS systems, this will be a welcome change!
15
+
16
+ ## The Posts Folder
17
+
18
+ As explained on the [directory structure](../structure/) page, the `_posts`
19
+ folder is where your blog posts will live. These files can be either
20
+ [Markdown](http://daringfireball.net/projects/markdown/) or
21
+ [Textile](http://textile.sitemonks.com/) formatted text files, and as long as
22
+ they have [YAML front-matter](../frontmatter/), they will be converted from their
23
+ source format into an HTML page that is part of your static site.
24
+
25
+ ### Creating Post Files
26
+
27
+ To create a new post, all you need to do is create a new file in the `_posts`
28
+ directory. How you name files in this folder is important. Jekyll requires blog
29
+ post files to be named according to the following format:
30
+
31
+ {% highlight bash %}
32
+ YEAR-MONTH-DAY-title.MARKUP
33
+ {% endhighlight %}
34
+
35
+ Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit
36
+ numbers, and `MARKUP` is the file extension representing the format used in the
37
+ file. For example, the following are examples of valid post filenames:
38
+
39
+ {% highlight bash %}
40
+ 2011-12-31-new-years-eve-is-awesome.md
41
+ 2012-09-12-how-to-write-a-blog.textile
42
+ {% endhighlight %}
43
+
44
+ ### Content Formats
45
+
46
+ All blog post files must begin with [YAML front- matter](../frontmatter/). After
47
+ that, it's simply a matter of deciding which format you prefer. Jekyll supports
48
+ two popular content markup formats:
49
+ [Markdown](http://daringfireball.net/projects/markdown/) and
50
+ [Textile](http://textile.sitemonks.com/). These formats each have their own way
51
+ of marking up different types of content within a post, so you should
52
+ familiarize yourself with these formats and decide which one best suits your
53
+ needs.
54
+
55
+ ## Including images and resources
56
+
57
+ Chances are, at some point, you'll want to include images, downloads, or other
58
+ digital assets along with your text content. While the syntax for linking to
59
+ these resources differs between Markdown and Textile, the problem of working out
60
+ where to store these files in your site is something everyone will face.
61
+
62
+ Because of Jekyll’s flexibility, there are many solutions to how to do this. One
63
+ common solution is to create a folder in the root of the project directory
64
+ called something like `assets` or `downloads`, into which any images, downloads
65
+ or other resources are placed. Then, from within any post, they can be linked to
66
+ using the site’s root as the path for the asset to include. Again, this will
67
+ depend on the way your site’s (sub)domain and path are configured, but here some
68
+ examples (in Markdown) of how you could do this using the `site.url` variable in
69
+ a post.
70
+
71
+ Including an image asset in a post:
72
+
73
+ {% highlight text %}
74
+ … which is shown in the screenshot below:
75
+ ![My helpful screenshot]({% raw %}{{ site.url }}{% endraw %}/assets/screenshot.jpg)
76
+ {% endhighlight %}
77
+
78
+ Linking to a PDF for readers to download:
79
+
80
+ {% highlight text %}
81
+ … you can [get the PDF]({% raw %}{{ site.url }}{% endraw %}/assets/mydoc.pdf) directly.
82
+ {% endhighlight %}
83
+
84
+ <div class="note">
85
+ <h5>ProTip™: Link using just the site root URL</h5>
86
+ <p>
87
+ You can skip the <code>{% raw %}{{ site.url }}{% endraw %}</code> variable
88
+ if you <strong>know</strong> your site will only ever be displayed at the
89
+ root URL of your domain. In this case you can reference assets directly with
90
+ just <code>/path/file.jpg</code>.
91
+ </p>
92
+ </div>
93
+
94
+ ## Displaying an index of posts
95
+
96
+ It’s all well and good to have posts in a folder, but a blog is no use unless
97
+ you have a list of posts somewhere. Creating an index of posts on another page
98
+ (or in a [template](../templates/)) is easy, thanks to the [Liquid template
99
+ language](http://wiki.shopify.com/Liquid) and its tags. Here’s a basic example of how
100
+ to create a list of links to your blog posts:
101
+
102
+ {% highlight html %}
103
+ <ul>
104
+ {% raw %}{% for post in site.posts %}{% endraw %}
105
+ <li>
106
+ <a href="{% raw %}{{ post.url }}{% endraw %}">{% raw %}{{ post.title }}{% endraw %}</a>
107
+ </li>
108
+ {% raw %}{% endfor %}{% endraw %}
109
+ </ul>
110
+ {% endhighlight %}
111
+
112
+ Of course, you have full control over how (and where) you display your posts,
113
+ and how you structure your site. You should read more about [how templates
114
+ work](../templates/) with Jekyll if you want to know more.
115
+
116
+ ## Post excerpts
117
+
118
+ Each post automatically takes the first block of text, from the beginning of the content
119
+ to the first occurrence of `excerpt_separator`, and sets it as the `post.excerpt`.
120
+ Take the above example of an index of posts. Perhaps you want to include
121
+ a little hint about the post's content by adding the first paragraph of each of your
122
+ posts:
123
+
124
+ {% highlight html %}
125
+ <ul>
126
+ {% raw %}{% for post in site.posts %}{% endraw %}
127
+ <li>
128
+ <a href="{% raw %}{{ post.url }}{% endraw %}">{% raw %}{{ post.title }}{% endraw %}</a>
129
+ <p>{% raw %}{{ post.excerpt }}{% endraw %}</p>
130
+ </li>
131
+ {% raw %}{% endfor %}{% endraw %}
132
+ </ul>
133
+ {% endhighlight %}
134
+
135
+ If you don't like the automatically-generated post excerpt, it can be overridden by adding
136
+ `excerpt` to your post's YAML front-matter. Completely disable it by setting
137
+ your `excerpt_separator` to `""`.
138
+
139
+ ## Highlighting code snippets
140
+
141
+ Jekyll also has built-in support for syntax highlighting of code snippets using
142
+ Pygments, and including a code snippet in any post is easy. Just use the
143
+ dedicated Liquid tag as follows:
144
+
145
+ {% highlight text %}
146
+ {% raw %}{% highlight ruby %}{% endraw %}
147
+ def show
148
+ @widget = Widget(params[:id])
149
+ respond_to do |format|
150
+ format.html # show.html.erb
151
+ format.json { render json: @widget }
152
+ end
153
+ end
154
+ {% raw %}{% endhighlight %}{% endraw %}
155
+ {% endhighlight %}
156
+
157
+ And the output will look like this:
158
+
159
+ {% highlight ruby %}
160
+ def show
161
+ @widget = Widget(params[:id])
162
+ respond_to do |format|
163
+ format.html # show.html.erb
164
+ format.json { render json: @widget }
165
+ end
166
+ end
167
+ {% endhighlight %}
168
+
169
+ <div class="note">
170
+ <h5>ProTip™: Show line numbers</h5>
171
+ <p>
172
+ You can make code snippets include line-numbers by adding the word
173
+ <code>linenos</code> to the end of the opening highlight tag like this:
174
+ <code>{% raw %}{% highlight ruby linenos %}{% endraw %}</code>.
175
+ </p>
176
+ </div>
177
+
178
+ These basics should be enough to get you started writing your first posts. When
179
+ you’re ready to dig into what else is possible, you might be interested in doing
180
+ things like [customizing post permalinks](../permalinks/) or using [custom
181
+ variables](../variables/) in your posts and elsewhere on your site.
@@ -0,0 +1,32 @@
1
+ ---
2
+ layout: docs
3
+ title: Quick-start guide
4
+ prev_section: home
5
+ next_section: installation
6
+ permalink: /docs/quickstart/
7
+ ---
8
+
9
+ For the impatient, here's how to get a boilerplate Jekyll site up and running.
10
+
11
+ {% highlight bash %}
12
+ ~ $ gem install jekyll
13
+ ~ $ jekyll new myblog
14
+ ~ $ cd myblog
15
+ ~/myblog $ jekyll serve
16
+ # => Now browse to http://localhost:4000
17
+ {% endhighlight %}
18
+
19
+ That's nothing, though. The real magic happens when you start creating blog
20
+ posts, using the front-matter to control templates and layouts, and taking
21
+ advantage of all the awesome configuration options Jekyll makes available.
22
+
23
+ <div class="note info">
24
+ <h5>Redcarpet is the default Markdown engine for new sites</h5>
25
+ <p>In Jekyll 1.1, we switched the default markdown engine for sites
26
+ generated with <code>jekyll new</code> to Redcarpet</p>
27
+ </div>
28
+
29
+ If you're running into problems, ensure you have all the [requirements
30
+ installed][Installation].
31
+
32
+ [Installation]: /docs/installation/
@@ -0,0 +1,46 @@
1
+ ---
2
+ layout: docs
3
+ title: Resources
4
+ prev_section: sites
5
+ next_section: upgrading
6
+ permalink: /docs/resources/
7
+ ---
8
+
9
+ Jekyll’s growing use is producing a wide variety of tutorials, frameworks, extensions, examples, and other resources that can be very helpful. Below is a collection of links to some of the most popular Jekyll resources.
10
+
11
+ ### Jekyll tips & tricks, and examples
12
+
13
+ - [Tips for working with GitHub Pages Integration](https://gist.github.com/2890453)
14
+
15
+ Code example reuse, and keeping documentation up to date.
16
+
17
+ - [Use Simple Form to integrate a simple contact
18
+ form](http://getsimpleform.com/)
19
+ - [JekyllBootstrap.com](http://jekyllbootstrap.com)
20
+
21
+ Provides detailed explanations, examples, and helper-code to make
22
+ getting started with Jekyll easier.
23
+
24
+ ### Tutorials
25
+
26
+ #### Integrating Jekyll with Git
27
+
28
+ - [Blogging with Git, Emacs and Jekyll](http://metajack.im/2009/01/23/blogging-with-git-emacs-and-jekyll/)
29
+
30
+ #### Other hacks
31
+
32
+ - [Integrating Twitter with Jekyll](http://www.justkez.com/integrating-twitter-with-jekyll/)
33
+ > “Having migrated Justkez.com to be based on Jekyll, I was pondering how I might include my recent twitterings on the front page of the site. In the WordPress world, this would have been done via a plugin which may or may not have hung the loading of the page, might have employed caching, but would certainly have had some overheads. … Not in Jekyll.”
34
+ - [‘My Jekyll Fork’, by Mike West](http://mikewest.org/2009/11/my-jekyll-fork)
35
+ > “Jekyll is a well-architected throwback to a time before WordPress, when men were men, and HTML was static. I like the ideas it espouses, and have made a few improvements to it’s core. Here, I’ll point out some highlights of my fork in the hopes that they see usage beyond this site.”
36
+ - [‘About this Website’, by Carter Allen](http://cartera.me/2010/08/12/about-this-website/)
37
+ > “Jekyll is everything that I ever wanted in a blogging engine. Really. It isn’t perfect, but what’s excellent about it is that if there’s something wrong, I know exactly how it works and how to fix it. It runs on the your machine only, and is essentially an added”build" step between you and the browser. I coded this entire site in TextMate using standard HTML5 and CSS3, and then at the end I added just a few little variables to the markup. Presto-chango, my site is built and I am at peace with the world.”
38
+ - [Generating a Tag Cloud in Jekyll](http://www.justkez.com/generating-a-tag-cloud-in-jekyll/)
39
+
40
+ A guide to implementing a tag cloud and per-tag content pages using Jekyll.
41
+
42
+ - [Jekyll Extensions -= Pain](http://rfelix.com/2010/01/19/jekyll-extensions-minus-equal-pain/)
43
+
44
+ A way to [extend Jekyll](http://github.com/rfelix/jekyll_ext) without forking and modifying the Jekyll gem codebase and some [portable Jekyll extensions](http://wiki.github.com/rfelix/jekyll_ext/extensions) that can be reused and shared.
45
+
46
+ - [Using your Rails layouts in Jekyll](http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll)
@@ -0,0 +1,29 @@
1
+ ---
2
+ layout: docs
3
+ title: Sites using Jekyll
4
+ prev_section: troubleshooting
5
+ next_section: resources
6
+ permalink: /docs/sites/
7
+ ---
8
+
9
+ It’s interesting to see what designs and features others have come up
10
+ with. Below are some Jekyll-powered blogs which were hand-picked for
11
+ learning purposes.
12
+
13
+ - [Tom Preston-Werner](http://tom.preston-werner.com/)
14
+ ([source](http://github.com/mojombo/mojombo.github.com))
15
+ - [Nick Quaranto](http://quaran.to/)
16
+ ([source](https://github.com/qrush/qrush.github.com))
17
+ - [Roger Chapman](http://rogchap.com/)
18
+ ([source](https://github.com/rogchap/rogchap.github.com))
19
+ - [GitHub Official Teaching Materials](http://teach.github.com)
20
+ ([source](https://github.com/github/teach.github.com))
21
+ - [Rasmus Andersson](http://rsms.me/)
22
+ ([source](https://github.com/rsms/rsms.github.com))
23
+ - [Scott Chacon](http://schacon.github.com)
24
+ ([source](https://github.com/schacon/schacon.github.com))
25
+
26
+ If you would like to explore more examples, you can find a list of sites
27
+ and their sources on the ["Sites" page in the Jekyll wiki][jekyll-sites].
28
+
29
+ [jekyll-sites]: {{ site.repository }}/wiki/Sites
@@ -0,0 +1,190 @@
1
+ ---
2
+ layout: docs
3
+ title: Directory structure
4
+ prev_section: usage
5
+ next_section: configuration
6
+ permalink: /docs/structure/
7
+ ---
8
+
9
+ Jekyll is, at its core, a text transformation engine. The concept behind the
10
+ system is this: you give it text written in your favorite markup language, be
11
+ that Markdown, Textile, or just plain HTML, and it churns that through a layout
12
+ or series of layout files. Throughout that process you can tweak how you want
13
+ the site URLs to look, what data gets displayed in the layout, and more. This is
14
+ all done through editing text files, and the static web site is the final
15
+ product.
16
+
17
+ A basic Jekyll site usually looks something like this:
18
+
19
+ {% highlight bash %}
20
+ .
21
+ ├── _config.yml
22
+ ├── _drafts
23
+ | ├── begin-with-the-crazy-ideas.textile
24
+ | └── on-simplicity-in-technology.markdown
25
+ ├── _includes
26
+ | ├── footer.html
27
+ | └── header.html
28
+ ├── _layouts
29
+ | ├── default.html
30
+ | └── post.html
31
+ ├── _posts
32
+ | ├── 2007-10-29-why-every-programmer-should-play-nethack.textile
33
+ | └── 2009-04-26-barcamp-boston-4-roundup.textile
34
+ ├── _data
35
+ | └── members.yml
36
+ ├── _site
37
+ └── index.html
38
+ {% endhighlight %}
39
+
40
+ An overview of what each of these does:
41
+
42
+ <div class="mobile-side-scroller">
43
+ <table>
44
+ <thead>
45
+ <tr>
46
+ <th>File / Directory</th>
47
+ <th>Description</th>
48
+ </tr>
49
+ </thead>
50
+ <tbody>
51
+ <tr>
52
+ <td>
53
+ <p><code>_config.yml</code></p>
54
+ </td>
55
+ <td>
56
+ <p>
57
+
58
+ Stores <a href="../configuration/">configuration</a> data. Many of
59
+ these options can be specified from the command line executable but
60
+ it’s easier to specify them here so you don’t have to remember them.
61
+
62
+ </p>
63
+ </td>
64
+ </tr>
65
+ <tr>
66
+ <td>
67
+ <p><code>_drafts</code></p>
68
+ </td>
69
+ <td>
70
+ <p>
71
+
72
+ Drafts are unpublished posts. The format of these files is without a date: <code>title.MARKUP</code>. Learn how to <a href="../drafts/">work with drafts</a>.
73
+
74
+ </p>
75
+ </td>
76
+ </tr>
77
+ <tr>
78
+ <td>
79
+ <p><code>_includes</code></p>
80
+ </td>
81
+ <td>
82
+ <p>
83
+
84
+ These are the partials that can be mixed and matched by your layouts
85
+ and posts to facilitate reuse. The liquid tag
86
+ <code>{% raw %}{% include file.ext %}{% endraw %}</code>
87
+ can be used to include the partial in
88
+ <code>_includes/file.ext</code>.
89
+
90
+ </p>
91
+ </td>
92
+ </tr>
93
+ <tr>
94
+ <td>
95
+ <p><code>_layouts</code></p>
96
+ </td>
97
+ <td>
98
+ <p>
99
+
100
+ These are the templates that wrap posts. Layouts are chosen on a post-
101
+ by-post basis in the <a href="../frontmatter/">YAML front matter</a>,
102
+ which is described in the next section. The liquid tag
103
+ <code>{% raw %}{{ content }}{% endraw %}</code>
104
+ is used to inject content into the web page.
105
+
106
+ </p>
107
+ </td>
108
+ </tr>
109
+ <tr>
110
+ <td>
111
+ <p><code>_posts</code></p>
112
+ </td>
113
+ <td>
114
+ <p>
115
+
116
+ Your dynamic content, so to speak. The format of these files is
117
+ important, and must follow the format:
118
+ <code>YEAR-MONTH-DAY-title.MARKUP</code>.
119
+ The <a href="../permalinks/">permalinks</a> can be customized for each
120
+ post, but the date and markup language are determined solely by the
121
+ file name.
122
+
123
+ </p>
124
+ </td>
125
+ </tr>
126
+ <tr>
127
+ <td>
128
+ <p><code>_data</code></p>
129
+ </td>
130
+ <td>
131
+ <p>
132
+
133
+ Well-formatted site data should be placed here. The jekyll engine will
134
+ autoload all yaml files (ends with <code>.yml</code> or <code>.yaml</code>)
135
+ in this directory. If there's a file <code>members.yml</code> under the directory,
136
+ then you can access contents of the file through <code>site.data.members</code>.
137
+
138
+ </p>
139
+ </td>
140
+ </tr>
141
+ <tr>
142
+ <td>
143
+ <p><code>_site</code></p>
144
+ </td>
145
+ <td>
146
+ <p>
147
+
148
+ This is where the generated site will be placed (by default) once
149
+ Jekyll is done transforming it. It’s probably a good idea to add this
150
+ to your <code>.gitignore</code> file.
151
+
152
+ </p>
153
+ </td>
154
+ </tr>
155
+ <tr>
156
+ <td>
157
+ <p><code>index.html</code> and other HTML, Markdown, Textile files</p>
158
+ </td>
159
+ <td>
160
+ <p>
161
+
162
+ Provided that the file has a <a href="../frontmatter/">YAML Front
163
+ Matter</a> section, it will be transformed by Jekyll. The same will
164
+ happen for any <code>.html</code>, <code>.markdown</code>,
165
+ <code>.md</code>, or <code>.textile</code> file in your site’s root
166
+ directory or directories not listed above.
167
+
168
+ </p>
169
+ </td>
170
+ </tr>
171
+ <tr>
172
+ <td>
173
+ <p>Other Files/Folders</p>
174
+ </td>
175
+ <td>
176
+ <p>
177
+
178
+ Every other directory and file except for those listed above—such as
179
+ <code>css</code> and <code>images</code> folders,
180
+ <code>favicon.ico</code> files, and so forth—will be copied verbatim
181
+ to the generated site. There are plenty of <a href="../sites/">sites
182
+ already using Jekyll</a> if you’re curious to see how they’re laid
183
+ out.
184
+
185
+ </p>
186
+ </td>
187
+ </tr>
188
+ </tbody>
189
+ </table>
190
+ </div>