jekyll-docs 3.5.2 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/site/404.html +3 -3
- data/site/community/index.html +5 -5
- data/site/docs/assets/index.html +14 -22
- data/site/docs/code_of_conduct/index.html +730 -0
- data/site/docs/collections/index.html +65 -80
- data/site/docs/conduct/index.html +4 -4
- data/site/docs/configuration/index.html +130 -156
- data/site/docs/continuous-integration/buddyworks/index.html +14 -16
- data/site/docs/continuous-integration/circleci/index.html +13 -21
- data/site/docs/continuous-integration/index.html +5 -5
- data/site/docs/continuous-integration/travis-ci/index.html +45 -73
- data/site/docs/contributing/index.html +10 -10
- data/site/docs/datafiles/index.html +37 -53
- data/site/docs/deployment-methods/index.html +54 -64
- data/site/docs/drafts/index.html +6 -8
- data/site/docs/extras/index.html +8 -12
- data/site/docs/frontmatter/index.html +10 -14
- data/site/docs/github-pages/index.html +10 -14
- data/site/docs/history/index.html +539 -440
- data/site/docs/home/index.html +4 -4
- data/site/docs/includes/index.html +42 -70
- data/site/docs/installation/index.html +23 -37
- data/site/docs/maintaining/affinity-team-captain/index.html +4 -4
- data/site/docs/maintaining/avoiding-burnout/index.html +4 -4
- data/site/docs/maintaining/becoming-a-maintainer/index.html +4 -4
- data/site/docs/maintaining/index.html +4 -4
- data/site/docs/maintaining/merging-a-pull-request/index.html +6 -8
- data/site/docs/maintaining/reviewing-a-pull-request/index.html +4 -4
- data/site/docs/maintaining/special-labels/index.html +4 -4
- data/site/docs/maintaining/triaging-an-issue/index.html +4 -4
- data/site/docs/migrations/index.html +4 -4
- data/site/docs/pages/index.html +8 -12
- data/site/docs/pagination/index.html +13 -21
- data/site/docs/permalinks/index.html +43 -34
- data/site/docs/plugins/index.html +51 -79
- data/site/docs/posts/index.html +26 -48
- data/site/docs/quickstart/index.html +6 -8
- data/site/docs/resources/index.html +45 -21
- data/site/docs/sites/index.html +4 -4
- data/site/docs/static-files/index.html +12 -16
- data/site/docs/structure/index.html +6 -8
- data/site/docs/templates/index.html +36 -68
- data/site/docs/themes/index.html +32 -49
- data/site/docs/troubleshooting/index.html +44 -82
- data/site/docs/upgrading/0-to-2/index.html +7 -9
- data/site/docs/upgrading/2-to-3/index.html +19 -31
- data/site/docs/upgrading/index.html +4 -4
- data/site/docs/usage/index.html +20 -30
- data/site/docs/variables/index.html +26 -10
- data/site/docs/windows/index.html +36 -58
- data/site/feed.xml +47 -53
- data/site/help/index.html +3 -3
- data/site/index.html +3 -3
- data/site/latest_version.txt +1 -1
- data/site/news/2013/05/05/jekyll-1-0-0-released/index.html +16 -8
- data/site/news/2013/05/08/jekyll-1-0-1-released/index.html +16 -8
- data/site/news/2013/05/12/jekyll-1-0-2-released/index.html +16 -8
- data/site/news/2013/06/07/jekyll-1-0-3-released/index.html +16 -8
- data/site/news/2013/07/14/jekyll-1-1-0-released/index.html +16 -8
- data/site/news/2013/07/24/jekyll-1-1-1-released/index.html +16 -8
- data/site/news/2013/07/25/jekyll-1-0-4-released/index.html +16 -8
- data/site/news/2013/07/25/jekyll-1-1-2-released/index.html +16 -8
- data/site/news/2013/09/06/jekyll-1-2-0-released/index.html +16 -8
- data/site/news/2013/09/14/jekyll-1-2-1-released/index.html +16 -8
- data/site/news/2013/10/28/jekyll-1-3-0-rc1-released/index.html +16 -8
- data/site/news/2013/11/04/jekyll-1-3-0-released/index.html +16 -8
- data/site/news/2013/11/26/jekyll-1-3-1-released/index.html +16 -8
- data/site/news/2013/12/07/jekyll-1-4-0-released/index.html +16 -8
- data/site/news/2013/12/09/jekyll-1-4-1-released/index.html +16 -8
- data/site/news/2013/12/16/jekyll-1-4-2-released/index.html +16 -8
- data/site/news/2014/01/13/jekyll-1-4-3-released/index.html +16 -8
- data/site/news/2014/03/24/jekyll-1-5-0-released/index.html +16 -8
- data/site/news/2014/03/27/jekyll-1-5-1-released/index.html +16 -8
- data/site/news/2014/05/06/jekyll-turns-2-0-0/index.html +16 -8
- data/site/news/2014/05/08/jekyll-2-0-3-released/index.html +16 -8
- data/site/news/2014/06/04/jekyll-stickers-1-dollar-stickermule/index.html +16 -8
- data/site/news/2014/06/28/jekyll-turns-21-i-mean-2-1-0/index.html +16 -8
- data/site/news/2014/07/01/jekyll-2-1-1-released/index.html +16 -8
- data/site/news/2014/07/29/jekyll-2-2-0-released/index.html +16 -8
- data/site/news/2014/08/10/jekyll-2-3-0-released/index.html +16 -8
- data/site/news/2014/09/09/jekyll-2-4-0-released/index.html +16 -8
- data/site/news/2014/11/05/jekylls-midlife-crisis-jekyll-turns-2-5-0/index.html +16 -8
- data/site/news/2014/11/09/jekyll-2-5-1-released/index.html +16 -8
- data/site/news/2014/11/12/jekyll-2-5-2-released/index.html +16 -8
- data/site/news/2014/12/17/alfredxing-welcome-to-jekyll-core/index.html +16 -8
- data/site/news/2014/12/22/jekyll-2-5-3-released/index.html +16 -8
- data/site/news/2015/01/20/jekyll-meet-and-greet/index.html +16 -8
- data/site/news/2015/01/24/jekyll-3-0-0-beta1-released/index.html +17 -9
- data/site/news/2015/02/26/introducing-jekyll-talk/index.html +16 -8
- data/site/news/2015/10/26/jekyll-3-0-released/index.html +16 -8
- data/site/news/2015/11/17/jekyll-3-0-1-released/index.html +16 -8
- data/site/news/2016/01/20/jekyll-3-0-2-released/index.html +16 -8
- data/site/news/2016/01/24/jekyll-3-1-0-released/index.html +16 -8
- data/site/news/2016/01/28/jekyll-3-1-1-released/index.html +16 -8
- data/site/news/2016/02/08/jekyll-3-0-3-released/index.html +16 -8
- data/site/news/2016/02/19/jekyll-3-1-2-released/index.html +16 -8
- data/site/news/2016/03/10/making-it-easier-to-contribute-to-jekyll/index.html +16 -8
- data/site/news/2016/04/19/jekyll-3-0-4-released/index.html +20 -12
- data/site/news/2016/04/19/jekyll-3-1-3-released/index.html +16 -8
- data/site/news/2016/04/26/jekyll-3-0-5-released/index.html +16 -8
- data/site/news/2016/05/18/jekyll-3-1-4-released/index.html +16 -8
- data/site/news/2016/05/18/jekyll-3-1-5-released/index.html +16 -8
- data/site/news/2016/05/19/jekyll-3-1-6-released/index.html +16 -8
- data/site/news/2016/06/03/update-on-jekyll-s-google-summer-of-code-projects/index.html +16 -8
- data/site/news/2016/07/26/jekyll-3-2-0-released/index.html +16 -8
- data/site/news/2016/08/02/jekyll-3-2-1-released/index.html +16 -8
- data/site/news/2016/08/24/jekyll-admin-initial-release/index.html +16 -8
- data/site/news/2016/10/06/jekyll-3-3-is-here/index.html +16 -8
- data/site/news/2016/11/14/jekyll-3-3-1-released/index.html +16 -8
- data/site/news/2017/01/18/jekyll-3-4-0-released/index.html +16 -8
- data/site/news/2017/03/02/jekyll-3-4-1-released/index.html +27 -29
- data/site/news/2017/03/09/jekyll-3-4-2-released/index.html +23 -17
- data/site/news/2017/03/21/jekyll-3-4-3-released/index.html +20 -14
- data/site/news/2017/06/15/jekyll-3-5-0-released/index.html +21 -13
- data/site/news/2017/07/17/jekyll-3-5-1-released/index.html +18 -10
- data/site/news/2017/08/12/jekyll-3-5-2-released/index.html +573 -0
- data/site/news/2017/09/21/jekyll-3-6-0-released/index.html +565 -0
- data/site/news/index.html +122 -48
- data/site/news/releases/index.html +122 -48
- data/site/sitemap.xml +64 -52
- data/site/tutorials/convert-site-to-jekyll/index.html +80 -138
- data/site/tutorials/custom-404-page/index.html +13 -21
- data/site/tutorials/home/index.html +4 -4
- data/site/tutorials/navigation/index.html +144 -180
- data/site/tutorials/orderofinterpretation/index.html +27 -45
- metadata +8 -5
@@ -4,13 +4,13 @@
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
7
|
-
<meta name="generator" content="Jekyll v3.
|
7
|
+
<meta name="generator" content="Jekyll v3.6.0">
|
8
8
|
<link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites">
|
9
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
10
|
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
|
11
11
|
<link rel="stylesheet" href="/css/screen.css">
|
12
12
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
13
|
-
<!-- Begin Jekyll SEO tag v2.
|
13
|
+
<!-- Begin Jekyll SEO tag v2.3.0 -->
|
14
14
|
<title>Custom 404 Page | Jekyll • Simple, blog-aware, static sites</title>
|
15
15
|
<meta property="og:title" content="Custom 404 Page">
|
16
16
|
<meta property="og:locale" content="en_US">
|
@@ -20,12 +20,12 @@
|
|
20
20
|
<meta property="og:url" content="https://jekyllrb.com/tutorials/custom-404-page/">
|
21
21
|
<meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites">
|
22
22
|
<meta property="og:type" content="article">
|
23
|
-
<meta property="article:published_time" content="2017-
|
23
|
+
<meta property="article:published_time" content="2017-10-24T08:07:43-07:00">
|
24
24
|
<meta name="twitter:card" content="summary">
|
25
25
|
<meta name="twitter:site" content="@jekyllrb">
|
26
26
|
<meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY">
|
27
27
|
<script type="application/ld+json">
|
28
|
-
{"
|
28
|
+
{"name":null,"description":"You can easily serve custom 404 error pages with Jekyll to replace the default Error 404 – File Not Found page displayed when one tries to access a broken link on your site.","url":"https://jekyllrb.com/tutorials/custom-404-page/","headline":"Custom 404 Page","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/tutorials/custom-404-page/"},"@context":"http://schema.org"}</script>
|
29
29
|
<!-- End Jekyll SEO tag -->
|
30
30
|
|
31
31
|
<!--[if lt IE 9]>
|
@@ -148,8 +148,7 @@
|
|
148
148
|
|
149
149
|
<p>If you plan to organize your files under subdirectories, the error page should have the following Front Matter Data, set: <code class="highlighter-rouge">permalink: /404.html</code>. This is to ensure that the compiled <code class="highlighter-rouge">404.html</code> resides at the root of your processed site, where it’ll be picked by the server.</p>
|
150
150
|
|
151
|
-
<div class="highlighter-rouge"
|
152
|
-
<pre class="highlight"><code>---
|
151
|
+
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>---
|
153
152
|
# example 404.md
|
154
153
|
|
155
154
|
layout: default
|
@@ -159,8 +158,7 @@ permalink: /404.html
|
|
159
158
|
# 404
|
160
159
|
|
161
160
|
Page not found! :(
|
162
|
-
</code></pre>
|
163
|
-
</div>
|
161
|
+
</code></pre></div></div>
|
164
162
|
|
165
163
|
<h2 id="hosting-on-apache-web-servers">Hosting on Apache Web Servers</h2>
|
166
164
|
|
@@ -168,17 +166,13 @@ Page not found! :(
|
|
168
166
|
|
169
167
|
<p>Simply add the following to your <code class="highlighter-rouge">.htaccess</code> file.</p>
|
170
168
|
|
171
|
-
<div class="highlighter-rouge">
|
172
|
-
|
173
|
-
</code></pre>
|
174
|
-
</div>
|
169
|
+
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ErrorDocument 404 /404.html
|
170
|
+
</code></pre></div></div>
|
175
171
|
|
176
172
|
<p>With an <code class="highlighter-rouge">.htaccess</code> file, you have the freedom to place your error page within a subdirectory.</p>
|
177
173
|
|
178
|
-
<div class="highlighter-rouge">
|
179
|
-
|
180
|
-
</code></pre>
|
181
|
-
</div>
|
174
|
+
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ErrorDocument 404 /error_pages/404.html
|
175
|
+
</code></pre></div></div>
|
182
176
|
|
183
177
|
<p>Where the path is relative to your site’s domain.</p>
|
184
178
|
|
@@ -188,17 +182,15 @@ Page not found! :(
|
|
188
182
|
|
189
183
|
<p>The procedure is just as simple as configuring Apache servers, but slightly different.</p>
|
190
184
|
|
191
|
-
<p>Add the following to the
|
185
|
+
<p>Add the following to the nginx configuration file, <code class="highlighter-rouge">nginx.conf</code>, which is usually located inside <code class="highlighter-rouge">/etc/nginx/</code> or <code class="highlighter-rouge">/etc/nginx/conf/</code>:</p>
|
192
186
|
|
193
|
-
<div class="highlighter-rouge">
|
194
|
-
<pre class="highlight"><code>server {
|
187
|
+
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>server {
|
195
188
|
error_page 404 /404.html;
|
196
189
|
location /404.html {
|
197
190
|
internal;
|
198
191
|
}
|
199
192
|
}
|
200
|
-
</code></pre>
|
201
|
-
</div>
|
193
|
+
</code></pre></div></div>
|
202
194
|
<p>The <code class="highlighter-rouge">location</code> directive prevents users from directly browsing the 404.html page.</p>
|
203
195
|
|
204
196
|
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
7
|
-
<meta name="generator" content="Jekyll v3.
|
7
|
+
<meta name="generator" content="Jekyll v3.6.0">
|
8
8
|
<link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites">
|
9
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
10
|
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
|
11
11
|
<link rel="stylesheet" href="/css/screen.css">
|
12
12
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
13
|
-
<!-- Begin Jekyll SEO tag v2.
|
13
|
+
<!-- Begin Jekyll SEO tag v2.3.0 -->
|
14
14
|
<title>Tutorials | Jekyll • Simple, blog-aware, static sites</title>
|
15
15
|
<meta property="og:title" content="Tutorials">
|
16
16
|
<meta property="og:locale" content="en_US">
|
@@ -20,12 +20,12 @@
|
|
20
20
|
<meta property="og:url" content="https://jekyllrb.com/tutorials/home/">
|
21
21
|
<meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites">
|
22
22
|
<meta property="og:type" content="article">
|
23
|
-
<meta property="article:published_time" content="2017-
|
23
|
+
<meta property="article:published_time" content="2017-10-24T08:07:43-07:00">
|
24
24
|
<meta name="twitter:card" content="summary">
|
25
25
|
<meta name="twitter:site" content="@jekyllrb">
|
26
26
|
<meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY">
|
27
27
|
<script type="application/ld+json">
|
28
|
-
{"
|
28
|
+
{"name":null,"description":"In contrast to Docs, Tutorials provide more detailed, narrative instruction that cover a variety of Jekyll topics and scenarios. Tutorials might contain the following:","url":"https://jekyllrb.com/tutorials/home/","headline":"Tutorials","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/tutorials/home/"},"@context":"http://schema.org"}</script>
|
29
29
|
<!-- End Jekyll SEO tag -->
|
30
30
|
|
31
31
|
<!--[if lt IE 9]>
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
7
|
-
<meta name="generator" content="Jekyll v3.
|
7
|
+
<meta name="generator" content="Jekyll v3.6.0">
|
8
8
|
<link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites">
|
9
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
10
|
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
|
11
11
|
<link rel="stylesheet" href="/css/screen.css">
|
12
12
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
13
|
-
<!-- Begin Jekyll SEO tag v2.
|
13
|
+
<!-- Begin Jekyll SEO tag v2.3.0 -->
|
14
14
|
<title>Navigation | Jekyll • Simple, blog-aware, static sites</title>
|
15
15
|
<meta property="og:title" content="Navigation">
|
16
16
|
<meta property="og:locale" content="en_US">
|
@@ -20,12 +20,12 @@
|
|
20
20
|
<meta property="og:url" content="https://jekyllrb.com/tutorials/navigation/">
|
21
21
|
<meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites">
|
22
22
|
<meta property="og:type" content="article">
|
23
|
-
<meta property="article:published_time" content="2017-
|
23
|
+
<meta property="article:published_time" content="2017-10-24T08:07:43-07:00">
|
24
24
|
<meta name="twitter:card" content="summary">
|
25
25
|
<meta name="twitter:site" content="@jekyllrb">
|
26
26
|
<meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY">
|
27
27
|
<script type="application/ld+json">
|
28
|
-
{"
|
28
|
+
{"name":null,"description":"If your Jekyll site has a lot of pages, you might want to create navigation for the pages. Instead of hard-coding navigation links, you can programmatically retrieve a list of pages to build the navigation for your site.","url":"https://jekyllrb.com/tutorials/navigation/","headline":"Navigation","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/tutorials/navigation/"},"@context":"http://schema.org"}</script>
|
29
29
|
<!-- End Jekyll SEO tag -->
|
30
30
|
|
31
31
|
<!--[if lt IE 9]>
|
@@ -180,32 +180,28 @@
|
|
180
180
|
|
181
181
|
<p><strong>YAML</strong></p>
|
182
182
|
|
183
|
-
<div class="language-yaml highlighter-rouge">
|
184
|
-
<
|
185
|
-
<span class="s">docs</span><span class="pi">:</span>
|
183
|
+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">docs_list_title</span><span class="pi">:</span> <span class="s">ACME Documentation</span>
|
184
|
+
<span class="na">docs</span><span class="pi">:</span>
|
186
185
|
|
187
|
-
<span class="pi">-</span> <span class="
|
188
|
-
<span class="
|
186
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Introduction</span>
|
187
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">introduction.html</span>
|
189
188
|
|
190
|
-
<span class="pi">-</span> <span class="
|
191
|
-
<span class="
|
189
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Configuration</span>
|
190
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">configuration.html</span>
|
192
191
|
|
193
|
-
<span class="pi">-</span> <span class="
|
194
|
-
<span class="
|
195
|
-
</code></pre>
|
196
|
-
</div>
|
192
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Deployment</span>
|
193
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">deployment.html</span>
|
194
|
+
</code></pre></div></div>
|
197
195
|
|
198
196
|
<p><strong>Liquid</strong></p>
|
199
197
|
|
200
|
-
<div class="language-liquid highlighter-rouge">
|
201
|
-
<pre class="highlight"><code><h2><span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">data</span><span class="p">.</span><span class="nv">samplelist</span><span class="p">.</span><span class="nv">docs_list_title</span><span class="w"> </span><span class="p">}}</span></h2>
|
198
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><h2><span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">data</span><span class="p">.</span><span class="nv">samplelist</span><span class="p">.</span><span class="nv">docs_list_title</span><span class="w"> </span><span class="p">}}</span></h2>
|
202
199
|
<ul>
|
203
200
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.docs<span class="w"> </span><span class="p">%}</span>
|
204
201
|
<li><a href="<span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}</span>" alt="<span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span>"><span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span></a></li>
|
205
202
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
206
203
|
</ul>
|
207
|
-
</code></pre>
|
208
|
-
</div>
|
204
|
+
</code></pre></div></div>
|
209
205
|
|
210
206
|
<p><strong>Result</strong></p>
|
211
207
|
<div class="highlight result">
|
@@ -242,13 +238,11 @@
|
|
242
238
|
|
243
239
|
<p><strong>Liquid</strong></p>
|
244
240
|
|
245
|
-
<div class="language-liquid highlighter-rouge">
|
246
|
-
<pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">doclist</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">data</span><span class="p">.</span><span class="nv">samplelist</span><span class="p">.</span><span class="nv">docs</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">sort</span><span class="p">:</span><span class="w"> </span><span class="s1">'title'</span><span class="w"> </span><span class="p">%}</span>
|
241
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">doclist</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">data</span><span class="p">.</span><span class="nv">samplelist</span><span class="p">.</span><span class="nv">docs</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">sort</span><span class="p">:</span><span class="w"> </span><span class="s1">'title'</span><span class="w"> </span><span class="p">%}</span>
|
247
242
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>doclist<span class="w"> </span><span class="p">%}</span>
|
248
243
|
<li><a href="<span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}</span>" alt="<span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span>"><span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span></a></li>
|
249
244
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
250
|
-
</code></pre>
|
251
|
-
</div>
|
245
|
+
</code></pre></div></div>
|
252
246
|
|
253
247
|
<p><strong>Result</strong></p>
|
254
248
|
|
@@ -262,10 +256,8 @@
|
|
262
256
|
|
263
257
|
<p>See the <a href="https://help.shopify.com/themes/liquid/filters/array-filters">Liquid array filter</a> for more filter options. Note that you can’t simply use this syntax:</p>
|
264
258
|
|
265
|
-
<div class="language-liquid highlighter-rouge">
|
266
|
-
|
267
|
-
</code></pre>
|
268
|
-
</div>
|
259
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.docs<span class="w"> </span>|<span class="w"> </span><span class="na">sort</span><span class="o">:</span><span class="w"> </span><span class="s2">"title"</span><span class="w"> </span><span class="p">%}{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
260
|
+
</code></pre></div></div>
|
269
261
|
|
270
262
|
<p>You have to convert <code class="highlighter-rouge">site.data.samplelist.docs</code> to a variable first using either <code class="highlighter-rouge">assign</code> or <code class="highlighter-rouge">capture</code> tags.</p>
|
271
263
|
|
@@ -275,39 +267,36 @@
|
|
275
267
|
|
276
268
|
<p><strong>YAML</strong></p>
|
277
269
|
|
278
|
-
<div class="language-yaml highlighter-rouge">
|
279
|
-
<
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
</code></pre>
|
305
|
-
</div>
|
270
|
+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">toc</span><span class="pi">:</span>
|
271
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Group 1</span>
|
272
|
+
<span class="na">subfolderitems</span><span class="pi">:</span>
|
273
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Thing 1</span>
|
274
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/thing1.html</span>
|
275
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Thing 2</span>
|
276
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/thing2.html</span>
|
277
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Thing 3</span>
|
278
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/thing3.html</span>
|
279
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Group 2</span>
|
280
|
+
<span class="na">subfolderitems</span><span class="pi">:</span>
|
281
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Piece 1</span>
|
282
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/piece1.html</span>
|
283
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Piece 2</span>
|
284
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/piece2.html</span>
|
285
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Piece 3</span>
|
286
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/piece3.html</span>
|
287
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Group 3</span>
|
288
|
+
<span class="na">subfolderitems</span><span class="pi">:</span>
|
289
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Widget 1</span>
|
290
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/widget1.html</span>
|
291
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Widget 2</span>
|
292
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/widget2.html</span>
|
293
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Widget 3</span>
|
294
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/widget3.html</span>
|
295
|
+
</code></pre></div></div>
|
306
296
|
|
307
297
|
<p><strong>Liquid</strong></p>
|
308
298
|
|
309
|
-
<div class="language-liquid highlighter-rouge">
|
310
|
-
<pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.toc<span class="w"> </span><span class="p">%}</span>
|
299
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.toc<span class="w"> </span><span class="p">%}</span>
|
311
300
|
<h3><span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span></h3>
|
312
301
|
<ul>
|
313
302
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>entry<span class="w"> </span>in<span class="w"> </span>item.subfolderitems<span class="w"> </span><span class="p">%}</span>
|
@@ -315,8 +304,7 @@
|
|
315
304
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
316
305
|
</ul>
|
317
306
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
318
|
-
</code></pre>
|
319
|
-
</div>
|
307
|
+
</code></pre></div></div>
|
320
308
|
|
321
309
|
<p><strong>Result</strong></p>
|
322
310
|
<div class="highlight result">
|
@@ -352,54 +340,51 @@
|
|
352
340
|
|
353
341
|
<p><strong>YAML</strong></p>
|
354
342
|
|
355
|
-
<div class="language-yaml highlighter-rouge">
|
356
|
-
<
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
<span class="
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
<span class="
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
<span class="
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
</code></pre>
|
397
|
-
</div>
|
343
|
+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">toc2</span><span class="pi">:</span>
|
344
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Group 1</span>
|
345
|
+
<span class="na">subfolderitems</span><span class="pi">:</span>
|
346
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Thing 1</span>
|
347
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/thing1.html</span>
|
348
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Thing 2</span>
|
349
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/thing2.html</span>
|
350
|
+
<span class="na">subsubfolderitems</span><span class="pi">:</span>
|
351
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Subthing 1</span>
|
352
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/subthing1.html</span>
|
353
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Subthing 2</span>
|
354
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/subthing2.html</span>
|
355
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Thing 3</span>
|
356
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/thing3.html</span>
|
357
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Group 2</span>
|
358
|
+
<span class="na">subfolderitems</span><span class="pi">:</span>
|
359
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Piece 1</span>
|
360
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/piece1.html</span>
|
361
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Piece 2</span>
|
362
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/piece2.html</span>
|
363
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Piece 3</span>
|
364
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/piece3.html</span>
|
365
|
+
<span class="na">subsubfolderitems</span><span class="pi">:</span>
|
366
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Subpiece 1</span>
|
367
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/subpiece1.html</span>
|
368
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Subpiece2</span>
|
369
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/subpiece2.html</span>
|
370
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Group 3</span>
|
371
|
+
<span class="na">subfolderitems</span><span class="pi">:</span>
|
372
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Widget 1</span>
|
373
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/widget1.html</span>
|
374
|
+
<span class="na">subsubfolderitems</span><span class="pi">:</span>
|
375
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Subwidget 1</span>
|
376
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/subwidget1.html</span>
|
377
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Subwidget 2</span>
|
378
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/subwidget2.html</span>
|
379
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Widget 2</span>
|
380
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/widget2.html</span>
|
381
|
+
<span class="pi">-</span> <span class="na">page</span><span class="pi">:</span> <span class="s">Widget 3</span>
|
382
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">/widget3.html</span>
|
383
|
+
</code></pre></div></div>
|
398
384
|
|
399
385
|
<p><strong>Liquid</strong></p>
|
400
386
|
|
401
|
-
<div class="language-liquid highlighter-rouge"
|
402
|
-
<pre class="highlight"><code><div>
|
387
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><div>
|
403
388
|
<span class="p">{%</span><span class="w"> </span><span class="kr">if</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">data</span><span class="p">.</span><span class="nv">samplelist</span><span class="p">.</span><span class="nv">toc2</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="p">%}</span>
|
404
389
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.toc<span class="mi">2</span><span class="w"> </span><span class="p">%}</span>
|
405
390
|
<h3><span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span></h3>
|
@@ -420,8 +405,7 @@
|
|
420
405
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
421
406
|
<span class="p">{%</span><span class="w"> </span><span class="kr">endif</span><span class="w"> </span><span class="p">%}</span>
|
422
407
|
</div>
|
423
|
-
</code></pre>
|
424
|
-
</div>
|
408
|
+
</code></pre></div></div>
|
425
409
|
|
426
410
|
<p><strong>Result</strong></p>
|
427
411
|
|
@@ -475,24 +459,20 @@
|
|
475
459
|
|
476
460
|
<p><strong>Page front matter</strong></p>
|
477
461
|
|
478
|
-
<div class="language-yaml highlighter-rouge">
|
479
|
-
<
|
480
|
-
<span class="
|
481
|
-
<span class="s">sidebar</span><span class="pi">:</span> <span class="s">toc</span>
|
462
|
+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">---</span>
|
463
|
+
<span class="na">title</span><span class="pi">:</span> <span class="s">My page</span>
|
464
|
+
<span class="na">sidebar</span><span class="pi">:</span> <span class="s">toc</span>
|
482
465
|
<span class="nn">---</span>
|
483
|
-
</code></pre>
|
484
|
-
</div>
|
466
|
+
</code></pre></div></div>
|
485
467
|
|
486
468
|
<p><strong>Liquid</strong></p>
|
487
469
|
|
488
|
-
<div class="language-liquid highlighter-rouge"
|
489
|
-
<pre class="highlight"><code><ul>
|
470
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><ul>
|
490
471
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist[page.sidebar]<span class="w"> </span><span class="p">%}</span>
|
491
472
|
<li><a href="<span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}</span>"><span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span></a></li>
|
492
473
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
493
474
|
</ul>
|
494
|
-
</code></pre>
|
495
|
-
</div>
|
475
|
+
</code></pre></div></div>
|
496
476
|
<p><strong>Result</strong></p>
|
497
477
|
|
498
478
|
<div class="highlight result">
|
@@ -512,23 +492,19 @@
|
|
512
492
|
<p>In addition to inserting items from the YAML data file into your list, you also usually want to highlight the current link if the user is viewing that page. You do this by inserting an <code class="highlighter-rouge">active</code> class for items that match the current page URL.</p>
|
513
493
|
|
514
494
|
<p><strong>CSS</strong></p>
|
515
|
-
<div class="language-css highlighter-rouge">
|
516
|
-
<pre class="highlight"><code><span class="nc">.result</span> <span class="nt">li</span><span class="nc">.active</span> <span class="nt">a</span> <span class="p">{</span>
|
495
|
+
<div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nc">.result</span> <span class="nt">li</span><span class="nc">.active</span> <span class="nt">a</span> <span class="p">{</span>
|
517
496
|
<span class="nl">color</span><span class="p">:</span> <span class="n">lightgray</span><span class="p">;</span>
|
518
497
|
<span class="nl">cursor</span><span class="p">:</span> <span class="nb">default</span><span class="p">;</span>
|
519
498
|
<span class="p">}</span>
|
520
|
-
</code></pre>
|
521
|
-
</div>
|
499
|
+
</code></pre></div></div>
|
522
500
|
<p><strong>Liquid</strong></p>
|
523
501
|
|
524
|
-
<div class="language-liquid highlighter-rouge">
|
525
|
-
<pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.docs<span class="w"> </span><span class="p">%}</span>
|
502
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.docs<span class="w"> </span><span class="p">%}</span>
|
526
503
|
<li class="<span class="p">{%</span><span class="w"> </span><span class="kr">if</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nv">page</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">%}</span>active<span class="p">{%</span><span class="w"> </span><span class="kr">endif</span><span class="w"> </span><span class="p">%}</span>">
|
527
504
|
<a href="<span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}</span>"><span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span></a>
|
528
505
|
</li>
|
529
506
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
530
|
-
</code></pre>
|
531
|
-
</div>
|
507
|
+
</code></pre></div></div>
|
532
508
|
|
533
509
|
<p><strong>Result</strong></p>
|
534
510
|
|
@@ -547,43 +523,39 @@
|
|
547
523
|
|
548
524
|
<p>In this case, assume <code class="highlighter-rouge">Deployment</code> is the current page.</p>
|
549
525
|
|
550
|
-
<p>To make sure the <code class="highlighter-rouge">item.url</code> (stored in the YAML file) matches the <code class="highlighter-rouge">page.url</code>, it can be helpful to print the <code class="highlighter-rouge"
|
526
|
+
<p>To make sure the <code class="highlighter-rouge">item.url</code> (stored in the YAML file) matches the <code class="highlighter-rouge">page.url</code>, it can be helpful to print the <code class="highlighter-rouge">{{ page.url }}</code> to the page.</p>
|
551
527
|
|
552
528
|
<h2 id="scenario-6-including-items-conditionally">Scenario 6: Including items conditionally</h2>
|
553
529
|
|
554
530
|
<p>You might want to include items conditionally in your list. For example, maybe you have multiple site outputs and only want to include the sidebar item for certain outputs. You can add properties in each list item and then use those properties to conditionally include the content.</p>
|
555
531
|
|
556
532
|
<p><strong>YAML</strong></p>
|
557
|
-
<div class="language-yaml highlighter-rouge">
|
558
|
-
<
|
559
|
-
|
560
|
-
|
561
|
-
<span class="
|
562
|
-
<span class="
|
563
|
-
|
564
|
-
|
565
|
-
<span class="
|
566
|
-
<span class="
|
567
|
-
|
568
|
-
|
569
|
-
<span class="
|
570
|
-
<span class="
|
571
|
-
|
572
|
-
</code></pre>
|
573
|
-
</div>
|
533
|
+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">docs2_list_title</span><span class="pi">:</span> <span class="s">ACME Documentation</span>
|
534
|
+
<span class="na">docs2</span><span class="pi">:</span>
|
535
|
+
|
536
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Introduction</span>
|
537
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">introduction.html</span>
|
538
|
+
<span class="na">version</span><span class="pi">:</span> <span class="s">1</span>
|
539
|
+
|
540
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Configuration</span>
|
541
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">configuration.html</span>
|
542
|
+
<span class="na">version</span><span class="pi">:</span> <span class="s">1</span>
|
543
|
+
|
544
|
+
<span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s">Deployment</span>
|
545
|
+
<span class="na">url</span><span class="pi">:</span> <span class="s">deployment.html</span>
|
546
|
+
<span class="na">version</span><span class="pi">:</span> <span class="s">2</span>
|
547
|
+
</code></pre></div></div>
|
574
548
|
|
575
549
|
<p><strong>Liquid</strong></p>
|
576
550
|
|
577
|
-
<div class="language-liquid highlighter-rouge"
|
578
|
-
<pre class="highlight"><code><ul>
|
551
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><ul>
|
579
552
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>item<span class="w"> </span>in<span class="w"> </span>site.data.samplelist.docs<span class="mi">2</span><span class="w"> </span><span class="p">%}</span>
|
580
553
|
<span class="p">{%</span><span class="w"> </span><span class="kr">if</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">version</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">%}</span>
|
581
554
|
<li><a href="<span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}</span>"><span class="p">{{</span><span class="w"> </span><span class="nv">item</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span></a></li>
|
582
555
|
<span class="p">{%</span><span class="w"> </span><span class="kr">endif</span><span class="w"> </span><span class="p">%}</span>
|
583
556
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
584
557
|
</ul>
|
585
|
-
</code></pre>
|
586
|
-
</div>
|
558
|
+
</code></pre></div></div>
|
587
559
|
|
588
560
|
<p><strong>Result</strong></p>
|
589
561
|
|
@@ -614,51 +586,48 @@
|
|
614
586
|
|
615
587
|
<p>The front matter for each page is as follows (consolidated here for brevity):</p>
|
616
588
|
|
617
|
-
<div class="language-yaml highlighter-rouge">
|
618
|
-
<
|
619
|
-
<span class="
|
620
|
-
<span class="
|
621
|
-
<span class="s">order</span><span class="pi">:</span> <span class="s">1</span>
|
589
|
+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">---</span>
|
590
|
+
<span class="na">Title</span><span class="pi">:</span> <span class="s">Sample 1</span>
|
591
|
+
<span class="na">category</span><span class="pi">:</span> <span class="s">getting-started</span>
|
592
|
+
<span class="na">order</span><span class="pi">:</span> <span class="s">1</span>
|
622
593
|
<span class="nn">---</span>
|
623
594
|
|
624
595
|
<span class="nn">---</span>
|
625
|
-
<span class="
|
626
|
-
<span class="
|
627
|
-
<span class="
|
596
|
+
<span class="na">Title</span><span class="pi">:</span> <span class="s">Sample 2</span>
|
597
|
+
<span class="na">category</span><span class="pi">:</span> <span class="s">getting-started</span>
|
598
|
+
<span class="na">order</span><span class="pi">:</span> <span class="s">2</span>
|
628
599
|
<span class="nn">---</span>
|
629
600
|
|
630
601
|
<span class="nn">---</span>
|
631
|
-
<span class="
|
632
|
-
<span class="
|
633
|
-
<span class="
|
602
|
+
<span class="na">Title</span><span class="pi">:</span> <span class="s">Topic 1</span>
|
603
|
+
<span class="na">category</span><span class="pi">:</span> <span class="s">configuration</span>
|
604
|
+
<span class="na">order</span><span class="pi">:</span> <span class="s">1</span>
|
634
605
|
<span class="nn">---</span>
|
635
606
|
|
636
607
|
<span class="nn">---</span>
|
637
|
-
<span class="
|
638
|
-
<span class="
|
639
|
-
<span class="
|
608
|
+
<span class="na">Title</span><span class="pi">:</span> <span class="s">Topic 2</span>
|
609
|
+
<span class="na">category</span><span class="pi">:</span> <span class="s">configuration</span>
|
610
|
+
<span class="na">order</span><span class="pi">:</span> <span class="s">2</span>
|
640
611
|
<span class="nn">---</span>
|
641
612
|
|
642
613
|
<span class="nn">---</span>
|
643
|
-
<span class="
|
644
|
-
<span class="
|
645
|
-
<span class="
|
614
|
+
<span class="na">Title</span><span class="pi">:</span> <span class="s">Widget 1</span>
|
615
|
+
<span class="na">category</span><span class="pi">:</span> <span class="s">deployment</span>
|
616
|
+
<span class="na">order</span><span class="pi">:</span> <span class="s">1</span>
|
646
617
|
<span class="nn">---</span>
|
647
618
|
|
648
619
|
<span class="nn">---</span>
|
649
|
-
<span class="
|
650
|
-
<span class="
|
651
|
-
<span class="
|
620
|
+
<span class="na">Title</span><span class="pi">:</span> <span class="s">Widget 2</span>
|
621
|
+
<span class="na">category</span><span class="pi">:</span> <span class="s">deployment</span>
|
622
|
+
<span class="na">order</span><span class="pi">:</span> <span class="s">2</span>
|
652
623
|
<span class="nn">---</span>
|
653
|
-
</code></pre>
|
654
|
-
</div>
|
624
|
+
</code></pre></div></div>
|
655
625
|
|
656
626
|
<p>Note that even though <code class="highlighter-rouge">category</code> is used in the doc front matter, <code class="highlighter-rouge">category</code> is not a built-in variable like it is with posts. In other words, you cannot look directly inside <code class="highlighter-rouge">category</code> with <code class="highlighter-rouge">site.docs.category</code>.</p>
|
657
627
|
|
658
628
|
<p>If you wanted to simply get all docs in the collection for a specific category, you could use a <code class="highlighter-rouge">for</code> loop with an <code class="highlighter-rouge">if</code> condition to check for a specific category:</p>
|
659
629
|
|
660
|
-
<div class="language-liquid highlighter-rouge"
|
661
|
-
<pre class="highlight"><code><h3>Getting Started</h3>
|
630
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><h3>Getting Started</h3>
|
662
631
|
<ul>
|
663
632
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>doc<span class="w"> </span>in<span class="w"> </span>site.docs<span class="w"> </span><span class="p">%}</span>
|
664
633
|
<span class="p">{%</span><span class="w"> </span><span class="kr">if</span><span class="w"> </span><span class="nv">doc</span><span class="p">.</span><span class="nv">category</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"getting-started"</span><span class="w"> </span><span class="p">%}</span>
|
@@ -666,8 +635,7 @@
|
|
666
635
|
<span class="p">{%</span><span class="w"> </span><span class="kr">endif</span><span class="w"> </span><span class="p">%}</span>
|
667
636
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
668
637
|
</ul>
|
669
|
-
</code></pre>
|
670
|
-
</div>
|
638
|
+
</code></pre></div></div>
|
671
639
|
|
672
640
|
<p>The result would be as follows:</p>
|
673
641
|
|
@@ -692,8 +660,7 @@
|
|
692
660
|
|
693
661
|
<p><strong>Liquid</strong></p>
|
694
662
|
|
695
|
-
<div class="language-liquid highlighter-rouge">
|
696
|
-
<pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">mydocs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">docs</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">group_by</span><span class="p">:</span><span class="w"> </span><span class="s1">'category'</span><span class="w"> </span><span class="p">%}</span>
|
663
|
+
<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">mydocs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">docs</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">group_by</span><span class="p">:</span><span class="w"> </span><span class="s1">'category'</span><span class="w"> </span><span class="p">%}</span>
|
697
664
|
<span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span>cat<span class="w"> </span>in<span class="w"> </span>mydocs<span class="w"> </span><span class="p">%}</span>
|
698
665
|
<h2><span class="p">{{</span><span class="w"> </span><span class="nv">cat</span><span class="p">.</span><span class="nv">name</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">capitalize</span><span class="w"> </span><span class="p">}}</span></h2>
|
699
666
|
<ul>
|
@@ -703,8 +670,7 @@
|
|
703
670
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
704
671
|
</ul>
|
705
672
|
<span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
|
706
|
-
</code></pre>
|
707
|
-
</div>
|
673
|
+
</code></pre></div></div>
|
708
674
|
|
709
675
|
<p><strong>Result</strong></p>
|
710
676
|
|
@@ -730,14 +696,12 @@
|
|
730
696
|
|
731
697
|
<p>The <code class="highlighter-rouge">group_by</code> filter groups the collection content by <code class="highlighter-rouge">category</code>. More specifically, the <code class="highlighter-rouge">group_by</code> filter converts <code class="highlighter-rouge">mydocs</code> into an array with <code class="highlighter-rouge">name</code>, <code class="highlighter-rouge">items</code>, and <code class="highlighter-rouge">size</code> properties, somewhat like this:</p>
|
732
698
|
|
733
|
-
<div class="language-yaml highlighter-rouge">
|
734
|
-
<pre class="highlight"><code><span class="pi">[</span>
|
699
|
+
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="pi">[</span>
|
735
700
|
<span class="pi">{</span><span class="s2">"</span><span class="s">name"</span><span class="pi">:</span> <span class="s2">"</span><span class="s">getting-started"</span><span class="pi">,</span> <span class="s2">"</span><span class="s">items"</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">Sample 1</span><span class="pi">,</span> <span class="nv">Sample 2</span><span class="pi">],</span><span class="s2">"</span><span class="s">size"</span><span class="pi">:</span> <span class="nv">2</span><span class="pi">},</span>
|
736
701
|
<span class="pi">{</span><span class="s2">"</span><span class="s">name"</span><span class="pi">:</span> <span class="s2">"</span><span class="s">configuration"</span><span class="pi">,</span> <span class="s2">"</span><span class="s">items"</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">Topic 1</span><span class="pi">,</span> <span class="nv">Topic 2</span><span class="pi">],</span> <span class="s2">"</span><span class="s">size"</span><span class="pi">:</span> <span class="nv">2</span><span class="pi">},</span>
|
737
702
|
<span class="pi">{</span><span class="s2">"</span><span class="s">name"</span><span class="pi">:</span> <span class="s2">"</span><span class="s">deployment"</span><span class="pi">,</span> <span class="s2">"</span><span class="s">items"</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">Widget 1</span><span class="pi">,</span> <span class="nv">Widget 2</span><span class="pi">,</span> <span class="s2">"</span><span class="s">size"</span><span class="pi">:</span> <span class="nv">2</span><span class="err">}</span>
|
738
703
|
<span class="pi">]</span>
|
739
|
-
</code></pre>
|
740
|
-
</div>
|
704
|
+
</code></pre></div></div>
|
741
705
|
|
742
706
|
<p>Using <code class="highlighter-rouge">for cat in mydocs</code>, we look through each item in the <code class="highlighter-rouge">mydocs</code> array and print the category <code class="highlighter-rouge">name</code>.</p>
|
743
707
|
|