jekyll-docs 3.6.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (253) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll.rb +195 -0
  3. data/lib/jekyll/cleaner.rb +110 -0
  4. data/lib/jekyll/collection.rb +230 -0
  5. data/lib/jekyll/command.rb +78 -0
  6. data/lib/jekyll/commands/build.rb +102 -0
  7. data/lib/jekyll/commands/clean.rb +43 -0
  8. data/lib/jekyll/commands/doctor.rb +153 -0
  9. data/lib/jekyll/commands/help.rb +34 -0
  10. data/lib/jekyll/commands/new.rb +156 -0
  11. data/lib/jekyll/commands/new_theme.rb +40 -0
  12. data/lib/jekyll/commands/serve.rb +245 -0
  13. data/lib/jekyll/commands/serve/servlet.rb +62 -0
  14. data/lib/jekyll/configuration.rb +410 -0
  15. data/lib/jekyll/converter.rb +54 -0
  16. data/lib/jekyll/converters/identity.rb +23 -0
  17. data/lib/jekyll/converters/markdown.rb +104 -0
  18. data/lib/jekyll/converters/markdown/kramdown_parser.rb +123 -0
  19. data/lib/jekyll/converters/markdown/rdiscount_parser.rb +35 -0
  20. data/lib/jekyll/converters/markdown/redcarpet_parser.rb +108 -0
  21. data/lib/jekyll/converters/smartypants.rb +36 -0
  22. data/lib/jekyll/convertible.rb +251 -0
  23. data/lib/jekyll/deprecator.rb +52 -0
  24. data/lib/jekyll/document.rb +507 -0
  25. data/lib/jekyll/drops/collection_drop.rb +22 -0
  26. data/lib/jekyll/drops/document_drop.rb +69 -0
  27. data/lib/jekyll/drops/drop.rb +214 -0
  28. data/lib/jekyll/drops/excerpt_drop.rb +15 -0
  29. data/lib/jekyll/drops/jekyll_drop.rb +33 -0
  30. data/lib/jekyll/drops/site_drop.rb +47 -0
  31. data/lib/jekyll/drops/static_file_drop.rb +13 -0
  32. data/lib/jekyll/drops/unified_payload_drop.rb +25 -0
  33. data/lib/jekyll/drops/url_drop.rb +88 -0
  34. data/lib/jekyll/entry_filter.rb +123 -0
  35. data/lib/jekyll/errors.rb +20 -0
  36. data/lib/jekyll/excerpt.rb +126 -0
  37. data/lib/jekyll/external.rb +74 -0
  38. data/lib/jekyll/filters.rb +430 -0
  39. data/lib/jekyll/filters/grouping_filters.rb +65 -0
  40. data/lib/jekyll/filters/url_filters.rb +60 -0
  41. data/lib/jekyll/frontmatter_defaults.rb +197 -0
  42. data/lib/jekyll/generator.rb +5 -0
  43. data/lib/jekyll/hooks.rb +104 -0
  44. data/lib/jekyll/layout.rb +62 -0
  45. data/lib/jekyll/liquid_extensions.rb +24 -0
  46. data/lib/jekyll/liquid_renderer.rb +49 -0
  47. data/lib/jekyll/liquid_renderer/file.rb +56 -0
  48. data/lib/jekyll/liquid_renderer/table.rb +96 -0
  49. data/lib/jekyll/log_adapter.rb +147 -0
  50. data/lib/jekyll/mime.types +825 -0
  51. data/lib/jekyll/page.rb +187 -0
  52. data/lib/jekyll/plugin.rb +98 -0
  53. data/lib/jekyll/plugin_manager.rb +113 -0
  54. data/lib/jekyll/publisher.rb +23 -0
  55. data/lib/jekyll/reader.rb +134 -0
  56. data/lib/jekyll/readers/collection_reader.rb +22 -0
  57. data/lib/jekyll/readers/data_reader.rb +77 -0
  58. data/lib/jekyll/readers/layout_reader.rb +71 -0
  59. data/lib/jekyll/readers/page_reader.rb +25 -0
  60. data/lib/jekyll/readers/post_reader.rb +72 -0
  61. data/lib/jekyll/readers/static_file_reader.rb +25 -0
  62. data/lib/jekyll/readers/theme_assets_reader.rb +49 -0
  63. data/lib/jekyll/regenerator.rb +201 -0
  64. data/lib/jekyll/related_posts.rb +52 -0
  65. data/lib/jekyll/renderer.rb +269 -0
  66. data/lib/jekyll/site.rb +471 -0
  67. data/lib/jekyll/static_file.rb +162 -0
  68. data/lib/jekyll/stevenson.rb +61 -0
  69. data/lib/jekyll/tags/highlight.rb +141 -0
  70. data/lib/jekyll/tags/include.rb +215 -0
  71. data/lib/jekyll/tags/link.rb +37 -0
  72. data/lib/jekyll/tags/post_url.rb +103 -0
  73. data/lib/jekyll/theme.rb +68 -0
  74. data/lib/jekyll/theme_builder.rb +119 -0
  75. data/lib/jekyll/url.rb +161 -0
  76. data/lib/jekyll/utils.rb +337 -0
  77. data/lib/jekyll/utils/ansi.rb +59 -0
  78. data/lib/jekyll/utils/exec.rb +27 -0
  79. data/lib/jekyll/utils/platforms.rb +82 -0
  80. data/lib/jekyll/utils/rouge.rb +21 -0
  81. data/lib/jekyll/utils/win_tz.rb +75 -0
  82. data/lib/jekyll/version.rb +5 -0
  83. data/lib/site_template/404.html +24 -0
  84. data/lib/site_template/_config.yml +43 -0
  85. data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +25 -0
  86. data/lib/site_template/about.md +18 -0
  87. data/lib/site_template/index.md +6 -0
  88. data/lib/theme_template/CODE_OF_CONDUCT.md.erb +74 -0
  89. data/lib/theme_template/Gemfile +4 -0
  90. data/lib/theme_template/LICENSE.txt.erb +21 -0
  91. data/lib/theme_template/README.md.erb +52 -0
  92. data/lib/theme_template/_layouts/default.html +1 -0
  93. data/lib/theme_template/_layouts/page.html +5 -0
  94. data/lib/theme_template/_layouts/post.html +5 -0
  95. data/lib/theme_template/example/_config.yml.erb +1 -0
  96. data/lib/theme_template/example/_post.md +12 -0
  97. data/lib/theme_template/example/index.html +14 -0
  98. data/lib/theme_template/example/style.scss +7 -0
  99. data/lib/theme_template/gitignore.erb +5 -0
  100. data/lib/theme_template/theme.gemspec.erb +19 -0
  101. metadata +103 -156
  102. data/lib/jekyll-docs.rb +0 -31
  103. data/site/404.html +0 -153
  104. data/site/CNAME +0 -1
  105. data/site/community/index.html +0 -299
  106. data/site/conduct/index.html +0 -10
  107. data/site/css/screen.css +0 -1
  108. data/site/docs/assets/index.html +0 -724
  109. data/site/docs/code_of_conduct/index.html +0 -730
  110. data/site/docs/collections/index.html +0 -1097
  111. data/site/docs/conduct/index.html +0 -744
  112. data/site/docs/configuration/index.html +0 -1403
  113. data/site/docs/continuous-integration/buddyworks/index.html +0 -726
  114. data/site/docs/continuous-integration/circleci/index.html +0 -757
  115. data/site/docs/continuous-integration/index.html +0 -681
  116. data/site/docs/continuous-integration/travis-ci/index.html +0 -891
  117. data/site/docs/contributing/index.html +0 -863
  118. data/site/docs/datafiles/index.html +0 -780
  119. data/site/docs/deployment-methods/index.html +0 -875
  120. data/site/docs/drafts/index.html +0 -636
  121. data/site/docs/extras/index.html +0 -689
  122. data/site/docs/frontmatter/index.html +0 -807
  123. data/site/docs/github-pages/index.html +0 -819
  124. data/site/docs/history/index.html +0 -3955
  125. data/site/docs/home/index.html +0 -644
  126. data/site/docs/includes/index.html +0 -800
  127. data/site/docs/index.html +0 -10
  128. data/site/docs/installation/index.html +0 -732
  129. data/site/docs/maintaining/affinity-team-captain/index.html +0 -706
  130. data/site/docs/maintaining/avoiding-burnout/index.html +0 -709
  131. data/site/docs/maintaining/becoming-a-maintainer/index.html +0 -717
  132. data/site/docs/maintaining/index.html +0 -713
  133. data/site/docs/maintaining/merging-a-pull-request/index.html +0 -747
  134. data/site/docs/maintaining/reviewing-a-pull-request/index.html +0 -725
  135. data/site/docs/maintaining/special-labels/index.html +0 -705
  136. data/site/docs/maintaining/triaging-an-issue/index.html +0 -735
  137. data/site/docs/migrations/index.html +0 -647
  138. data/site/docs/pages/index.html +0 -695
  139. data/site/docs/pagination/index.html +0 -870
  140. data/site/docs/permalinks/index.html +0 -1027
  141. data/site/docs/plugins/index.html +0 -1800
  142. data/site/docs/posts/index.html +0 -858
  143. data/site/docs/quickstart/index.html +0 -650
  144. data/site/docs/resources/index.html +0 -769
  145. data/site/docs/sites/index.html +0 -702
  146. data/site/docs/static-files/index.html +0 -720
  147. data/site/docs/structure/index.html +0 -822
  148. data/site/docs/templates/index.html +0 -1208
  149. data/site/docs/themes/index.html +0 -935
  150. data/site/docs/troubleshooting/index.html +0 -893
  151. data/site/docs/upgrading/0-to-2/index.html +0 -826
  152. data/site/docs/upgrading/2-to-3/index.html +0 -824
  153. data/site/docs/upgrading/index.html +0 -693
  154. data/site/docs/usage/index.html +0 -705
  155. data/site/docs/variables/index.html +0 -1048
  156. data/site/docs/windows/index.html +0 -799
  157. data/site/favicon.ico +0 -0
  158. data/site/feed.xml +0 -372
  159. data/site/fonts/FontAwesome.eot +0 -0
  160. data/site/fonts/FontAwesome.svg +0 -12
  161. data/site/fonts/FontAwesome.ttf +0 -0
  162. data/site/fonts/FontAwesome.woff +0 -0
  163. data/site/github.html +0 -10
  164. data/site/help/index.html +0 -244
  165. data/site/icomoon-selection.json +0 -96
  166. data/site/img/article-footer.png +0 -0
  167. data/site/img/footer-arrow.png +0 -0
  168. data/site/img/footer-logo.png +0 -0
  169. data/site/img/jekyll-sticker.jpg +0 -0
  170. data/site/img/jekylllayoutconcept.png +0 -0
  171. data/site/img/logo-2x.png +0 -0
  172. data/site/img/logo-rss.png +0 -0
  173. data/site/img/octojekyll.png +0 -0
  174. data/site/index.html +0 -267
  175. data/site/issues.html +0 -10
  176. data/site/js/html5shiv.min.js +0 -4
  177. data/site/js/respond.min.js +0 -5
  178. data/site/latest_version.txt +0 -1
  179. data/site/news/2013/05/05/jekyll-1-0-0-released/index.html +0 -570
  180. data/site/news/2013/05/08/jekyll-1-0-1-released/index.html +0 -570
  181. data/site/news/2013/05/12/jekyll-1-0-2-released/index.html +0 -571
  182. data/site/news/2013/06/07/jekyll-1-0-3-released/index.html +0 -568
  183. data/site/news/2013/07/14/jekyll-1-1-0-released/index.html +0 -570
  184. data/site/news/2013/07/24/jekyll-1-1-1-released/index.html +0 -569
  185. data/site/news/2013/07/25/jekyll-1-0-4-released/index.html +0 -565
  186. data/site/news/2013/07/25/jekyll-1-1-2-released/index.html +0 -565
  187. data/site/news/2013/09/06/jekyll-1-2-0-released/index.html +0 -572
  188. data/site/news/2013/09/14/jekyll-1-2-1-released/index.html +0 -566
  189. data/site/news/2013/10/28/jekyll-1-3-0-rc1-released/index.html +0 -564
  190. data/site/news/2013/11/04/jekyll-1-3-0-released/index.html +0 -599
  191. data/site/news/2013/11/26/jekyll-1-3-1-released/index.html +0 -568
  192. data/site/news/2013/12/07/jekyll-1-4-0-released/index.html +0 -583
  193. data/site/news/2013/12/09/jekyll-1-4-1-released/index.html +0 -565
  194. data/site/news/2013/12/16/jekyll-1-4-2-released/index.html +0 -564
  195. data/site/news/2014/01/13/jekyll-1-4-3-released/index.html +0 -573
  196. data/site/news/2014/03/24/jekyll-1-5-0-released/index.html +0 -564
  197. data/site/news/2014/03/27/jekyll-1-5-1-released/index.html +0 -569
  198. data/site/news/2014/05/06/jekyll-turns-2-0-0/index.html +0 -585
  199. data/site/news/2014/05/08/jekyll-2-0-3-released/index.html +0 -565
  200. data/site/news/2014/06/04/jekyll-stickers-1-dollar-stickermule/index.html +0 -567
  201. data/site/news/2014/06/28/jekyll-turns-21-i-mean-2-1-0/index.html +0 -582
  202. data/site/news/2014/07/01/jekyll-2-1-1-released/index.html +0 -579
  203. data/site/news/2014/07/29/jekyll-2-2-0-released/index.html +0 -568
  204. data/site/news/2014/08/10/jekyll-2-3-0-released/index.html +0 -588
  205. data/site/news/2014/09/09/jekyll-2-4-0-released/index.html +0 -574
  206. data/site/news/2014/11/05/jekylls-midlife-crisis-jekyll-turns-2-5-0/index.html +0 -597
  207. data/site/news/2014/11/09/jekyll-2-5-1-released/index.html +0 -575
  208. data/site/news/2014/11/12/jekyll-2-5-2-released/index.html +0 -565
  209. data/site/news/2014/12/17/alfredxing-welcome-to-jekyll-core/index.html +0 -572
  210. data/site/news/2014/12/22/jekyll-2-5-3-released/index.html +0 -567
  211. data/site/news/2015/01/20/jekyll-meet-and-greet/index.html +0 -568
  212. data/site/news/2015/01/24/jekyll-3-0-0-beta1-released/index.html +0 -588
  213. data/site/news/2015/02/26/introducing-jekyll-talk/index.html +0 -563
  214. data/site/news/2015/10/26/jekyll-3-0-released/index.html +0 -592
  215. data/site/news/2015/11/17/jekyll-3-0-1-released/index.html +0 -576
  216. data/site/news/2016/01/20/jekyll-3-0-2-released/index.html +0 -566
  217. data/site/news/2016/01/24/jekyll-3-1-0-released/index.html +0 -599
  218. data/site/news/2016/01/28/jekyll-3-1-1-released/index.html +0 -583
  219. data/site/news/2016/02/08/jekyll-3-0-3-released/index.html +0 -578
  220. data/site/news/2016/02/19/jekyll-3-1-2-released/index.html +0 -569
  221. data/site/news/2016/03/10/making-it-easier-to-contribute-to-jekyll/index.html +0 -565
  222. data/site/news/2016/04/19/jekyll-3-0-4-released/index.html +0 -571
  223. data/site/news/2016/04/19/jekyll-3-1-3-released/index.html +0 -566
  224. data/site/news/2016/04/26/jekyll-3-0-5-released/index.html +0 -572
  225. data/site/news/2016/05/18/jekyll-3-1-4-released/index.html +0 -576
  226. data/site/news/2016/05/18/jekyll-3-1-5-released/index.html +0 -564
  227. data/site/news/2016/05/19/jekyll-3-1-6-released/index.html +0 -566
  228. data/site/news/2016/06/03/update-on-jekyll-s-google-summer-of-code-projects/index.html +0 -567
  229. data/site/news/2016/07/26/jekyll-3-2-0-released/index.html +0 -676
  230. data/site/news/2016/08/02/jekyll-3-2-1-released/index.html +0 -571
  231. data/site/news/2016/08/24/jekyll-admin-initial-release/index.html +0 -566
  232. data/site/news/2016/10/06/jekyll-3-3-is-here/index.html +0 -645
  233. data/site/news/2016/11/14/jekyll-3-3-1-released/index.html +0 -569
  234. data/site/news/2017/01/18/jekyll-3-4-0-released/index.html +0 -592
  235. data/site/news/2017/03/02/jekyll-3-4-1-released/index.html +0 -649
  236. data/site/news/2017/03/09/jekyll-3-4-2-released/index.html +0 -598
  237. data/site/news/2017/03/21/jekyll-3-4-3-released/index.html +0 -594
  238. data/site/news/2017/06/15/jekyll-3-5-0-released/index.html +0 -589
  239. data/site/news/2017/07/17/jekyll-3-5-1-released/index.html +0 -569
  240. data/site/news/2017/08/12/jekyll-3-5-2-released/index.html +0 -573
  241. data/site/news/2017/09/21/jekyll-3-6-0-released/index.html +0 -565
  242. data/site/news/index.html +0 -3609
  243. data/site/news/releases/index.html +0 -3344
  244. data/site/philosophy.html +0 -46
  245. data/site/readme.md +0 -23
  246. data/site/robots.txt +0 -1
  247. data/site/sitemap.xml +0 -485
  248. data/site/tutorials/convert-site-to-jekyll/index.html +0 -793
  249. data/site/tutorials/custom-404-page/index.html +0 -358
  250. data/site/tutorials/home/index.html +0 -323
  251. data/site/tutorials/index.html +0 -10
  252. data/site/tutorials/navigation/index.html +0 -872
  253. data/site/tutorials/orderofinterpretation/index.html +0 -441
