tigefa 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.markdown +91 -0
  3. data/Gemfile +2 -0
  4. data/History.markdown +871 -0
  5. data/LICENSE +15 -14
  6. data/README.markdown +59 -0
  7. data/Rakefile +298 -0
  8. data/bin/tigefa +158 -0
  9. data/cucumber.yml +3 -0
  10. data/features/create_sites.feature +141 -0
  11. data/features/data.feature +65 -0
  12. data/features/drafts.feature +25 -0
  13. data/features/embed_filters.feature +60 -0
  14. data/features/include_tag.feature +57 -0
  15. data/features/markdown.feature +67 -0
  16. data/features/pagination.feature +82 -0
  17. data/features/permalinks.feature +85 -0
  18. data/features/post_data.feature +214 -0
  19. data/features/post_excerpts.feature +50 -0
  20. data/features/site_configuration.feature +235 -0
  21. data/features/site_data.feature +107 -0
  22. data/features/step_definitions/tigefa_steps.rb +189 -0
  23. data/features/support/env.rb +75 -0
  24. data/lib/site_template/.gitignore +1 -0
  25. data/lib/site_template/_config.yml +3 -0
  26. data/lib/site_template/_layouts/default.html +44 -0
  27. data/lib/site_template/_layouts/post.html +9 -0
  28. data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +24 -0
  29. data/lib/site_template/css/main.css +160 -0
  30. data/lib/site_template/css/syntax.css +60 -0
  31. data/lib/site_template/index.html +13 -0
  32. data/lib/tigefa/cleaner.rb +73 -0
  33. data/lib/tigefa/command.rb +27 -0
  34. data/lib/tigefa/commands/build.rb +70 -0
  35. data/lib/tigefa/commands/doctor.rb +67 -0
  36. data/lib/tigefa/commands/new.rb +67 -0
  37. data/lib/tigefa/commands/serve.rb +65 -0
  38. data/lib/tigefa/configuration.rb +238 -0
  39. data/lib/tigefa/converter.rb +48 -0
  40. data/lib/tigefa/converters/identity.rb +21 -0
  41. data/lib/tigefa/converters/markdown/kramdown_parser.rb +29 -0
  42. data/lib/tigefa/converters/markdown/maruku_parser.rb +56 -0
  43. data/lib/tigefa/converters/markdown/rdiscount_parser.rb +37 -0
  44. data/lib/tigefa/converters/markdown/redcarpet_parser.rb +70 -0
  45. data/lib/tigefa/converters/markdown.rb +43 -0
  46. data/lib/tigefa/converters/textile.rb +50 -0
  47. data/lib/tigefa/convertible.rb +174 -0
  48. data/lib/tigefa/core_ext.rb +90 -0
  49. data/lib/tigefa/deprecator.rb +36 -0
  50. data/lib/tigefa/draft.rb +35 -0
  51. data/lib/tigefa/entry_filter.rb +35 -0
  52. data/lib/tigefa/errors.rb +4 -0
  53. data/lib/tigefa/excerpt.rb +113 -0
  54. data/lib/tigefa/filters.rb +174 -0
  55. data/lib/tigefa/generator.rb +4 -0
  56. data/lib/tigefa/generators/pagination.rb +217 -0
  57. data/lib/tigefa/layout.rb +45 -0
  58. data/lib/tigefa/mime.types +85 -0
  59. data/lib/tigefa/page.rb +160 -0
  60. data/lib/tigefa/plugin.rb +75 -0
  61. data/lib/tigefa/post.rb +312 -0
  62. data/lib/tigefa/related_posts.rb +59 -0
  63. data/lib/tigefa/site.rb +427 -0
  64. data/lib/tigefa/static_file.rb +70 -0
  65. data/lib/tigefa/stevenson.rb +89 -0
  66. data/lib/tigefa/tags/gist.rb +48 -0
  67. data/lib/tigefa/tags/highlight.rb +85 -0
  68. data/lib/tigefa/tags/include.rb +134 -0
  69. data/lib/tigefa/tags/post_url.rb +63 -0
  70. data/lib/tigefa/url.rb +69 -0
  71. data/lib/tigefa.rb +98 -4
  72. data/script/bootstrap +2 -0
  73. data/site/.gitignore +4 -0
  74. data/site/CNAME +1 -0
  75. data/site/README +1 -0
  76. data/site/_config.yml +6 -0
  77. data/site/_includes/analytics.html +32 -0
  78. data/site/_includes/docs_contents.html +16 -0
  79. data/site/_includes/docs_contents_mobile.html +23 -0
  80. data/site/_includes/docs_option.html +11 -0
  81. data/site/_includes/docs_ul.html +20 -0
  82. data/site/_includes/footer.html +15 -0
  83. data/site/_includes/header.html +18 -0
  84. data/site/_includes/news_contents.html +23 -0
  85. data/site/_includes/news_contents_mobile.html +11 -0
  86. data/site/_includes/news_item.html +24 -0
  87. data/site/_includes/primary-nav-items.html +14 -0
  88. data/site/_includes/section_nav.html +22 -0
  89. data/site/_includes/top.html +17 -0
  90. data/site/_layouts/default.html +12 -0
  91. data/site/_layouts/docs.html +23 -0
  92. data/site/_layouts/news.html +19 -0
  93. data/site/_layouts/news_item.html +27 -0
  94. data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +23 -0
  95. data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +27 -0
  96. data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +28 -0
  97. data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +25 -0
  98. data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +27 -0
  99. data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +31 -0
  100. data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +20 -0
  101. data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +20 -0
  102. data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +23 -0
  103. data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +19 -0
  104. data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +19 -0
  105. data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +43 -0
  106. data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +21 -0
  107. data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +30 -0
  108. data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +18 -0
  109. data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +27 -0
  110. data/site/css/gridism.css +110 -0
  111. data/site/css/normalize.css +1 -0
  112. data/site/css/pygments.css +70 -0
  113. data/site/css/style.css +946 -0
  114. data/site/docs/configuration.md +375 -0
  115. data/site/docs/contributing.md +128 -0
  116. data/site/docs/datafiles.md +63 -0
  117. data/site/docs/deployment-methods.md +109 -0
  118. data/site/docs/drafts.md +21 -0
  119. data/site/docs/extras.md +56 -0
  120. data/site/docs/frontmatter.md +180 -0
  121. data/site/docs/github-pages.md +91 -0
  122. data/site/docs/heroku.md +9 -0
  123. data/site/docs/history.md +866 -0
  124. data/site/docs/index.md +52 -0
  125. data/site/docs/installation.md +76 -0
  126. data/site/docs/migrations.md +11 -0
  127. data/site/docs/pages.md +86 -0
  128. data/site/docs/pagination.md +211 -0
  129. data/site/docs/permalinks.md +180 -0
  130. data/site/docs/plugins.md +534 -0
  131. data/site/docs/posts.md +181 -0
  132. data/site/docs/quickstart.md +32 -0
  133. data/site/docs/resources.md +46 -0
  134. data/site/docs/sites.md +29 -0
  135. data/site/docs/structure.md +190 -0
  136. data/site/docs/templates.md +339 -0
  137. data/site/docs/troubleshooting.md +150 -0
  138. data/site/docs/upgrading.md +146 -0
  139. data/site/docs/usage.md +63 -0
  140. data/site/docs/variables.md +322 -0
  141. data/site/favicon.png +0 -0
  142. data/site/feed.xml +36 -0
  143. data/site/freenode.txt +1 -0
  144. data/site/img/article-footer.png +0 -0
  145. data/site/img/footer-arrow.png +0 -0
  146. data/site/img/footer-logo.png +0 -0
  147. data/site/img/logo-2x.png +0 -0
  148. data/site/img/octojekyll.png +0 -0
  149. data/site/img/tube.png +0 -0
  150. data/site/img/tube1x.png +0 -0
  151. data/site/index.html +90 -0
  152. data/site/js/modernizr-2.5.3.min.js +4 -0
  153. data/site/news/index.html +10 -0
  154. data/site/news/releases/index.html +10 -0
  155. data/test/fixtures/broken_front_matter1.erb +5 -0
  156. data/test/fixtures/broken_front_matter2.erb +4 -0
  157. data/test/fixtures/broken_front_matter3.erb +7 -0
  158. data/test/fixtures/exploit_front_matter.erb +4 -0
  159. data/test/fixtures/front_matter.erb +4 -0
  160. data/test/helper.rb +65 -0
  161. data/test/source/+/foo.md +7 -0
  162. data/test/source/.htaccess +8 -0
  163. data/test/source/_config.dev.toml +2 -0
  164. data/test/source/_data/languages.yml +2 -0
  165. data/test/source/_data/members.yaml +7 -0
  166. data/test/source/_data/products.yml +1 -0
  167. data/test/source/_includes/params.html +7 -0
  168. data/test/source/_includes/sig.markdown +3 -0
  169. data/test/source/_includes/tmp +1 -0
  170. data/test/source/_layouts/default.html +27 -0
  171. data/test/source/_layouts/post/simple.html +1 -0
  172. data/test/source/_layouts/simple.html +1 -0
  173. data/test/source/_plugins/dummy.rb +8 -0
  174. data/test/source/_posts/2008-02-02-not-published.textile +8 -0
  175. data/test/source/_posts/2008-02-02-published.textile +8 -0
  176. data/test/source/_posts/2008-10-18-foo-bar.textile +8 -0
  177. data/test/source/_posts/2008-11-21-complex.textile +8 -0
  178. data/test/source/_posts/2008-12-03-permalinked-post.textile +9 -0
  179. data/test/source/_posts/2008-12-13-include.markdown +8 -0
  180. data/test/source/_posts/2009-01-27-array-categories.textile +10 -0
  181. data/test/source/_posts/2009-01-27-categories.textile +7 -0
  182. data/test/source/_posts/2009-01-27-category.textile +7 -0
  183. data/test/source/_posts/2009-01-27-empty-categories.textile +7 -0
  184. data/test/source/_posts/2009-01-27-empty-category.textile +7 -0
  185. data/test/source/_posts/2009-03-12-hash-#1.markdown +6 -0
  186. data/test/source/_posts/2009-05-18-empty-tag.textile +6 -0
  187. data/test/source/_posts/2009-05-18-empty-tags.textile +6 -0
  188. data/test/source/_posts/2009-05-18-tag.textile +6 -0
  189. data/test/source/_posts/2009-05-18-tags.textile +9 -0
  190. data/test/source/_posts/2009-06-22-empty-yaml.textile +3 -0
  191. data/test/source/_posts/2009-06-22-no-yaml.textile +1 -0
  192. data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
  193. data/test/source/_posts/2010-01-09-date-override.textile +7 -0
  194. data/test/source/_posts/2010-01-09-time-override.textile +7 -0
  195. data/test/source/_posts/2010-01-09-timezone-override.textile +7 -0
  196. data/test/source/_posts/2010-01-16-override-data.textile +4 -0
  197. data/test/source/_posts/2011-04-12-md-extension.md +7 -0
  198. data/test/source/_posts/2011-04-12-text-extension.text +0 -0
  199. data/test/source/_posts/2013-01-02-post-excerpt.markdown +14 -0
  200. data/test/source/_posts/2013-01-12-nil-layout.textile +6 -0
  201. data/test/source/_posts/2013-01-12-no-layout.textile +5 -0
  202. data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
  203. data/test/source/_posts/2013-04-11-custom-excerpt.markdown +10 -0
  204. data/test/source/_posts/2013-05-10-number-category.textile +7 -0
  205. data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +23 -0
  206. data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
  207. data/test/source/_posts/2014-01-06-permalink-traversal.md +5 -0
  208. data/test/source/_posts/es/2008-11-21-nested.textile +8 -0
  209. data/test/source/about.html +6 -0
  210. data/test/source/category/_posts/2008-9-23-categories.textile +6 -0
  211. data/test/source/contacts/bar.html +5 -0
  212. data/test/source/contacts/index.html +5 -0
  213. data/test/source/contacts.html +5 -0
  214. data/test/source/css/screen.css +76 -0
  215. data/test/source/deal.with.dots.html +7 -0
  216. data/test/source/exploit.md +5 -0
  217. data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +8 -0
  218. data/test/source/index.html +22 -0
  219. data/test/source/products.yml +4 -0
  220. data/test/source/sitemap.xml +32 -0
  221. data/test/source/symlink-test/_data +1 -0
  222. data/test/source/symlink-test/symlinked-dir +1 -0
  223. data/test/source/symlink-test/symlinked-file +1 -0
  224. data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +7 -0
  225. data/test/source/z_category/_posts/2008-9-23-categories.textile +6 -0
  226. data/test/suite.rb +11 -0
  227. data/test/test_command.rb +39 -0
  228. data/test/test_configuration.rb +181 -0
  229. data/test/test_convertible.rb +51 -0
  230. data/test/test_core_ext.rb +88 -0
  231. data/test/test_entry_filter.rb +74 -0
  232. data/test/test_excerpt.rb +78 -0
  233. data/test/test_filters.rb +113 -0
  234. data/test/test_generated_site.rb +83 -0
  235. data/test/test_kramdown.rb +62 -0
  236. data/test/test_new_command.rb +104 -0
  237. data/test/test_page.rb +212 -0
  238. data/test/test_pager.rb +116 -0
  239. data/test/test_post.rb +592 -0
  240. data/test/test_rdiscount.rb +22 -0
  241. data/test/test_redcarpet.rb +61 -0
  242. data/test/test_redcloth.rb +86 -0
  243. data/test/test_related_posts.rb +47 -0
  244. data/test/test_site.rb +333 -0
  245. data/test/test_tags.rb +490 -0
  246. data/test/test_url.rb +28 -0
  247. data/tigefa.gemspec +306 -0
  248. metadata +575 -45
  249. data/README.md +0 -4