@@ -1,1208 +0,0 @@
1
- <!DOCTYPE HTML>
2
- <html lang="en-US">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width,initial-scale=1">
7
- <meta name="generator" content="Jekyll v3.6.0">
8
- <link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites">
9
- <link rel="alternate" type="application/atom+xml" title="Recent commits to Jekyll’s master branch" href="https://github.com/jekyll/jekyll/commits/master.atom">
10
- <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
11
- <link rel="stylesheet" href="/css/screen.css">
12
- <link rel="icon" type="image/x-icon" href="/favicon.ico">
13
- <!-- Begin Jekyll SEO tag v2.3.0 -->
14
- <title>Templates | Jekyll • Simple, blog-aware, static sites</title>
15
- <meta property="og:title" content="Templates">
16
- <meta property="og:locale" content="en_US">
17
- <meta name="description" content="Jekyll uses the Liquid templating language to process templates. All of the standard Liquid tags and filters are supported. To make common tasks easier, Jekyll even adds a few handy filters and tags of its own, all of which you can find on this page. Jekyll even lets you come up with your own tags via plugins.">
18
- <meta property="og:description" content="Jekyll uses the Liquid templating language to process templates. All of the standard Liquid tags and filters are supported. To make common tasks easier, Jekyll even adds a few handy filters and tags of its own, all of which you can find on this page. Jekyll even lets you come up with your own tags via plugins.">
19
- <link rel="canonical" href="https://jekyllrb.com/docs/templates/">
20
- <meta property="og:url" content="https://jekyllrb.com/docs/templates/">
21
- <meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites">
22
- <meta property="og:type" content="article">
23
- <meta property="article:published_time" content="2017-10-24T08:07:43-07:00">
24
- <meta name="twitter:card" content="summary">
25
- <meta name="twitter:site" content="@jekyllrb">
26
- <meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY">
27
- <script type="application/ld+json">
28
- {"name":null,"description":"Jekyll uses the Liquid templating language to process templates. All of the standard Liquid tags and filters are supported. To make common tasks easier, Jekyll even adds a few handy filters and tags of its own, all of which you can find on this page. Jekyll even lets you come up with your own tags via plugins.","url":"https://jekyllrb.com/docs/templates/","headline":"Templates","dateModified":"2017-10-24T08:07:43-07:00","datePublished":"2017-10-24T08:07:43-07:00","sameAs":null,"@type":"BlogPosting","author":null,"image":null,"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://jekyllrb.com/img/logo-2x.png"}},"mainEntityOfPage":{"@type":"WebPage","@id":"https://jekyllrb.com/docs/templates/"},"@context":"http://schema.org"}</script>
29
- <!-- End Jekyll SEO tag -->
30
-
31
- <!--[if lt IE 9]>
32
- <script src="/js/html5shiv.min.js"></script>
33
- <script src="/js/respond.min.js"></script>
34
- <![endif]-->
35
- </head>
36
-
37
-
38
- <body class="wrap">
39
- <header>
40
- <nav class="mobile-nav show-on-mobiles">
41
- <ul>
42
- <li class="">
43
- <a href="/">Home</a>
44
- </li>
45
- <li class="current">
46
- <a href="/docs/home/">Docs</a>
47
- </li>
48
- <li class="">
49
- <a href="/news/">News</a>
50
- </li>
51
- <li class="">
52
- <a href="/community/">Community</a>
53
- </li>
54
- <li class="">
55
- <a href="/help/">Help</a>
56
- </li>
57
- <li>
58
- <a href="https://github.com/jekyll/jekyll">GitHub</a>
59
- </li>
60
- </ul>
61
-
62
- </nav>
63
- <div class="grid">
64
- <div class="unit one-third center-on-mobiles">
65
- <h1>
66
- <a href="/">
67
- <span class="sr-only">Jekyll</span>
68
- <img src="/img/logo-2x.png" width="249" height="115" alt="Jekyll Logo">
69
- </a>
70
- </h1>
71
- </div>
72
- <nav class="main-nav unit two-thirds hide-on-mobiles">
73
- <ul>
74
- <li class="">
75
- <a href="/">Home</a>
76
- </li>
77
- <li class="current">
78
- <a href="/docs/home/">Docs</a>
79
- </li>
80
- <li class="">
81
- <a href="/news/">News</a>
82
- </li>
83
- <li class="">
84
- <a href="/community/">Community</a>
85
- </li>
86
- <li class="">
87
- <a href="/help/">Help</a>
88
- </li>
89
- <li>
90
- <a href="https://github.com/jekyll/jekyll">GitHub</a>
91
- </li>
92
- </ul>
93
-
94
- </nav>
95
- </div>
96
- </header>
97
-
98
-
99
- <section class="docs">
100
- <div class="grid">
101
-
102
- <div class="docs-nav-mobile unit whole show-on-mobiles">
103
- <select onchange="if (this.value) window.location.href=this.value">
104
- <option value="">Navigate the docs…</option>
105
-
106
- <optgroup label="Getting Started">
107
-
108
-
109
-
110
- <option value="/docs/home/">Welcome</option>
111
-
112
-
113
-
114
- <option value="/docs/quickstart/">Quick-start guide</option>
115
-
116
-
117
-
118
- <option value="/docs/installation/">Installation</option>
119
-
120
-
121
-
122
- <option value="/docs/windows/">Jekyll on Windows</option>
123
-
124
-
125
-
126
- <option value="/docs/usage/">Basic Usage</option>
127
-
128
-
129
-
130
- <option value="/docs/structure/">Directory structure</option>
131
-
132
-
133
-
134
- <option value="/docs/configuration/">Configuration</option>
135
-
136
-
137
- </optgroup>
138
-
139
- <optgroup label="Your Content">
140
-
141
-
142
-
143
- <option value="/docs/frontmatter/">Front Matter</option>
144
-
145
-
146
-
147
- <option value="/docs/posts/">Writing posts</option>
148
-
149
-
150
-
151
- <option value="/docs/drafts/">Working with drafts</option>
152
-
153
-
154
-
155
- <option value="/docs/pages/">Creating pages</option>
156
-
157
-
158
-
159
- <option value="/docs/static-files/">Static Files</option>
160
-
161
-
162
-
163
- <option value="/docs/variables/">Variables</option>
164
-
165
-
166
-
167
- <option value="/docs/collections/">Collections</option>
168
-
169
-
170
-
171
- <option value="/docs/datafiles/">Data Files</option>
172
-
173
-
174
-
175
- <option value="/docs/assets/">Assets</option>
176
-
177
-
178
-
179
- <option value="/docs/migrations/">Blog migrations</option>
180
-
181
-
182
- </optgroup>
183
-
184
- <optgroup label="Customization">
185
-
186
-
187
-
188
- <option value="/docs/templates/">Templates</option>
189
-
190
-
191
-
192
- <option value="/docs/includes/">Includes</option>
193
-
194
-
195
-
196
- <option value="/docs/permalinks/">Permalinks</option>
197
-
198
-
199
-
200
- <option value="/docs/pagination/">Pagination</option>
201
-
202
-
203
-
204
- <option value="/docs/plugins/">Plugins</option>
205
-
206
-
207
-
208
- <option value="/docs/themes/">Themes</option>
209
-
210
-
211
-
212
- <option value="/docs/extras/">Extras</option>
213
-
214
-
215
- </optgroup>
216
-
217
- <optgroup label="Deployment">
218
-
219
-
220
-
221
- <option value="/docs/github-pages/">GitHub Pages</option>
222
-
223
-
224
-
225
- <option value="/docs/deployment-methods/">Deployment methods</option>
226
-
227
-
228
-
229
- <option value="/docs/continuous-integration/">Continuous Integration</option>
230
-
231
-
232
- </optgroup>
233
-
234
- <optgroup label="Miscellaneous">
235
-
236
-
237
-
238
- <option value="/docs/troubleshooting/">Troubleshooting</option>
239
-
240
-
241
-
242
- <option value="/docs/sites/">Sites using Jekyll</option>
243
-
244
-
245
-
246
- <option value="/docs/resources/">Resources</option>
247
-
248
-
249
-
250
- <option value="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</option>
251
-
252
-
253
-
254
- <option value="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</option>
255
-
256
-
257
- </optgroup>
258
-
259
- <optgroup label="Meta">
260
-
261
-
262
-
263
- <option value="/docs/contributing/">Contributing</option>
264
-
265
-
266
-
267
- <option value="/docs/maintaining/">Maintaining Jekyll</option>
268
-
269
-
270
-
271
- <option value="/docs/conduct/">Code of Conduct</option>
272
-
273
-
274
-
275
- <option value="/docs/history/">History</option>
276
-
277
-
278
- </optgroup>
279
-
280
- </select>
281
- </div>
282
-
283
-
284
- <div class="unit four-fifths">
285
- <article>
286
- <div class="improve right hide-on-mobiles">
287
- <a href="https://github.com/jekyll/jekyll/edit/master/docs/_docs/templates.md"><i class="fa fa-pencil"></i>  Improve this page</a>
288
- </div>
289
- <h1>Templates</h1>
290
- <p>Jekyll uses the <a href="https://shopify.github.io/liquid/">Liquid</a> templating language to
291
- process templates. All of the standard Liquid <a href="https://shopify.github.io/liquid/tags/control-flow/">tags</a> and
292
- <a href="https://shopify.github.io/liquid/filters/abs/">filters</a> are
293
- supported. To make common tasks easier, Jekyll even adds a few handy filters
294
- and tags of its own, all of which you can find on this page. Jekyll even lets
295
- you come up with your own tags via plugins.</p>
296
-
297
- <h2 id="filters">Filters</h2>
298
-
299
- <div class="mobile-side-scroller">
300
- <table>
301
- <thead>
302
- <tr>
303
- <th>Description</th>
304
- <th>
305
- <span class="filter">Filter</span> and <span class="output">Output</span>
306
- </th>
307
- </tr>
308
- </thead>
309
- <tbody>
310
- <tr>
311
- <td>
312
- <p class="name"><strong>Relative URL</strong></p>
313
- <p>Prepend the <code>baseurl</code> value to the input. Useful if your site is hosted at a subpath rather than the root of the domain.</p>
314
- </td>
315
- <td class="align-center">
316
- <p>
317
- <code class="filter">{{ "/assets/style.css" | relative_url }}</code>
318
- </p>
319
- <p>
320
- <code class="output">/my-baseurl/assets/style.css</code>
321
- </p>
322
- </td>
323
- </tr>
324
- <tr>
325
- <td>
326
- <p class="name"><strong>Absolute URL</strong></p>
327
- <p>Prepend the <code>url</code> and <code>baseurl</code> value to the input.</p>
328
- </td>
329
- <td class="align-center">
330
- <p>
331
- <code class="filter">{{ "/assets/style.css" | absolute_url }}</code>
332
- </p>
333
- <p>
334
- <code class="output">http://example.com/my-baseurl/assets/style.css</code>
335
- </p>
336
- </td>
337
- </tr>
338
- <tr>
339
- <td>
340
- <p class="name"><strong>Date to XML Schema</strong></p>
341
- <p>Convert a Date into XML Schema (ISO 8601) format.</p>
342
- </td>
343
- <td class="align-center">
344
- <p>
345
- <code class="filter">{{ site.time | date_to_xmlschema }}</code>
346
- </p>
347
- <p>
348
- <code class="output">2008-11-07T13:07:54-08:00</code>
349
- </p>
350
- </td>
351
- </tr>
352
- <tr>
353
- <td>
354
- <p class="name"><strong>Date to RFC-822 Format</strong></p>
355
- <p>Convert a Date into the RFC-822 format used for RSS feeds.</p>
356
- </td>
357
- <td class="align-center">
358
- <p>
359
- <code class="filter">{{ site.time | date_to_rfc822 }}</code>
360
- </p>
361
- <p>
362
- <code class="output">Mon, 07 Nov 2008 13:07:54 -0800</code>
363
- </p>
364
- </td>
365
- </tr>
366
- <tr>
367
- <td>
368
- <p class="name"><strong>Date to String</strong></p>
369
- <p>Convert a date to short format.</p>
370
- </td>
371
- <td class="align-center">
372
- <p>
373
- <code class="filter">{{ site.time | date_to_string }}</code>
374
- </p>
375
- <p>
376
- <code class="output">07 Nov 2008</code>
377
- </p>
378
- </td>
379
- </tr>
380
- <tr>
381
- <td>
382
- <p class="name"><strong>Date to Long String</strong></p>
383
- <p>Format a date to long format.</p>
384
- </td>
385
- <td class="align-center">
386
- <p>
387
- <code class="filter">{{ site.time | date_to_long_string }}</code>
388
- </p>
389
- <p>
390
- <code class="output">07 November 2008</code>
391
- </p>
392
- </td>
393
- </tr>
394
- <tr>
395
- <td>
396
- <p class="name"><strong>Where</strong></p>
397
- <p>Select all the objects in an array where the key has the given value.</p>
398
- </td>
399
- <td class="align-center">
400
- <p>
401
- <code class="filter">{{ site.members | where:"graduation_year","2014" }}</code>
402
- </p>
403
- </td>
404
- </tr>
405
- <tr>
406
- <td>
407
- <p class="name"><strong>Where Expression</strong></p>
408
- <p>Select all the objects in an array where the expression is true. Jekyll v3.2.0 &amp; later.</p>
409
- </td>
410
- <td class="align-center">
411
- <p>
412
- <code class="filter">{{ site.members | where_exp:"item",
413
- "item.graduation_year == 2014" }}</code>
414
- <code class="filter">{{ site.members | where_exp:"item",
415
- "item.graduation_year &lt; 2014" }}</code>
416
- <code class="filter">{{ site.members | where_exp:"item",
417
- "item.projects contains 'foo'" }}</code>
418
- </p>
419
- </td>
420
- </tr>
421
- <tr>
422
- <td>
423
- <p class="name"><strong>Group By</strong></p>
424
- <p>Group an array's items by a given property.</p>
425
- </td>
426
- <td class="align-center">
427
- <p>
428
- <code class="filter">{{ site.members | group_by:"graduation_year" }}</code>
429
- </p>
430
- <p>
431
- <code class="output">[{"name"=&gt;"2013", "items"=&gt;[...]},
432
- {"name"=&gt;"2014", "items"=&gt;[...]}]</code>
433
- </p>
434
- </td>
435
- </tr>
436
- <tr>
437
- <td>
438
- <p class="name"><strong>Group By Expression</strong></p>
439
- <p>Group an array's items using a Liquid expression.</p>
440
- </td>
441
- <td class="align-center">
442
- <p>
443
- <code class="filter">{{ site.members | group_by_exp:"item",
444
- "item.graduation_year | truncate: 3, \"\"" }}</code>
445
- </p>
446
- <p>
447
- <code class="output">[{"name"=&gt;"201...", "items"=&gt;[...]},
448
- {"name"=&gt;"200...", "items"=&gt;[...]}]</code>
449
- </p>
450
- </td>
451
- </tr>
452
- <tr>
453
- <td>
454
- <p class="name"><strong>XML Escape</strong></p>
455
- <p>Escape some text for use in XML.</p>
456
- </td>
457
- <td class="align-center">
458
- <p>
459
- <code class="filter">{{ page.content | xml_escape }}</code>
460
- </p>
461
- </td>
462
- </tr>
463
- <tr>
464
- <td>
465
- <p class="name"><strong>CGI Escape</strong></p>
466
- <p>
467
- CGI escape a string for use in a URL. Replaces any special characters
468
- with appropriate <code>%XX</code> replacements. CGI escape normally replaces a space with a plus <code>+</code> sign.
469
- </p>
470
- </td>
471
- <td class="align-center">
472
- <p>
473
- <code class="filter">{{ "foo, bar; baz?" | cgi_escape }}</code>
474
- </p>
475
- <p>
476
- <code class="output">foo%2C+bar%3B+baz%3F</code>
477
- </p>
478
- </td>
479
- </tr>
480
- <tr>
481
- <td>
482
- <p class="name"><strong>URI Escape</strong></p>
483
- <p>
484
- Percent encodes any special characters in a URI. URI escape normally replaces a space with <code>%20</code>. <a href="https://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters">Reserved characters</a> will not be escaped.
485
- </p>
486
- </td>
487
- <td class="align-center">
488
- <p>
489
- <code class="filter">{{ "http://foo.com/?q=foo, \bar?" | uri_escape }}</code>
490
- </p>
491
- <p>
492
- <code class="output">http://foo.com/?q=foo,%20%5Cbar?</code>
493
- </p>
494
- </td>
495
- </tr>
496
- <tr>
497
- <td>
498
- <p class="name"><strong>Number of Words</strong></p>
499
- <p>Count the number of words in some text.</p>
500
- </td>
501
- <td class="align-center">
502
- <p>
503
- <code class="filter">{{ page.content | number_of_words }}</code>
504
- </p>
505
- <p>
506
- <code class="output">1337</code>
507
- </p>
508
- </td>
509
- </tr>
510
- <tr>
511
- <td>
512
- <p class="name"><strong>Array to Sentence</strong></p>
513
- <p>Convert an array into a sentence. Useful for listing tags. Optional argument for connector.</p>
514
- </td>
515
- <td class="align-center">
516
- <p>
517
- <code class="filter">{{ page.tags | array_to_sentence_string }}</code>
518
- </p>
519
- <p>
520
- <code class="output">foo, bar, and baz</code>
521
- </p>
522
- <p>
523
- <code class="filter">{{ page.tags | array_to_sentence_string: 'or' }}</code>
524
- </p>
525
- <p>
526
- <code class="output">foo, bar, or baz</code>
527
- </p>
528
- </td>
529
- </tr>
530
- <tr>
531
- <td>
532
- <p class="name"><strong>Markdownify</strong></p>
533
- <p>Convert a Markdown-formatted string into HTML.</p>
534
- </td>
535
- <td class="align-center">
536
- <p>
537
- <code class="filter">{{ page.excerpt | markdownify }}</code>
538
- </p>
539
- </td>
540
- </tr>
541
- <tr>
542
- <td>
543
- <p class="name"><strong>Smartify</strong></p>
544
- <p>Convert "quotes" into “smart quotes.”</p>
545
- </td>
546
- <td class="align-center">
547
- <p>
548
- <code class="filter">{{ page.title | smartify }}</code>
549
- </p>
550
- </td>
551
- </tr>
552
- <tr>
553
- <td>
554
- <p class="name"><strong>Converting Sass/SCSS</strong></p>
555
- <p>Convert a Sass- or SCSS-formatted string into CSS.</p>
556
- </td>
557
- <td class="align-center">
558
- <p>
559
- <code class="filter">{{ some_scss | scssify }}</code>
560
- <code class="filter">{{ some_sass | sassify }}</code>
561
- </p>
562
- </td>
563
- </tr>
564
- <tr>
565
- <td>
566
- <p class="name"><strong>Slugify</strong></p>
567
- <p>Convert a string into a lowercase URL "slug". See below for options.</p>
568
- </td>
569
- <td class="align-center">
570
- <p>
571
- <code class="filter">{{ "The _config.yml file" | slugify }}</code>
572
- </p>
573
- <p>
574
- <code class="output">the-config-yml-file</code>
575
- </p>
576
- <p>
577
- <code class="filter">{{ "The _config.yml file" | slugify: 'pretty' }}</code>
578
- </p>
579
- <p>
580
- <code class="output">the-_config.yml-file</code>
581
- </p>
582
- </td>
583
- </tr>
584
- <tr>
585
- <td>
586
- <p class="name"><strong>Data To JSON</strong></p>
587
- <p>Convert Hash or Array to JSON.</p>
588
- </td>
589
- <td class="align-center">
590
- <p>
591
- <code class="filter">{{ site.data.projects | jsonify }}</code>
592
- </p>
593
- </td>
594
- </tr>
595
- <tr>
596
- <td>
597
- <p class="name"><strong>Normalize Whitespace</strong></p>
598
- <p>Replace any occurrence of whitespace with a single space.</p>
599
- </td>
600
- <td class="align-center">
601
- <p>
602
- <code class="filter">{{ "a \n b" | normalize_whitespace }}</code>
603
- </p>
604
- </td>
605
- </tr>
606
- <tr>
607
- <td>
608
- <p class="name"><strong>Sort</strong></p>
609
- <p>Sort an array. Optional arguments for hashes: 1. property name 2. nils order (<em>first</em> or <em>last</em>).</p>
610
- </td>
611
- <td class="align-center">
612
- <p>
613
- <code class="filter">{{ page.tags | sort }}</code>
614
- </p>
615
- <p>
616
- <code class="filter">{{ site.posts | sort: 'author' }}</code>
617
- </p>
618
- <p>
619
- <code class="filter">{{ site.pages | sort: 'title', 'last' }}</code>
620
- </p>
621
- </td>
622
- </tr>
623
- <tr>
624
- <td>
625
- <p class="name"><strong>Sample</strong></p>
626
- <p>Pick a random value from an array. Optional: pick multiple values.</p>
627
- </td>
628
- <td class="align-center">
629
- <p>
630
- <code class="filter">{{ site.pages | sample }}</code>
631
- </p>
632
- <p>
633
- <code class="filter">{{ site.pages | sample:2 }}</code>
634
- </p>
635
- </td>
636
- </tr>
637
- <tr>
638
- <td>
639
- <p class="name"><strong>To Integer</strong></p>
640
- <p>Convert a string or boolean to integer.</p>
641
- </td>
642
- <td class="align-center">
643
- <p>
644
- <code class="filter">{{ some_var | to_integer }}</code>
645
- </p>
646
- </td>
647
- </tr>
648
- <tr>
649
- <td>
650
- <p class="name"><strong>Array Filters</strong></p>
651
- <p>Push, pop, shift, and unshift elements from an Array.</p>
652
- <p>These are <strong>NON-DESTRUCTIVE</strong>, i.e. they do not mutate the array, but rather make a copy and mutate that.</p>
653
- </td>
654
- <td class="align-center">
655
- <p>
656
- <code class="filter">{{ page.tags | push: 'Spokane' }}</code>
657
- </p>
658
- <p>
659
- <code class="output">['Seattle', 'Tacoma', 'Spokane']</code>
660
- </p>
661
- <p>
662
- <code class="filter">{{ page.tags | pop }}</code>
663
- </p>
664
- <p>
665
- <code class="output">['Seattle']</code>
666
- </p>
667
- <p>
668
- <code class="filter">{{ page.tags | shift }}</code>
669
- </p>
670
- <p>
671
- <code class="output">['Tacoma']</code>
672
- </p>
673
- <p>
674
- <code class="filter">{{ page.tags | unshift: "Olympia" }}</code>
675
- </p>
676
- <p>
677
- <code class="output">['Olympia', 'Seattle', 'Tacoma']</code>
678
- </p>
679
- </td>
680
- </tr>
681
- <tr>
682
- <td>
683
- <p class="name"><strong>Inspect</strong></p>
684
- <p>Convert an object into its String representation for debugging.</p>
685
- </td>
686
- <td class="align-center">
687
- <p>
688
- <code class="filter">{{ some_var | inspect }}</code>
689
- </p>
690
- </td>
691
- </tr>
692
- </tbody>
693
- </table>
694
- </div>
695
-
696
- <h3 id="options-for-the-slugify-filter">Options for the <code class="highlighter-rouge">slugify</code> filter</h3>
697
-
698
- <p>The <code class="highlighter-rouge">slugify</code> filter accepts an option, each specifying what to filter.
699
- The default is <code class="highlighter-rouge">default</code>. They are as follows (with what they filter):</p>
700
-
701
- <ul>
702
- <li>
703
- <code class="highlighter-rouge">none</code>: no characters</li>
704
- <li>
705
- <code class="highlighter-rouge">raw</code>: spaces</li>
706
- <li>
707
- <code class="highlighter-rouge">default</code>: spaces and non-alphanumeric characters</li>
708
- <li>
709
- <code class="highlighter-rouge">pretty</code>: spaces and non-alphanumeric characters except for <code class="highlighter-rouge">._~!$&amp;'()+,;=@</code>
710
- </li>
711
- </ul>
712
-
713
- <h2 id="tags">Tags</h2>
714
-
715
- <ul>
716
- <li><a href="#includes">Includes</a></li>
717
- <li><a href="#code-snippet-highlighting">Code snippet highlighting</a></li>
718
- <li><a href="#links">Linking to pages, collections and posts (the new and improved way)</a></li>
719
- <li><a href="#linking-to-posts">Linking to posts (the old way)</a></li>
720
- </ul>
721
-
722
- <h3 id="includes">Includes</h3>
723
-
724
- <p>If you have small page snippets that you want to include in multiple places on your site, save the snippets as <em>include files</em> and insert them where required, by using the <code class="highlighter-rouge">include</code> tag:</p>
725
-
726
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">include</span><span class="w"> </span><span class="na">footer</span><span class="p">.</span><span class="na">html</span><span class="w"> </span><span class="p">%}</span>
727
- </code></pre></div></div>
728
-
729
- <p>Jekyll expects all <em>include files</em> to be placed in an <code class="highlighter-rouge">_includes</code> directory at the root of your source directory. In the above example, this will embed the contents of <code class="highlighter-rouge">_includes/footer.html</code> into the calling file.</p>
730
-
731
- <p>For more advanced information on using includes, see <a href="../includes">Includes</a>.</p>
732
-
733
- <h3 id="code-snippet-highlighting">Code snippet highlighting</h3>
734
-
735
- <p>Jekyll has built in support for syntax highlighting of over 60 languages
736
- thanks to <a href="http://rouge.jneen.net">Rouge</a>. Rouge is the default highlighter
737
- in Jekyll 3 and above. To use it in Jekyll 2, set <code class="highlighter-rouge">highlighter</code> to <code class="highlighter-rouge">rouge</code>
738
- and ensure the <code class="highlighter-rouge">rouge</code> gem is installed properly.</p>
739
-
740
- <p>Alternatively, you can use <a href="http://pygments.org">Pygments</a> to highlight
741
- your code snippets. To use Pygments, you must have Python installed on your
742
- system, have the <code class="highlighter-rouge">pygments.rb</code> gem installed and set <code class="highlighter-rouge">highlighter</code> to
743
- <code class="highlighter-rouge">pygments</code> in your site’s configuration file. Pygments supports <a href="http://pygments.org/languages/">over 100
744
- languages</a></p>
745
-
746
- <p>To render a code block with syntax highlighting, surround your code as follows:</p>
747
-
748
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
749
- <span class="p">{%</span><span class="w"> </span><span class="nt">highlight</span><span class="w"> </span>ruby<span class="w"> </span><span class="p">%}</span>
750
- def foo
751
- puts 'foo'
752
- end
753
- <span class="p">{%</span><span class="w"> </span><span class="nt">endhighlight</span><span class="w"> </span><span class="p">%}</span>
754
-
755
- </code></pre></div></div>
756
-
757
- <p>The argument to the <code class="highlighter-rouge">highlight</code> tag (<code class="highlighter-rouge">ruby</code> in the example above) is the
758
- language identifier. To find the appropriate identifier to use for the language
759
- you want to highlight, look for the “short name” on the <a href="https://github.com/jayferd/rouge/wiki/List-of-supported-languages-and-lexers">Rouge
760
- wiki</a>
761
- or the <a href="http://pygments.org/docs/lexers/">Pygments’ Lexers page</a>.</p>
762
-
763
- <h4 id="line-numbers">Line numbers</h4>
764
-
765
- <p>There is a second argument to <code class="highlighter-rouge">highlight</code> called <code class="highlighter-rouge">linenos</code> that is optional.
766
- Including the <code class="highlighter-rouge">linenos</code> argument will force the highlighted code to include line
767
- numbers. For instance, the following code block would include line numbers next
768
- to each line:</p>
769
-
770
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
771
- <span class="p">{%</span><span class="w"> </span><span class="nt">highlight</span><span class="w"> </span>ruby<span class="w"> </span>linenos<span class="w"> </span><span class="p">%}</span>
772
- def foo
773
- puts 'foo'
774
- end
775
- <span class="p">{%</span><span class="w"> </span><span class="nt">endhighlight</span><span class="w"> </span><span class="p">%}</span>
776
-
777
- </code></pre></div></div>
778
-
779
- <h4 id="stylesheets-for-syntax-highlighting">Stylesheets for syntax highlighting</h4>
780
-
781
- <p>In order for the highlighting to show up, you’ll need to include a highlighting
782
- stylesheet. For an example stylesheet you can look at
783
- <a href="https://github.com/mojombo/tpw/tree/master/css/syntax.css">syntax.css</a>. These
784
- are the same styles as used by GitHub and you are free to use them for your own
785
- site. If you use <code class="highlighter-rouge">linenos</code>, you might want to include an additional CSS class
786
- definition for the <code class="highlighter-rouge">.lineno</code> class in <code class="highlighter-rouge">syntax.css</code> to distinguish the line
787
- numbers from the highlighted code.</p>
788
-
789
- <h2 id="links">Links</h2>
790
-
791
- <h3 id="link">Linking to pages</h3>
792
-
793
- <p>To link to a post, a page, collection item, or file, the <code class="highlighter-rouge">link</code> tag will generate the correct permalink URL for the path you specify. For example, if you use the <code class="highlighter-rouge">link</code> tag to link to <code class="highlighter-rouge">mypage.html</code>, even if you change your permalink style to include the file extension or omit it, the URL formed by the <code class="highlighter-rouge">link</code> tag will always be valid.</p>
794
-
795
- <p>You must include the file’s original extension when using the <code class="highlighter-rouge">link</code> tag. Here are some examples:</p>
796
-
797
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
798
- <span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>_collection/name-of-document.md<span class="w"> </span><span class="p">%}</span>
799
- <span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>_posts/<span class="mi">2016</span>-<span class="mi">07</span>-<span class="mi">26</span>-name-of-post.md<span class="w"> </span><span class="p">%}</span>
800
- <span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>news/index.html<span class="w"> </span><span class="p">%}</span>
801
- <span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>/assets/files/doc.pdf<span class="w"> </span><span class="p">%}</span>
802
-
803
- </code></pre></div></div>
804
-
805
- <p>You can also use the <code class="highlighter-rouge">link</code> tag to create a link in Markdown as follows:</p>
806
-
807
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
808
- [Link to a document](<span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>_collection/name-of-document.md<span class="w"> </span><span class="p">%}</span>)
809
- [Link to a post](<span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>_posts/<span class="mi">2016</span>-<span class="mi">07</span>-<span class="mi">26</span>-name-of-post.md<span class="w"> </span><span class="p">%}</span>)
810
- [Link to a page](<span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>news/index.html<span class="w"> </span><span class="p">%}</span>)
811
- [Link to a file](<span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">link</span><span class="w"> </span>/assets/files/doc.pdf<span class="w"> </span><span class="p">%}</span>)
812
-
813
- </code></pre></div></div>
814
-
815
- <p>(Including <code class="highlighter-rouge">{{ site.baseurl }}</code> is optional — it depends on whether you want to preface the page URL with the <code class="highlighter-rouge">baseurl</code> value.)</p>
816
-
817
- <p>The path to the post, page, or collection is defined as the path relative to the root directory (where your config file is) to the file, not the path from your existing page to the other page.</p>
818
-
819
- <p>For example, suppose you’re creating a link in <code class="highlighter-rouge">page_a.md</code> (stored in <code class="highlighter-rouge">pages/folder1/folder2</code>) to <code class="highlighter-rouge">page_b.md</code> (stored in <code class="highlighter-rouge">pages/folder1</code>). Your path in the link would not be <code class="highlighter-rouge">../page_b.html</code>. Instead, it would be <code class="highlighter-rouge">/pages/folder1/page_b.md</code>.</p>
820
-
821
- <p>If you’re unsure of the path, add <code class="highlighter-rouge">{{ page.path }}</code> to the page and it will display the path.</p>
822
-
823
- <p>One major benefit of using the <code class="highlighter-rouge">link</code> or <code class="highlighter-rouge">post_url</code> tag is link validation. If the link doesn’t exist, Jekyll won’t build your site. This is a good thing, as it will alert you to a broken link so you can fix it (rather than allowing you to build and deploy a site with broken links).</p>
824
-
825
- <p>Note you cannot add filters to <code class="highlighter-rouge">link</code> tags. For example, you cannot append a string using Liquid filters, such as <code class="highlighter-rouge">{% link mypage.html | append: "#section1" %} </code>. To link to sections on a page, you will need to use regular HTML or Markdown linking techniques.</p>
826
-
827
- <h3 id="linking-to-posts">Linking to posts</h3>
828
-
829
- <p>If you want to include a link to a post on your site, the <code class="highlighter-rouge">post_url</code> tag will generate the correct permalink URL for the post you specify.</p>
830
-
831
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
832
- <span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">post_url</span><span class="w"> </span><span class="mi">2010</span>-<span class="mi">07</span>-<span class="mi">21</span>-name-of-post<span class="w"> </span><span class="p">%}</span>
833
-
834
- </code></pre></div></div>
835
-
836
- <p>If you organize your posts in subdirectories, you need to include subdirectory path to the post:</p>
837
-
838
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
839
- <span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">post_url</span><span class="w"> </span>/subdir/<span class="mi">2010</span>-<span class="mi">07</span>-<span class="mi">21</span>-name-of-post<span class="w"> </span><span class="p">%}</span>
840
-
841
- </code></pre></div></div>
842
-
843
- <p>There is no need to include the file extension when using the <code class="highlighter-rouge">post_url</code> tag.</p>
844
-
845
- <p>You can also use this tag to create a link to a post in Markdown as follows:</p>
846
-
847
- <div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
848
- [Name of Link](<span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}{%</span><span class="w"> </span><span class="nt">post_url</span><span class="w"> </span><span class="mi">2010</span>-<span class="mi">07</span>-<span class="mi">21</span>-name-of-post<span class="w"> </span><span class="p">%}</span>)
849
-
850
- </code></pre></div></div>
851
-
852
-
853
-
854
-
855
-
856
-
857
-
858
-
859
-
860
-
861
-
862
-
863
-
864
-
865
-
866
-
867
-
868
-
869
-
870
-
871
-
872
-
873
-
874
-
875
-
876
-
877
-
878
-
879
-
880
-
881
-
882
-
883
-
884
-
885
-
886
-
887
-
888
-
889
-
890
-
891
-
892
-
893
-
894
-
895
-
896
-
897
-
898
-
899
-
900
-
901
-
902
-
903
-
904
-
905
-
906
-
907
-
908
-
909
-
910
-
911
- <div class="section-nav">
912
- <div class="left align-right">
913
-
914
-
915
-
916
- <a href="/docs/migrations/" class="prev">Back</a>
917
-
918
- </div>
919
- <div class="right align-left">
920
-
921
-
922
-
923
- <a href="/docs/includes/" class="next">Next</a>
924
-
925
- </div>
926
- </div>
927
- <div class="clear"></div>
928
-
929
- </article>
930
- </div>
931
-
932
- <div class="unit one-fifth hide-on-mobiles">
933
- <aside>
934
-
935
- <h4>Getting Started</h4>
936
- <ul>
937
-
938
-
939
-
940
- <li class=""><a href="/docs/home/">Welcome</a></li>
941
-
942
-
943
-
944
- <li class=""><a href="/docs/quickstart/">Quick-start guide</a></li>
945
-
946
-
947
-
948
- <li class=""><a href="/docs/installation/">Installation</a></li>
949
-
950
-
951
-
952
- <li class=""><a href="/docs/windows/">Jekyll on Windows</a></li>
953
-
954
-
955
-
956
- <li class=""><a href="/docs/usage/">Basic Usage</a></li>
957
-
958
-
959
-
960
- <li class=""><a href="/docs/structure/">Directory structure</a></li>
961
-
962
-
963
-
964
- <li class=""><a href="/docs/configuration/">Configuration</a></li>
965
-
966
- </ul>
967
-
968
-
969
- <h4>Your Content</h4>
970
- <ul>
971
-
972
-
973
-
974
- <li class=""><a href="/docs/frontmatter/">Front Matter</a></li>
975
-
976
-
977
-
978
- <li class=""><a href="/docs/posts/">Writing posts</a></li>
979
-
980
-
981
-
982
- <li class=""><a href="/docs/drafts/">Working with drafts</a></li>
983
-
984
-
985
-
986
- <li class=""><a href="/docs/pages/">Creating pages</a></li>
987
-
988
-
989
-
990
- <li class=""><a href="/docs/static-files/">Static Files</a></li>
991
-
992
-
993
-
994
- <li class=""><a href="/docs/variables/">Variables</a></li>
995
-
996
-
997
-
998
- <li class=""><a href="/docs/collections/">Collections</a></li>
999
-
1000
-
1001
-
1002
- <li class=""><a href="/docs/datafiles/">Data Files</a></li>
1003
-
1004
-
1005
-
1006
- <li class=""><a href="/docs/assets/">Assets</a></li>
1007
-
1008
-
1009
-
1010
- <li class=""><a href="/docs/migrations/">Blog migrations</a></li>
1011
-
1012
- </ul>
1013
-
1014
-
1015
- <h4>Customization</h4>
1016
- <ul>
1017
-
1018
-
1019
-
1020
- <li class="current"><a href="/docs/templates/">Templates</a></li>
1021
-
1022
-
1023
-
1024
- <li class=""><a href="/docs/includes/">Includes</a></li>
1025
-
1026
-
1027
-
1028
- <li class=""><a href="/docs/permalinks/">Permalinks</a></li>
1029
-
1030
-
1031
-
1032
- <li class=""><a href="/docs/pagination/">Pagination</a></li>
1033
-
1034
-
1035
-
1036
- <li class=""><a href="/docs/plugins/">Plugins</a></li>
1037
-
1038
-
1039
-
1040
- <li class=""><a href="/docs/themes/">Themes</a></li>
1041
-
1042
-
1043
-
1044
- <li class=""><a href="/docs/extras/">Extras</a></li>
1045
-
1046
- </ul>
1047
-
1048
-
1049
- <h4>Deployment</h4>
1050
- <ul>
1051
-
1052
-
1053
-
1054
- <li class=""><a href="/docs/github-pages/">GitHub Pages</a></li>
1055
-
1056
-
1057
-
1058
- <li class=""><a href="/docs/deployment-methods/">Deployment methods</a></li>
1059
-
1060
-
1061
-
1062
- <li class=""><a href="/docs/continuous-integration/">Continuous Integration</a></li>
1063
-
1064
- </ul>
1065
-
1066
-
1067
- <h4>Miscellaneous</h4>
1068
- <ul>
1069
-
1070
-
1071
-
1072
- <li class=""><a href="/docs/troubleshooting/">Troubleshooting</a></li>
1073
-
1074
-
1075
-
1076
- <li class=""><a href="/docs/sites/">Sites using Jekyll</a></li>
1077
-
1078
-
1079
-
1080
- <li class=""><a href="/docs/resources/">Resources</a></li>
1081
-
1082
-
1083
-
1084
- <li class=""><a href="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</a></li>
1085
-
1086
-
1087
-
1088
- <li class=""><a href="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</a></li>
1089
-
1090
- </ul>
1091
-
1092
-
1093
- <h4>Meta</h4>
1094
- <ul>
1095
-
1096
-
1097
-
1098
- <li class=""><a href="/docs/contributing/">Contributing</a></li>
1099
-
1100
-
1101
-
1102
- <li class=""><a href="/docs/maintaining/">Maintaining Jekyll</a></li>
1103
-
1104
-
1105
-
1106
- <li class=""><a href="/docs/conduct/">Code of Conduct</a></li>
1107
-
1108
-
1109
-
1110
- <li class=""><a href="/docs/history/">History</a></li>
1111
-
1112
- </ul>
1113
-
1114
-
1115
- </aside>
1116
- </div>
1117
-
1118
-
1119
- <div class="clear"></div>
1120
-
1121
- </div>
1122
- </section>
1123
-
1124
-
1125
- <footer>
1126
- <div class="grid">
1127
- <div class="unit one-third center-on-mobiles">
1128
- <p>The contents of this website are <br>© 2017 under the terms of the <a href="https://github.com/jekyll/jekyll/blob/master/LICENSE">MIT License</a>.</p>
1129
- </div>
1130
- <div class="unit two-thirds align-right center-on-mobiles">
1131
- <p>
1132
- Proudly hosted by
1133
- <a href="https://github.com">
1134
- <img src="/img/footer-logo.png" width="100" height="30" alt="GitHub • Social coding">
1135
- </a>
1136
- </p>
1137
- </div>
1138
- </div>
1139
- </footer>
1140
-
1141
- <script>
1142
- var anchorForId = function (id) {
1143
- var anchor = document.createElement("a");
1144
- anchor.className = "header-link";
1145
- anchor.href = "#" + id;
1146
- anchor.innerHTML = "<span class=\"sr-only\">Permalink</span><i class=\"fa fa-link\"></i>";
1147
- anchor.title = "Permalink";
1148
- return anchor;
1149
- };
1150
-
1151
- var linkifyAnchors = function (level, containingElement) {
1152
- var headers = containingElement.getElementsByTagName("h" + level);
1153
- for (var h = 0; h < headers.length; h++) {
1154
- var header = headers[h];
1155
-
1156
- if (typeof header.id !== "undefined" && header.id !== "") {
1157
- header.appendChild(anchorForId(header.id));
1158
- }
1159
- }
1160
- };
1161
-
1162
- document.onreadystatechange = function () {
1163
- if (this.readyState === "complete") {
1164
- var contentBlock = document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0];
1165
- if (!contentBlock) {
1166
- return;
1167
- }
1168
- for (var level = 1; level <= 6; level++) {
1169
- linkifyAnchors(level, contentBlock);
1170
- }
1171
- }
1172
- };
1173
- </script>
1174
-
1175
-
1176
- <!-- Gauges (http://get.gaug.es/) -->
1177
- <script>
1178
- var _gauges = _gauges || [];
1179
- (function() {
1180
- var t = document.createElement('script');
1181
- t.type = 'text/javascript';
1182
- t.async = true;
1183
- t.id = 'gauges-tracker';
1184
- t.setAttribute('data-site-id', '503c5af6613f5d0f19000027');
1185
- t.src = '//secure.gaug.es/track.js';
1186
- var s = document.getElementsByTagName('script')[0];
1187
- s.parentNode.insertBefore(t, s);
1188
- })();
1189
- </script>
1190
-
1191
-
1192
-
1193
- <!-- Google Analytics (https://www.google.com/analytics) -->
1194
- <script>
1195
- !function(j,e,k,y,l,L){j.GoogleAnalyticsObject=y,j[y]||(j[y]=function(){
1196
- (j[y].q=j[y].q||[]).push(arguments)}),j[y].l=+new Date,l=e.createElement(k),
1197
- L=e.getElementsByTagName(k)[0],l.src='//www.google-analytics.com/analytics.js',
1198
- L.parentNode.insertBefore(l,L)}(window,document,'script','ga');
1199
-
1200
- ga('create', 'UA-50755011-1', 'jekyllrb.com');
1201
- ga('send', 'pageview');
1202
-
1203
- </script>
1204
-
1205
-
1206
-
1207
- </body>
1208
- </html>