@@ -0,0 +1,534 @@
1
+ ---
2
+ layout: docs
3
+ title: Plugins
4
+ prev_section: pagination
5
+ next_section: extras
6
+ permalink: /docs/plugins/
7
+ ---
8
+
9
+ Jekyll has a plugin system with hooks that allow you to create custom generated
10
+ content specific to your site. You can run custom code for your site without
11
+ having to modify the Jekyll source itself.
12
+
13
+ <div class="note info">
14
+ <h5>Plugins on GitHub Pages</h5>
15
+ <p>
16
+ <a href="http://pages.github.com/">GitHub Pages</a> is powered by Jekyll,
17
+ however all Pages sites are generated using the <code>--safe</code> option
18
+ to disable custom plugins for security reasons. Unfortunately, this means
19
+ your plugins won’t work if you’re deploying to GitHub Pages.<br><br>
20
+ You can still use GitHub Pages to publish your site, but you’ll need to
21
+ convert the site locally and push the generated static files to your GitHub
22
+ repository instead of the Jekyll source files.
23
+ </p>
24
+ </div>
25
+
26
+ ## Installing a plugin
27
+
28
+ You have 2 options for installing plugins:
29
+
30
+ 1. In your site source root, make a `_plugins` directory. Place your plugins here.
31
+ Any file ending in `*.rb` inside this directory will be loaded before Jekyll
32
+ generates your site.
33
+ 2. In your `_config.yml` file, add a new array with the key `gems` and the values
34
+ of the gem names of the plugins you'd like to use. An example:
35
+
36
+ gems: [jekyll-test-plugin, jekyll-jsonify, jekyll-assets]
37
+ # This will require each of these gems automatically.
38
+
39
+ <div class="note info">
40
+ <h5>
41
+ <code>_plugins</code> and <code>gems</code>
42
+ can be used simultaneously
43
+ </h5>
44
+ <p>
45
+ You may use both of the aforementioned plugin options simultaneously in the
46
+ same site if you so choose. Use of one does not restrict the use of the other
47
+ </p>
48
+ </div>
49
+
50
+ In general, plugins you make will fall into one of three categories:
51
+
52
+ 1. Generators
53
+ 2. Converters
54
+ 3. Tags
55
+
56
+ ## Generators
57
+
58
+ You can create a generator when you need Jekyll to create additional content
59
+ based on your own rules.
60
+
61
+ A generator is a subclass of `Jekyll::Generator` that defines a `generate`
62
+ method, which receives an instance of
63
+ [`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb).
64
+
65
+ Generation is triggered for its side-effects, the return value of `generate` is
66
+ ignored. Jekyll does not assume any particular side-effect to happen, it just
67
+ runs the method.
68
+
69
+ Generators run after Jekyll has made an inventory of the existing content, and
70
+ before the site is generated. Pages with YAML front-matters are stored as
71
+ instances of
72
+ [`Jekyll::Page`]({{ site.repository }}/blob/master/lib/jekyll/page.rb)
73
+ and are available via `site.pages`. Static files become instances of
74
+ [`Jekyll::StaticFile`]({{ site.repository }}/blob/master/lib/jekyll/static_file.rb)
75
+ and are available via `site.static_files`. See
76
+ [`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb)
77
+ for more details.
78
+
79
+ For instance, a generator can inject values computed at build time for template
80
+ variables. In the following example the template `reading.html` has two
81
+ variables `ongoing` and `done` that we fill in the generator:
82
+
83
+ {% highlight ruby %}
84
+ module Reading
85
+ class Generator < Jekyll::Generator
86
+ def generate(site)
87
+ ongoing, done = Book.all.partition(&:ongoing?)
88
+
89
+ reading = site.pages.detect {|page| page.name == 'reading.html'}
90
+ reading.data['ongoing'] = ongoing
91
+ reading.data['done'] = done
92
+ end
93
+ end
94
+ end
95
+ {% endhighlight %}
96
+
97
+ This is a more complex generator that generates new pages:
98
+
99
+ {% highlight ruby %}
100
+ module Jekyll
101
+
102
+ class CategoryPage < Page
103
+ def initialize(site, base, dir, category)
104
+ @site = site
105
+ @base = base
106
+ @dir = dir
107
+ @name = 'index.html'
108
+
109
+ self.process(@name)
110
+ self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
111
+ self.data['category'] = category
112
+
113
+ category_title_prefix = site.config['category_title_prefix'] || 'Category: '
114
+ self.data['title'] = "#{category_title_prefix}#{category}"
115
+ end
116
+ end
117
+
118
+ class CategoryPageGenerator < Generator
119
+ safe true
120
+
121
+ def generate(site)
122
+ if site.layouts.key? 'category_index'
123
+ dir = site.config['category_dir'] || 'categories'
124
+ site.categories.keys.each do |category|
125
+ site.pages << CategoryPage.new(site, site.source, File.join(dir, category), category)
126
+ end
127
+ end
128
+ end
129
+ end
130
+
131
+ end
132
+ {% endhighlight %}
133
+
134
+ In this example, our generator will create a series of files under the
135
+ `categories` directory for each category, listing the posts in each category
136
+ using the `category_index.html` layout.
137
+
138
+ Generators are only required to implement one method:
139
+
140
+ <div class="mobile-side-scroller">
141
+ <table>
142
+ <thead>
143
+ <tr>
144
+ <th>Method</th>
145
+ <th>Description</th>
146
+ </tr>
147
+ </thead>
148
+ <tbody>
149
+ <tr>
150
+ <td>
151
+ <p><code>generate</code></p>
152
+ </td>
153
+ <td>
154
+ <p>Generates content as a side-effect.</p>
155
+ </td>
156
+ </tr>
157
+ </tbody>
158
+ </table>
159
+ </div>
160
+
161
+ ## Converters
162
+
163
+ If you have a new markup language you’d like to use with your site, you can
164
+ include it by implementing your own converter. Both the Markdown and Textile
165
+ markup languages are implemented using this method.
166
+
167
+ <div class="note info">
168
+ <h5>Remember your YAML front-matter</h5>
169
+ <p>
170
+ Jekyll will only convert files that have a YAML header at the top, even for
171
+ converters you add using a plugin.
172
+ </p>
173
+ </div>
174
+
175
+ Below is a converter that will take all posts ending in `.upcase` and process
176
+ them using the `UpcaseConverter`:
177
+
178
+ {% highlight ruby %}
179
+ module Jekyll
180
+ class UpcaseConverter < Converter
181
+ safe true
182
+ priority :low
183
+
184
+ def matches(ext)
185
+ ext =~ /^\.upcase$/i
186
+ end
187
+
188
+ def output_ext(ext)
189
+ ".html"
190
+ end
191
+
192
+ def convert(content)
193
+ content.upcase
194
+ end
195
+ end
196
+ end
197
+ {% endhighlight %}
198
+
199
+ Converters should implement at a minimum 3 methods:
200
+
201
+ <div class="mobile-side-scroller">
202
+ <table>
203
+ <thead>
204
+ <tr>
205
+ <th>Method</th>
206
+ <th>Description</th>
207
+ </tr>
208
+ </thead>
209
+ <tbody>
210
+ <tr>
211
+ <td>
212
+ <p><code>matches</code></p>
213
+ </td>
214
+ <td><p>
215
+ Does the given extension match this converter’s list of acceptable
216
+ extensions? Takes one argument: the file’s extension (including the
217
+ dot). Must return <code>true</code> if it matches, <code>false</code>
218
+ otherwise.
219
+ </p></td>
220
+ </tr>
221
+ <tr>
222
+ <td>
223
+ <p><code>output_ext</code></p>
224
+ </td>
225
+ <td><p>
226
+ The extension to be given to the output file (including the dot).
227
+ Usually this will be <code>".html"</code>.
228
+ </p></td>
229
+ </tr>
230
+ <tr>
231
+ <td>
232
+ <p><code>convert</code></p>
233
+ </td>
234
+ <td><p>
235
+ Logic to do the content conversion. Takes one argument: the raw content
236
+ of the file (without YAML front matter). Must return a String.
237
+ </p></td>
238
+ </tr>
239
+ </tbody>
240
+ </table>
241
+ </div>
242
+
243
+ In our example, `UpcaseConverter#matches` checks if our filename extension is
244
+ `.upcase`, and will render using the converter if it is. It will call
245
+ `UpcaseConverter#convert` to process the content. In our simple converter we’re
246
+ simply uppercasing the entire content string. Finally, when it saves the page,
247
+ it will do so with a `.html` extension.
248
+
249
+ ## Tags
250
+
251
+ If you’d like to include custom liquid tags in your site, you can do so by
252
+ hooking into the tagging system. Built-in examples added by Jekyll include the
253
+ `highlight` and `include` tags. Below is an example of a custom liquid tag that
254
+ will output the time the page was rendered:
255
+
256
+ {% highlight ruby %}
257
+ module Jekyll
258
+ class RenderTimeTag < Liquid::Tag
259
+
260
+ def initialize(tag_name, text, tokens)
261
+ super
262
+ @text = text
263
+ end
264
+
265
+ def render(context)
266
+ "#{@text} #{Time.now}"
267
+ end
268
+ end
269
+ end
270
+
271
+ Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
272
+ {% endhighlight %}
273
+
274
+ At a minimum, liquid tags must implement:
275
+
276
+ <div class="mobile-side-scroller">
277
+ <table>
278
+ <thead>
279
+ <tr>
280
+ <th>Method</th>
281
+ <th>Description</th>
282
+ </tr>
283
+ </thead>
284
+ <tbody>
285
+ <tr>
286
+ <td>
287
+ <p><code>render</code></p>
288
+ </td>
289
+ <td>
290
+ <p>Outputs the content of the tag.</p>
291
+ </td>
292
+ </tr>
293
+ </tbody>
294
+ </table>
295
+ </div>
296
+
297
+ You must also register the custom tag with the Liquid template engine as
298
+ follows:
299
+
300
+ {% highlight ruby %}
301
+ Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
302
+ {% endhighlight %}
303
+
304
+ In the example above, we can place the following tag anywhere in one of our
305
+ pages:
306
+
307
+ {% highlight ruby %}
308
+ {% raw %}
309
+ <p>{% render_time page rendered at: %}</p>
310
+ {% endraw %}
311
+ {% endhighlight %}
312
+
313
+ And we would get something like this on the page:
314
+
315
+ {% highlight html %}
316
+ <p>page rendered at: Tue June 22 23:38:47 –0500 2010</p>
317
+ {% endhighlight %}
318
+
319
+ ### Liquid filters
320
+
321
+ You can add your own filters to the Liquid template system much like you can add
322
+ tags above. Filters are simply modules that export their methods to liquid. All
323
+ methods will have to take at least one parameter which represents the input of
324
+ the filter. The return value will be the output of the filter.
325
+
326
+ {% highlight ruby %}
327
+ module Jekyll
328
+ module AssetFilter
329
+ def asset_url(input)
330
+ "http://www.example.com/#{input}?#{Time.now.to_i}"
331
+ end
332
+ end
333
+ end
334
+
335
+ Liquid::Template.register_filter(Jekyll::AssetFilter)
336
+ {% endhighlight %}
337
+
338
+ <div class="note">
339
+ <h5>ProTip™: Access the site object using Liquid</h5>
340
+ <p>
341
+ Jekyll lets you access the <code>site</code> object through the
342
+ <code>context.registers</code> feature of Liquid. For example, you can
343
+ access the global configuration file <code>_config.yml</code> using
344
+ <code>context.registers.config</code>.
345
+ </p>
346
+ </div>
347
+
348
+ ### Flags
349
+
350
+ There are two flags to be aware of when writing a plugin:
351
+
352
+ <div class="mobile-side-scroller">
353
+ <table>
354
+ <thead>
355
+ <tr>
356
+ <th>Flag</th>
357
+ <th>Description</th>
358
+ </tr>
359
+ </thead>
360
+ <tbody>
361
+ <tr>
362
+ <td>
363
+ <p><code>safe</code></p>
364
+ </td>
365
+ <td>
366
+ <p>
367
+ A boolean flag that informs Jekyll whether this plugin may be safely
368
+ executed in an environment where arbitrary code execution is not
369
+ allowed. This is used by GitHub Pages to determine which core plugins
370
+ may be used, and which are unsafe to run. If your plugin does not
371
+ allow for arbitrary code, execution, set this to <code>true</code>.
372
+ GitHub Pages still won’t load your plugin, but if you submit it for
373
+ inclusion in core, it’s best for this to be correct!
374
+ </p>
375
+ </td>
376
+ </tr>
377
+ <tr>
378
+ <td>
379
+ <p><code>priority</code></p>
380
+ </td>
381
+ <td>
382
+ <p>
383
+ This flag determines what order the plugin is loaded in. Valid values
384
+ are: <code>:lowest</code>, <code>:low</code>, <code>:normal</code>,
385
+ <code>:high</code>, and <code>:highest</code>. Highest priority
386
+ matches are applied first, lowest priority are applied last.
387
+ </p>
388
+ </td>
389
+ </tr>
390
+ </tbody>
391
+ </table>
392
+ </div>
393
+
394
+ To use one of the example plugins above as an illustration, here is how you’d
395
+ specify these two flags:
396
+
397
+ {% highlight ruby %}
398
+ module Jekyll
399
+ class UpcaseConverter < Converter
400
+ safe true
401
+ priority :low
402
+ ...
403
+ end
404
+ end
405
+ {% endhighlight %}
406
+
407
+ ## Available Plugins
408
+
409
+ You can find a few useful plugins at the following locations:
410
+
411
+ #### Generators
412
+
413
+ - [ArchiveGenerator by Ilkka Laukkanen](https://gist.github.com/707909): Uses [this archive page](https://gist.github.com/707020) to generate archives.
414
+ - [LESS.js Generator by Andy Fowler](https://gist.github.com/642739): Renders LESS.js files during generation.
415
+ - [Version Reporter by Blake Smith](https://gist.github.com/449491): Creates a version.html file containing the Jekyll version.
416
+ - [Sitemap.xml Generator by Michael Levin](https://github.com/kinnetica/jekyll-plugins): Generates a sitemap.xml file by traversing all of the available posts and pages.
417
+ - [Full-text search by Pascal Widdershoven](https://github.com/PascalW/jekyll_indextank): Adds full-text search to your Jekyll site with a plugin and a bit of JavaScript.
418
+ - [AliasGenerator by Thomas Mango](https://github.com/tsmango/jekyll_alias_generator): Generates redirect pages for posts when an alias is specified in the YAML Front Matter.
419
+ - [Pageless Redirect Generator by Nick Quinlan](https://github.com/nquinlan/jekyll-pageless-redirects): Generates redirects based on files in the Jekyll root, with support for htaccess style redirects.
420
+ - [Projectlist by Frederic Hemberger](https://github.com/fhemberger/jekyll-projectlist): Renders files in a directory as a single page instead of separate posts.
421
+ - [RssGenerator by Assaf Gelber](https://github.com/agelber/jekyll-rss): Automatically creates an RSS 2.0 feed from your posts.
422
+ - [Monthly archive generator by Shigeya Suzuki](https://github.com/shigeya/jekyll-monthly-archive-plugin): Generator and template which renders monthly archive like MovableType style, based on the work by Ilkka Laukkanen and others above.
423
+ - [Category archive generator by Shigeya Suzuki](https://github.com/shigeya/jekyll-category-archive-plugin): Generator and template which renders category archive like MovableType style, based on Monthly archive generator.
424
+ - [Emoji for Jekyll](https://github.com/yihangho/emoji-for-jekyll): Seamlessly enable emoji for all posts and pages.
425
+
426
+ #### Converters
427
+
428
+ - [Jade plugin by John Papandriopoulos](https://github.com/snappylabs/jade-jekyll-plugin): Jade converter for Jekyll.
429
+ - [HAML plugin by Sam Z](https://gist.github.com/517556): HAML converter for Jekyll.
430
+ - [HAML-Sass Converter by Adam Pearson](https://gist.github.com/481456): Simple HAML-Sass converter for Jekyll. [Fork](https://gist.github.com/528642) by Sam X.
431
+ - [Sass SCSS Converter by Mark Wolfe](https://gist.github.com/960150): Sass converter which uses the new CSS compatible syntax, based Sam X’s fork above.
432
+ - [LESS Converter by Jason Graham](https://gist.github.com/639920): Convert LESS files to CSS.
433
+ - [LESS Converter by Josh Brown](https://gist.github.com/760265): Simple LESS converter.
434
+ - [Upcase Converter by Blake Smith](https://gist.github.com/449463): An example Jekyll converter.
435
+ - [CoffeeScript Converter by phaer](https://gist.github.com/959938): A [CoffeeScript](http://coffeescript.org) to Javascript converter.
436
+ - [Markdown References by Olov Lassus](https://github.com/olov/jekyll-references): Keep all your markdown reference-style link definitions in one \_references.md file.
437
+ - [Stylus Converter](https://gist.github.com/988201): Convert .styl to .css.
438
+ - [ReStructuredText Converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting.
439
+ - [Jekyll-pandoc-plugin](https://github.com/dsanson/jekyll-pandoc-plugin): Use pandoc for rendering markdown.
440
+ - [Jekyll-pandoc-multiple-formats](https://github.com/fauno/jekyll-pandoc-multiple-formats) by [edsl](https://github.com/edsl): Use pandoc to generate your site in multiple formats. Supports pandoc’s markdown extensions.
441
+ - [ReStructuredText Converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting.
442
+ - [Transform Layouts](https://gist.github.com/1472645): Allows HAML layouts (you need a HAML Converter plugin for this to work).
443
+ - [Org-mode Converter](https://gist.github.com/abhiyerra/7377603): Org-mode converter for Jekyll.
444
+
445
+ #### Filters
446
+
447
+ - [Truncate HTML](https://github.com/MattHall/truncatehtml) by [Matt Hall](http://codebeef.com): A Jekyll filter that truncates HTML while preserving markup structure.
448
+ - [Domain Name Filter by Lawrence Woodman](https://github.com/LawrenceWoodman/domain_name-liquid_filter): Filters the input text so that just the domain name is left.
449
+ - [Summarize Filter by Mathieu Arnold](https://gist.github.com/731597): Remove markup after a `<div id="extended">` tag.
450
+ - [URL encoding by James An](https://gist.github.com/919275): Percent encoding for URIs.
451
+ - [JSON Filter](https://gist.github.com/1850654) by [joelverhagen](https://github.com/joelverhagen): Filter that takes input text and outputs it as JSON. Great for rendering JavaScript.
452
+ - [i18n_filter](https://github.com/gacha/gacha.id.lv/blob/master/_plugins/i18n_filter.rb): Liquid filter to use I18n localization.
453
+ - [Smilify](https://github.com/SaswatPadhi/jekyll_smilify) by [SaswatPadhi](https://github.com/SaswatPadhi): Convert text emoticons in your content to themeable smiley pics ([Demo](http://saswatpadhi.github.com/)).
454
+ - [Read in X Minutes](https://gist.github.com/zachleat/5792681) by [zachleat](https://github.com/zachleat): Estimates the reading time of a string (for blog post content).
455
+ - [Jekyll-timeago](https://github.com/markets/jekyll-timeago): Converts a time value to the time ago in words.
456
+ - [pluralize](https://github.com/bdesham/pluralize): Easily combine a number and a word into a gramatically-correct amount like “1 minute” or “2 minute**s**”.
457
+ - [reading_time](https://github.com/bdesham/reading_time): Count words and estimate reading time for a piece of text, ignoring HTML elements that are unlikely to contain running text.
458
+ - [Table of Content Generator](https://github.com/dafi/jekyll-toc-generator): Generate the HTML code containing a table of content (TOC), the TOC can be customized in many way, for example you can decide which pages can be without TOC.
459
+
460
+ #### Tags
461
+
462
+ - [Asset Path Tag](https://github.com/samrayner/jekyll-asset-path-plugin) by [Sam Rayner](http://www.samrayner.com/): Allows organisation of assets into subdirectories by outputting a path for a given file relative to the current post or page.
463
+ - [Delicious Plugin by Christian Hellsten](https://github.com/christianhellsten/jekyll-plugins): Fetches and renders bookmarks from delicious.com.
464
+ - [Ultraviolet Plugin by Steve Alex](https://gist.github.com/480380): Jekyll tag for the [Ultraviolet](http://ultraviolet.rubyforge.org/) code highligher.
465
+ - [Tag Cloud Plugin by Ilkka Laukkanen](https://gist.github.com/710577): Generate a tag cloud that links to tag pages.
466
+ - [GIT Tag by Alexandre Girard](https://gist.github.com/730347): Add Git activity inside a list.
467
+ - [MathJax Liquid Tags by Jessy Cowan-Sharp](https://gist.github.com/834610): Simple liquid tags for Jekyll that convert inline math and block equations to the appropriate MathJax script tags.
468
+ - [Non-JS Gist Tag by Brandon Tilley](https://gist.github.com/1027674) A Liquid tag that embeds Gists and shows code for non-JavaScript enabled browsers and readers.
469
+ - [Render Time Tag by Blake Smith](https://gist.github.com/449509): Displays the time a Jekyll page was generated.
470
+ - [Status.net/OStatus Tag by phaer](https://gist.github.com/912466): Displays the notices in a given status.net/ostatus feed.
471
+ - [Raw Tag by phaer](https://gist.github.com/1020852): Keeps liquid from parsing text betweeen `raw` tags.
472
+ - [Embed.ly client by Robert Böhnke](https://github.com/robb/jekyll-embedly-client): Autogenerate embeds from URLs using oEmbed.
473
+ - [Logarithmic Tag Cloud](https://gist.github.com/2290195): Flexible. Logarithmic distribution. Documentation inline.
474
+ - [oEmbed Tag by Tammo van Lessen](https://gist.github.com/1455726): Enables easy content embedding (e.g. from YouTube, Flickr, Slideshare) via oEmbed.
475
+ - [FlickrSetTag by Thomas Mango](https://github.com/tsmango/jekyll_flickr_set_tag): Generates image galleries from Flickr sets.
476
+ - [Tweet Tag by Scott W. Bradley](https://github.com/scottwb/jekyll-tweet-tag): Liquid tag for [Embedded Tweets](https://dev.twitter.com/docs/embedded-tweets) using Twitter’s shortcodes.
477
+ - [Jekyll-contentblocks](https://github.com/rustygeldmacher/jekyll-contentblocks): Lets you use Rails-like content_for tags in your templates, for passing content from your posts up to your layouts.
478
+ - [Generate YouTube Embed](https://gist.github.com/1805814) by [joelverhagen](https://github.com/joelverhagen): Jekyll plugin which allows you to embed a YouTube video in your page with the YouTube ID. Optionally specify width and height dimensions. Like “oEmbed Tag” but just for YouTube.
479
+ - [Jekyll-beastiepress](https://github.com/okeeblow/jekyll-beastiepress): FreeBSD utility tags for Jekyll sites.
480
+ - [Jsonball](https://gist.github.com/1895282): Reads json files and produces maps for use in Jekyll files.
481
+ - [Bibjekyll](https://github.com/pablooliveira/bibjekyll): Render BibTeX-formatted bibliographies/citations included in posts and pages using bibtex2html.
482
+ - [Jekyll-citation](https://github.com/archome/jekyll-citation): Render BibTeX-formatted bibliographies/citations included in posts and pages (pure Ruby).
483
+ - [Jekyll Dribbble Set Tag](https://github.com/ericdfields/Jekyll-Dribbble-Set-Tag): Builds Dribbble image galleries from any user.
484
+ - [Debbugs](https://gist.github.com/2218470): Allows posting links to Debian BTS easily.
485
+ - [Refheap_tag](https://github.com/aburdette/refheap_tag): Liquid tag that allows embedding pastes from [refheap](https://refheap.com).
486
+ - [Jekyll-devonly_tag](https://gist.github.com/2403522): A block tag for including markup only during development.
487
+ - [JekyllGalleryTag](https://github.com/redwallhp/JekyllGalleryTag) by [redwallhp](https://github.com/redwallhp): Generates thumbnails from a directory of images and displays them in a grid.
488
+ - [Youku and Tudou Embed](https://gist.github.com/Yexiaoxing/5891929): Liquid plugin for embedding Youku and Tudou videos.
489
+ - [Jekyll-swfobject](https://github.com/sectore/jekyll-swfobject): Liquid plugin for embedding Adobe Flash files (.swf) using [SWFObject](http://code.google.com/p/swfobject/).
490
+ - [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag): Easy responsive images for Jekyll. Based on the proposed [`<picture>`](http://picture.responsiveimages.org/) element, polyfilled with Scott Jehl’s [Picturefill](https://github.com/scottjehl/picturefill).
491
+ - [Jekyll Image Tag](https://github.com/robwierzbowski/jekyll-image-tag): Better images for Jekyll. Save image presets, generate resized images, and add classes, alt text, and other attributes.
492
+ - [Ditaa Tag](https://github.com/matze/jekyll-ditaa) by [matze](https://github.com/matze): Renders ASCII diagram art into PNG images and inserts a figure tag.
493
+ - [Good Include](https://github.com/penibelst/jekyll-good-include) by [Anatol Broder](http://penibelst.de/): Strips newlines and whitespaces from the end of include files before processing.
494
+ - [Jekyll Suggested Tweet](https://github.com/davidensinger/jekyll-suggested-tweet) by [David Ensinger](https://github.com/davidensinger/): A Liquid tag for Jekyll that allows for the embedding of suggested tweets via Twitter’s Web Intents API.
495
+ - [Jekyll Date Chart](https://github.com/GSI/jekyll_date_chart) by [GSI](https://github.com/GSI): Block that renders date line charts based on textile-formatted tables.
496
+ - [Jekyll Image Encode](https://github.com/GSI/jekyll_image_encode) by [GSI](https://github.com/GSI): Tag that renders base64 codes of images fetched from the web.
497
+ - [Jekyll Quick Man](https://github.com/GSI/jekyll_quick_man) by [GSI](https://github.com/GSI): Tag that renders pretty links to man page sources on the internet.
498
+
499
+ #### Collections
500
+
501
+ - [Jekyll Plugins by Recursive Design](http://recursive-design.com/projects/jekyll-plugins/): Plugins to generate Project pages from GitHub readmes, a Category page, and a Sitemap generator.
502
+ - [Company website and blog plugins](https://github.com/flatterline/jekyll-plugins) by Flatterline, a [Ruby on Rails development company](http://flatterline.com/): Portfolio/project page generator, team/individual page generator, an author bio liquid tag for use on posts, and a few other smaller plugins.
503
+ - [Jekyll plugins by Aucor](https://github.com/aucor/jekyll-plugins): Plugins for trimming unwanted newlines/whitespace and sorting pages by weight attribute.
504
+
505
+ #### Other
506
+
507
+ - [Pygments Cache Path by Raimonds Simanovskis](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb): Plugin to cache syntax-highlighted code from Pygments.
508
+ - [Draft/Publish Plugin by Michael Ivey](https://gist.github.com/49630): Save posts as drafts.
509
+ - [Growl Notification Generator by Tate Johnson](https://gist.github.com/490101): Send Jekyll notifications to Growl.
510
+ - [Growl Notification Hook by Tate Johnson](https://gist.github.com/525267): Better alternative to the above, but requires his “hook” fork.
511
+ - [Related Posts by Lawrence Woodman](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin): Overrides `site.related_posts` to use categories to assess relationship.
512
+ - [Tiered Archives by Eli Naeher](https://gist.github.com/88cda643aa7e3b0ca1e5): Create tiered template variable that allows you to group archives by year and month.
513
+ - [Jekyll-localization](https://github.com/blackwinter/jekyll-localization): Jekyll plugin that adds localization features to the rendering engine.
514
+ - [Jekyll-rendering](https://github.com/blackwinter/jekyll-rendering): Jekyll plugin to provide alternative rendering engines.
515
+ - [Jekyll-pagination](https://github.com/blackwinter/jekyll-pagination): Jekyll plugin to extend the pagination generator.
516
+ - [Jekyll-tagging](https://github.com/pattex/jekyll-tagging): Jekyll plugin to automatically generate a tag cloud and tag pages.
517
+ - [Jekyll-scholar](https://github.com/inukshuk/jekyll-scholar): Jekyll extensions for the blogging scholar.
518
+ - [Jekyll-asset_bundler](https://github.com/moshen/jekyll-asset_bundler): Bundles and minifies JavaScript and CSS.
519
+ - [Jekyll-assets](http://ixti.net/jekyll-assets/) by [ixti](https://github.com/ixti): Rails-alike assets pipeline (write assets in CoffeeScript, Sass, LESS etc; specify dependencies for automatic bundling using simple declarative comments in assets; minify and compress; use JST templates; cache bust; and many-many more).
520
+ - [File compressor](https://gist.github.com/2758691) by [mytharcher](https://github.com/mytharcher): Compress HTML and JavaScript files on site build.
521
+ - [Jekyll-minibundle](https://github.com/tkareine/jekyll-minibundle): Asset bundling and cache busting using external minification tool of your choice. No gem dependencies.
522
+ - [Singlepage-jekyll](https://github.com/JCB-K/singlepage-jekyll) by [JCB-K](https://github.com/JCB-K): Turns Jekyll into a dynamic one-page website.
523
+ - [generator-jekyllrb](https://github.com/robwierzbowski/generator-jekyllrb): A generator that wraps Jekyll in [Yeoman](http://yeoman.io/), a tool collection and workflow for builing modern web apps.
524
+ - [grunt-jekyll](https://github.com/dannygarcia/grunt-jekyll): A straightforward [Grunt](http://gruntjs.com/) plugin for Jekyll.
525
+ - [jekyll-postfiles](https://github.com/indirect/jekyll-postfiles): Add `_postfiles` directory and {% raw %}`{{ postfile }}`{% endraw %} tag so the files a post refers to will always be right there inside your repo.
526
+
527
+ <div class="note info">
528
+ <h5>Jekyll Plugins Wanted</h5>
529
+ <p>
530
+ If you have a Jekyll plugin that you would like to see added to this list,
531
+ you should <a href="../contributing/">read the contributing page</a> to find
532
+ out how to make that happen.
533
+ </p>
534
+ </div>