site/docs/templates/index.html in jekyll-docs-3.9.0 vs site/docs/templates/index.html in jekyll-docs-4.0.0
- old
+ new
@@ -1,1234 +1,11 @@
-<!DOCTYPE HTML>
+<!DOCTYPE html>
<html lang="en-US">
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="generator" content="Jekyll v3.9.0">
- <link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites" />
- <link rel="alternate" type="application/atom+xml" title="Recent commits to Jekyll’s master branch" href="https://github.com/jekyll/jekyll/commits/master.atom">
- <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
- <link rel="stylesheet" href="/css/screen.css">
- <link rel="icon" type="image/x-icon" href="/favicon.ico">
- <!-- Begin Jekyll SEO tag v2.6.1 -->
-<title>Templates | Jekyll • Simple, blog-aware, static sites</title>
-<meta name="generator" content="Jekyll v3.9.0" />
-<meta property="og:title" content="Templates" />
-<meta property="og:locale" content="en_US" />
-<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." />
-<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." />
-<link rel="canonical" href="https://jekyllrb.com/docs/templates/" />
-<meta property="og:url" content="https://jekyllrb.com/docs/templates/" />
-<meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites" />
-<meta property="og:type" content="article" />
-<meta property="article:published_time" content="2020-08-05T11:55:36-07:00" />
-<meta name="twitter:card" content="summary" />
-<meta property="twitter:title" content="Templates" />
-<meta name="twitter:site" content="@jekyllrb" />
-<meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY" />
-<script type="application/ld+json">
-{"url":"https://jekyllrb.com/docs/templates/","headline":"Templates","dateModified":"2020-08-05T11:55:36-07:00","datePublished":"2020-08-05T11:55:36-07:00","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://jekyllrb.com/img/logo-2x.png"}},"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.","mainEntityOfPage":{"@type":"WebPage","@id":"https://jekyllrb.com/docs/templates/"},"@type":"BlogPosting","@context":"https://schema.org"}</script>
-<!-- End Jekyll SEO tag -->
-
- <!--[if lt IE 9]>
- <script src="/js/html5shiv.min.js"></script>
- <script src="/js/respond.min.js"></script>
- <![endif]-->
-</head>
-
-
-<body class="wrap">
- <header>
- <div class="flexbox">
- <div class="center-on-mobiles">
- <h1>
- <a href="/" class="logo">
- <span class="sr-only">Jekyll</span>
- <img src="/img/logo-2x.png" width="140" height="65" alt="Jekyll Logo">
- </a>
- </h1>
- </div>
- <nav class="main-nav hide-on-mobiles">
- <ul>
- <li class="">
- <a href="/">Home</a>
- </li>
- <li class="current">
- <a href="/docs/home/">Docs</a>
- </li>
- <li class="">
- <a href="/news/">News</a>
- </li>
- <li class="">
- <a href="/help/">Help</a>
- </li>
-</ul>
-
- </nav>
- <div class="search hide-on-mobiles">
- <input type="text" id="docsearch-input" placeholder="Search the docs…">
-
- </div>
- <div class="meta hide-on-mobiles">
- <ul>
- <li>
- <a href="https://github.com/jekyll/jekyll/releases/tag/v3.9.0">v3.9.0</a>
- </li>
- <li>
- <a href="https://github.com/jekyll/jekyll">GitHub</a>
- </li>
- </ul>
- </div>
- </div>
- <nav class="mobile-nav show-on-mobiles">
- <ul>
- <li class="">
- <a href="/">Home</a>
- </li>
- <li class="current">
- <a href="/docs/home/">Docs</a>
- </li>
- <li class="">
- <a href="/news/">News</a>
- </li>
- <li class="">
- <a href="/help/">Help</a>
- </li>
- <li>
- <a href="https://github.com/jekyll/jekyll">GitHub</a>
- </li>
-</ul>
-
- </nav>
-</header>
-
-
- <section class="docs">
- <div class="grid">
-
- <div class="docs-nav-mobile unit whole show-on-mobiles">
- <select onchange="if (this.value) window.location.href=this.value">
- <option value="">Navigate the docs…</option>
-
- <optgroup label="Getting Started">
-
-
-
- <option value="/docs/home/">Welcome</option>
-
-
-
- <option value="/docs/quickstart/">Quick-start guide</option>
-
-
-
- <option value="/docs/installation/">Installation</option>
-
-
-
- <option value="/docs/windows/">Jekyll on Windows</option>
-
-
-
- <option value="/docs/usage/">Basic Usage</option>
-
-
-
- <option value="/docs/structure/">Directory structure</option>
-
-
-
- <option value="/docs/configuration/">Configuration</option>
-
-
- </optgroup>
-
- <optgroup label="Your Content">
-
-
-
- <option value="/docs/frontmatter/">Front Matter</option>
-
-
-
- <option value="/docs/posts/">Writing posts</option>
-
-
-
- <option value="/docs/drafts/">Working with drafts</option>
-
-
-
- <option value="/docs/pages/">Creating pages</option>
-
-
-
- <option value="/docs/static-files/">Static Files</option>
-
-
-
- <option value="/docs/variables/">Variables</option>
-
-
-
- <option value="/docs/collections/">Collections</option>
-
-
-
- <option value="/docs/datafiles/">Data Files</option>
-
-
-
- <option value="/docs/assets/">Assets</option>
-
-
-
- <option value="/docs/migrations/">Blog migrations</option>
-
-
- </optgroup>
-
- <optgroup label="Customization">
-
-
-
- <option value="/docs/templates/">Templates</option>
-
-
-
- <option value="/docs/includes/">Includes</option>
-
-
-
- <option value="/docs/permalinks/">Permalinks</option>
-
-
-
- <option value="/docs/pagination/">Pagination</option>
-
-
-
- <option value="/docs/plugins/">Plugins</option>
-
-
-
- <option value="/docs/themes/">Themes</option>
-
-
-
- <option value="/docs/extras/">Extras</option>
-
-
- </optgroup>
-
- <optgroup label="Deployment">
-
-
-
- <option value="/docs/github-pages/">GitHub Pages</option>
-
-
-
- <option value="/docs/deployment-methods/">Deployment methods</option>
-
-
-
- <option value="/docs/continuous-integration/">Continuous Integration</option>
-
-
- </optgroup>
-
- <optgroup label="Miscellaneous">
-
-
-
- <option value="/docs/troubleshooting/">Troubleshooting</option>
-
-
-
- <option value="/docs/sites/">Sites using Jekyll</option>
-
-
-
- <option value="/docs/resources/">Resources</option>
-
-
-
- <option value="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</option>
-
-
-
- <option value="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</option>
-
-
- </optgroup>
-
- <optgroup label="Meta">
-
-
-
- <option value="/docs/contributing/">Contributing</option>
-
-
-
- <option value="/docs/maintaining/">Maintaining Jekyll</option>
-
-
-
- <option value="/docs/conduct/">Code of Conduct</option>
-
-
-
- <option value="/docs/history/">History</option>
-
-
- </optgroup>
-
- </select>
-</div>
-
-
- <div class="unit four-fifths">
- <article>
- <div class="improve right hide-on-mobiles">
- <a href="https://github.com/jekyll/jekyll/edit/master/docs/_docs/templates.md"><i class="fa fa-pencil"></i> Improve this page</a>
- </div>
- <h1>Templates</h1>
- <p>Jekyll uses the <a href="https://shopify.github.io/liquid/">Liquid</a> templating language to
-process templates. All of the standard Liquid <a href="https://shopify.github.io/liquid/tags/control-flow/">tags</a> and
-<a href="https://shopify.github.io/liquid/filters/abs/">filters</a> 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.</p>
-
-<h2 id="filters">Filters</h2>
-
-<div class="mobile-side-scroller">
-<table>
- <thead>
- <tr>
- <th>Description</th>
- <th><span class="filter">Filter</span> and <span class="output">Output</span></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p class="name"><strong>Relative URL</strong></p>
- <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>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ "/assets/style.css" | relative_url }}</code>
- </p>
- <p>
- <code class="output">/my-baseurl/assets/style.css</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Absolute URL</strong></p>
- <p>Prepend the <code>url</code> and <code>baseurl</code> value to the input.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ "/assets/style.css" | absolute_url }}</code>
- </p>
- <p>
- <code class="output">http://example.com/my-baseurl/assets/style.css</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Date to XML Schema</strong></p>
- <p>Convert a Date into XML Schema (ISO 8601) format.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.time | date_to_xmlschema }}</code>
- </p>
- <p>
- <code class="output">2008-11-07T13:07:54-08:00</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Date to RFC-822 Format</strong></p>
- <p>Convert a Date into the RFC-822 format used for RSS feeds.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.time | date_to_rfc822 }}</code>
- </p>
- <p>
- <code class="output">Mon, 07 Nov 2008 13:07:54 -0800</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Date to String</strong></p>
- <p>Convert a date to short format.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.time | date_to_string }}</code>
- </p>
- <p>
- <code class="output">07 Nov 2008</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Date to String in ordinal US style</strong></p>
- <p>Format a date to ordinal, US, short format.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.time | date_to_string: "ordinal", "US" }}</code>
- </p>
- <p>
- <code class="output">Nov 7th, 2008</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Date to Long String</strong></p>
- <p>Format a date to long format.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.time | date_to_long_string }}</code>
- </p>
- <p>
- <code class="output">07 November 2008</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Date to Long String in ordinal UK style</strong></p>
- <p>Format a date to ordinal, UK, long format.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.time | date_to_long_string: "ordinal" }}</code>
- </p>
- <p>
- <code class="output">7th November 2008</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Where</strong></p>
- <p>Select all the objects in an array where the key has the given value.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.members | where:"graduation_year","2014" }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Where Expression</strong></p>
- <p>Select all the objects in an array where the expression is true. Jekyll v3.2.0 & later.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.members | where_exp:"item",
-"item.graduation_year == 2014" }}</code>
- <code class="filter">{{ site.members | where_exp:"item",
-"item.graduation_year < 2014" }}</code>
- <code class="filter">{{ site.members | where_exp:"item",
-"item.projects contains 'foo'" }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Group By</strong></p>
- <p>Group an array's items by a given property.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.members | group_by:"graduation_year" }}</code>
- </p>
- <p>
- <code class="output">[{"name"=>"2013", "items"=>[...]},
-{"name"=>"2014", "items"=>[...]}]</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Group By Expression</strong></p>
- <p>Group an array's items using a Liquid expression.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.members | group_by_exp:"item",
-"item.graduation_year | truncate: 3, \"\"" }}</code>
- </p>
- <p>
- <code class="output">[{"name"=>"201...", "items"=>[...]},
-{"name"=>"200...", "items"=>[...]}]</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>XML Escape</strong></p>
- <p>Escape some text for use in XML.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ page.content | xml_escape }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>CGI Escape</strong></p>
- <p>
- CGI escape a string for use in a URL. Replaces any special characters
- with appropriate <code>%XX</code> replacements. CGI escape normally replaces a space with a plus <code>+</code> sign.
- </p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ "foo, bar; baz?" | cgi_escape }}</code>
- </p>
- <p>
- <code class="output">foo%2C+bar%3B+baz%3F</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>URI Escape</strong></p>
- <p>
- 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.
- </p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ "http://foo.com/?q=foo, \bar?" | uri_escape }}</code>
- </p>
- <p>
- <code class="output">http://foo.com/?q=foo,%20%5Cbar?</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Number of Words</strong></p>
- <p>Count the number of words in some text.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ page.content | number_of_words }}</code>
- </p>
- <p>
- <code class="output">1337</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Array to Sentence</strong></p>
- <p>Convert an array into a sentence. Useful for listing tags. Optional argument for connector.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ page.tags | array_to_sentence_string }}</code>
- </p>
- <p>
- <code class="output">foo, bar, and baz</code>
- </p>
- <p>
- <code class="filter">{{ page.tags | array_to_sentence_string: 'or' }}</code>
- </p>
- <p>
- <code class="output">foo, bar, or baz</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Markdownify</strong></p>
- <p>Convert a Markdown-formatted string into HTML.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ page.excerpt | markdownify }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Smartify</strong></p>
- <p>Convert "quotes" into “smart quotes.”</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ page.title | smartify }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Converting Sass/SCSS</strong></p>
- <p>Convert a Sass- or SCSS-formatted string into CSS.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ some_scss | scssify }}</code>
- <code class="filter">{{ some_sass | sassify }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Slugify</strong></p>
- <p>Convert a string into a lowercase URL "slug". See below for options.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ "The _config.yml file" | slugify }}</code>
- </p>
- <p>
- <code class="output">the-config-yml-file</code>
- </p>
- <p>
- <code class="filter">{{ "The _config.yml file" | slugify: 'pretty' }}</code>
- </p>
- <p>
- <code class="output">the-_config.yml-file</code>
- </p>
- <p>
- <code class="filter">{{ "The _cönfig.yml file" | slugify: 'ascii' }}</code>
- </p>
- <p>
- <code class="output">the-c-nfig-yml-file</code>
- </p>
- <p>
- <code class="filter">{{ "The cönfig.yml file" | slugify: 'latin' }}</code>
- </p>
- <p>
- <code class="output">the-config-yml-file</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Data To JSON</strong></p>
- <p>Convert Hash or Array to JSON.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.data.projects | jsonify }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Normalize Whitespace</strong></p>
- <p>Replace any occurrence of whitespace with a single space.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ "a \n b" | normalize_whitespace }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Sort</strong></p>
- <p>Sort an array. Optional arguments for hashes: 1. property name 2. nils order (<em>first</em> or <em>last</em>).</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ page.tags | sort }}</code>
- </p>
- <p>
- <code class="filter">{{ site.posts | sort: 'author' }}</code>
- </p>
- <p>
- <code class="filter">{{ site.pages | sort: 'title', 'last' }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Sample</strong></p>
- <p>Pick a random value from an array. Optional: pick multiple values.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ site.pages | sample }}</code>
- </p>
- <p>
- <code class="filter">{{ site.pages | sample:2 }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>To Integer</strong></p>
- <p>Convert a string or boolean to integer.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ some_var | to_integer }}</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Array Filters</strong></p>
- <p>Push, pop, shift, and unshift elements from an Array.</p>
- <p>These are <strong>NON-DESTRUCTIVE</strong>, i.e. they do not mutate the array, but rather make a copy and mutate that.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ page.tags | push: 'Spokane' }}</code>
- </p>
- <p>
- <code class="output">['Seattle', 'Tacoma', 'Spokane']</code>
- </p>
- <p>
- <code class="filter">{{ page.tags | pop }}</code>
- </p>
- <p>
- <code class="output">['Seattle']</code>
- </p>
- <p>
- <code class="filter">{{ page.tags | shift }}</code>
- </p>
- <p>
- <code class="output">['Tacoma']</code>
- </p>
- <p>
- <code class="filter">{{ page.tags | unshift: "Olympia" }}</code>
- </p>
- <p>
- <code class="output">['Olympia', 'Seattle', 'Tacoma']</code>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p class="name"><strong>Inspect</strong></p>
- <p>Convert an object into its String representation for debugging.</p>
- </td>
- <td class="align-center">
- <p>
- <code class="filter">{{ some_var | inspect }}</code>
- </p>
- </td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h3 id="options-for-the-slugify-filter">Options for the <code class="language-plaintext highlighter-rouge">slugify</code> filter</h3>
-
-<p>The <code class="language-plaintext highlighter-rouge">slugify</code> filter accepts an option, each specifying what to filter.
-The default is <code class="language-plaintext highlighter-rouge">default</code>. They are as follows (with what they filter):</p>
-
-<ul>
- <li><code class="language-plaintext highlighter-rouge">none</code>: no characters</li>
- <li><code class="language-plaintext highlighter-rouge">raw</code>: spaces</li>
- <li><code class="language-plaintext highlighter-rouge">default</code>: spaces and non-alphanumeric characters</li>
- <li><code class="language-plaintext highlighter-rouge">pretty</code>: spaces and non-alphanumeric characters except for <code class="language-plaintext highlighter-rouge">._~!$&'()+,;=@</code></li>
- <li><code class="language-plaintext highlighter-rouge">ascii</code>: spaces, non-alphanumeric, and non-ASCII characters</li>
- <li><code class="language-plaintext highlighter-rouge">latin</code>: like <code class="language-plaintext highlighter-rouge">default</code>, except Latin characters are first transliterated (e.g. <code class="language-plaintext highlighter-rouge">àèïòü</code> to <code class="language-plaintext highlighter-rouge">aeiou</code>)<span class="version-badge" title="This feature is available starting version 3.7.0">3.7.0</span>
- <h2 id="tags">Tags</h2>
- </li>
- <li><a href="#includes">Includes</a></li>
- <li><a href="#code-snippet-highlighting">Code snippet highlighting</a></li>
- <li><a href="#links">Linking to pages, collections and posts (the new and improved way)</a></li>
- <li><a href="#linking-to-posts">Linking to posts (the old way)</a></li>
-</ul>
-
-<h3 id="includes">Includes</h3>
-
-<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="language-plaintext highlighter-rouge">include</code> tag:</p>
-
-<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>footer.html<span class="w"> </span><span class="p">%}</span>
-</code></pre></div></div>
-
-<p>Jekyll expects all <em>include files</em> to be placed in an <code class="language-plaintext highlighter-rouge">_includes</code> directory at the root of your source directory. In the above example, this will embed the contents of <code class="language-plaintext highlighter-rouge">_includes/footer.html</code> into the calling file.</p>
-
-<p>For more advanced information on using includes, see <a href="../includes">Includes</a>.</p>
-
-<h3 id="code-snippet-highlighting">Code snippet highlighting</h3>
-
-<p>Jekyll has built in support for syntax highlighting of over 60 languages
-thanks to <a href="http://rouge.jneen.net">Rouge</a>. Rouge is the default highlighter
-in Jekyll 3 and above. To use it in Jekyll 2, set <code class="language-plaintext highlighter-rouge">highlighter</code> to <code class="language-plaintext highlighter-rouge">rouge</code>
-and ensure the <code class="language-plaintext highlighter-rouge">rouge</code> gem is installed properly.</p>
-
-<p>Alternatively, you can use <a href="http://pygments.org">Pygments</a> to highlight
-your code snippets. To use Pygments, you must have Python installed on your
-system, have the <code class="language-plaintext highlighter-rouge">pygments.rb</code> gem installed and set <code class="language-plaintext highlighter-rouge">highlighter</code> to
-<code class="language-plaintext highlighter-rouge">pygments</code> in your site’s configuration file. Pygments supports <a href="http://pygments.org/languages/">over 100
-languages</a></p>
-
-<p>To render a code block with syntax highlighting, surround your code as follows:</p>
-
-<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><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>
-def foo
- puts 'foo'
-end
-<span class="p">{%</span><span class="w"> </span><span class="nt">endhighlight</span><span class="w"> </span><span class="p">%}</span>
-</code></pre></div></div>
-
-<p>The argument to the <code class="language-plaintext highlighter-rouge">highlight</code> tag (<code class="language-plaintext highlighter-rouge">ruby</code> in the example above) is the
-language identifier. To find the appropriate identifier to use for the language
-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
-wiki</a>
-or the <a href="http://pygments.org/docs/lexers/">Pygments’ Lexers page</a>.</p>
-
-<div class="note info">
- <h5>Jekyll processes all Liquid filters in code blocks</h5>
- <p>If you are using a language that contains curly braces, you
- will likely need to place <code>{% raw %}</code> and
- <code>{% endraw %}</code> tags around your code.</p>
-</div>
-
-<h4 id="line-numbers">Line numbers</h4>
-
-<p>There is a second argument to <code class="language-plaintext highlighter-rouge">highlight</code> called <code class="language-plaintext highlighter-rouge">linenos</code> that is optional.
-Including the <code class="language-plaintext highlighter-rouge">linenos</code> argument will force the highlighted code to include line
-numbers. For instance, the following code block would include line numbers next
-to each line:</p>
-
-<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><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>
-def foo
- puts 'foo'
-end
-<span class="p">{%</span><span class="w"> </span><span class="nt">endhighlight</span><span class="w"> </span><span class="p">%}</span>
-</code></pre></div></div>
-
-<h4 id="stylesheets-for-syntax-highlighting">Stylesheets for syntax highlighting</h4>
-
-<p>In order for the highlighting to show up, you’ll need to include a highlighting
-stylesheet. For an example stylesheet you can look at
-<a href="https://github.com/mojombo/tpw/tree/master/css/syntax.css">syntax.css</a>. These
-are the same styles as used by GitHub and you are free to use them for your own
-site. If you use <code class="language-plaintext highlighter-rouge">linenos</code>, you might want to include an additional CSS class
-definition for the <code class="language-plaintext highlighter-rouge">.lineno</code> class in <code class="language-plaintext highlighter-rouge">syntax.css</code> to distinguish the line
-numbers from the highlighted code.</p>
-
-<h2 id="links">Links</h2>
-
-<h3 id="link">Linking to pages</h3>
-
-<p>To link to a post, a page, collection item, or file, the <code class="language-plaintext highlighter-rouge">link</code> tag will generate the correct permalink URL for the path you specify. For example, if you use the <code class="language-plaintext highlighter-rouge">link</code> tag to link to <code class="language-plaintext 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="language-plaintext highlighter-rouge">link</code> tag will always be valid.</p>
-
-<p>You must include the file’s original extension when using the <code class="language-plaintext highlighter-rouge">link</code> tag. Here are some examples:</p>
-
-<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><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>
-<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/2016-07-26-name-of-post.md<span class="w"> </span><span class="p">%}</span>
-<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>
-<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>
-</code></pre></div></div>
-
-<p>You can also use the <code class="language-plaintext highlighter-rouge">link</code> tag to create a link in Markdown as follows:</p>
-
-<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[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>)
-[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/2016-07-26-name-of-post.md<span class="w"> </span><span class="p">%}</span>)
-[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>)
-[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>)
-</code></pre></div></div>
-
-<p>(Including <code class="language-plaintext highlighter-rouge">{{ site.baseurl }}</code> is optional — it depends on whether you want to preface the page URL with the <code class="language-plaintext highlighter-rouge">baseurl</code> value.)</p>
-
-<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>
-
-<p>For example, suppose you’re creating a link in <code class="language-plaintext highlighter-rouge">page_a.md</code> (stored in <code class="language-plaintext highlighter-rouge">pages/folder1/folder2</code>) to <code class="language-plaintext highlighter-rouge">page_b.md</code> (stored in <code class="language-plaintext highlighter-rouge">pages/folder1</code>). Your path in the link would not be <code class="language-plaintext highlighter-rouge">../page_b.html</code>. Instead, it would be <code class="language-plaintext highlighter-rouge">/pages/folder1/page_b.md</code>.</p>
-
-<p>If you’re unsure of the path, add <code class="language-plaintext highlighter-rouge">{{ page.path }}</code> to the page and it will display the path.</p>
-
-<p>One major benefit of using the <code class="language-plaintext highlighter-rouge">link</code> or <code class="language-plaintext 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>
-
-<p>Note you cannot add filters to <code class="language-plaintext highlighter-rouge">link</code> tags. For example, you cannot append a string using Liquid filters, such as <code class="language-plaintext 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>
-
-<h3 id="linking-to-posts">Linking to posts</h3>
-
-<p>If you want to include a link to a post on your site, the <code class="language-plaintext highlighter-rouge">post_url</code> tag will generate the correct permalink URL for the post you specify.</p>
-
-<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><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="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">21</span><span class="o">-</span>name-of-post<span class="w"> </span><span class="p">%}</span>
-</code></pre></div></div>
-
-<p>If you organize your posts in subdirectories, you need to include subdirectory path to the post:</p>
-
-<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><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/2010-07-21-name-of-post<span class="w"> </span><span class="p">%}</span>
-</code></pre></div></div>
-
-<p>There is no need to include the file extension when using the <code class="language-plaintext highlighter-rouge">post_url</code> tag.</p>
-
-<p>You can also use this tag to create a link to a post in Markdown as follows:</p>
-
-<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[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="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">21</span><span class="o">-</span>name-of-post<span class="w"> </span><span class="p">%}</span>)
-</code></pre></div></div>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="section-nav">
- <div class="left align-right">
-
-
-
- <a href="/docs/migrations/" class="prev">Back</a>
-
- </div>
- <div class="right align-left">
-
-
-
- <a href="/docs/includes/" class="next">Next</a>
-
- </div>
- </div>
- <div class="clear"></div>
-
- </article>
- </div>
-
- <div class="unit one-fifth hide-on-mobiles">
- <aside>
-
- <h4>Getting Started</h4>
- <ul>
-
-
-
- <li class=""><a href="/docs/home/">Welcome</a></li>
-
-
-
- <li class=""><a href="/docs/quickstart/">Quick-start guide</a></li>
-
-
-
- <li class=""><a href="/docs/installation/">Installation</a></li>
-
-
-
- <li class=""><a href="/docs/windows/">Jekyll on Windows</a></li>
-
-
-
- <li class=""><a href="/docs/usage/">Basic Usage</a></li>
-
-
-
- <li class=""><a href="/docs/structure/">Directory structure</a></li>
-
-
-
- <li class=""><a href="/docs/configuration/">Configuration</a></li>
-
-</ul>
-
-
- <h4>Your Content</h4>
- <ul>
-
-
-
- <li class=""><a href="/docs/frontmatter/">Front Matter</a></li>
-
-
-
- <li class=""><a href="/docs/posts/">Writing posts</a></li>
-
-
-
- <li class=""><a href="/docs/drafts/">Working with drafts</a></li>
-
-
-
- <li class=""><a href="/docs/pages/">Creating pages</a></li>
-
-
-
- <li class=""><a href="/docs/static-files/">Static Files</a></li>
-
-
-
- <li class=""><a href="/docs/variables/">Variables</a></li>
-
-
-
- <li class=""><a href="/docs/collections/">Collections</a></li>
-
-
-
- <li class=""><a href="/docs/datafiles/">Data Files</a></li>
-
-
-
- <li class=""><a href="/docs/assets/">Assets</a></li>
-
-
-
- <li class=""><a href="/docs/migrations/">Blog migrations</a></li>
-
-</ul>
-
-
- <h4>Customization</h4>
- <ul>
-
-
-
- <li class="current"><a href="/docs/templates/">Templates</a></li>
-
-
-
- <li class=""><a href="/docs/includes/">Includes</a></li>
-
-
-
- <li class=""><a href="/docs/permalinks/">Permalinks</a></li>
-
-
-
- <li class=""><a href="/docs/pagination/">Pagination</a></li>
-
-
-
- <li class=""><a href="/docs/plugins/">Plugins</a></li>
-
-
-
- <li class=""><a href="/docs/themes/">Themes</a></li>
-
-
-
- <li class=""><a href="/docs/extras/">Extras</a></li>
-
-</ul>
-
-
- <h4>Deployment</h4>
- <ul>
-
-
-
- <li class=""><a href="/docs/github-pages/">GitHub Pages</a></li>
-
-
-
- <li class=""><a href="/docs/deployment-methods/">Deployment methods</a></li>
-
-
-
- <li class=""><a href="/docs/continuous-integration/">Continuous Integration</a></li>
-
-</ul>
-
-
- <h4>Miscellaneous</h4>
- <ul>
-
-
-
- <li class=""><a href="/docs/troubleshooting/">Troubleshooting</a></li>
-
-
-
- <li class=""><a href="/docs/sites/">Sites using Jekyll</a></li>
-
-
-
- <li class=""><a href="/docs/resources/">Resources</a></li>
-
-
-
- <li class=""><a href="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</a></li>
-
-
-
- <li class=""><a href="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</a></li>
-
-</ul>
-
-
- <h4>Meta</h4>
- <ul>
-
-
-
- <li class=""><a href="/docs/contributing/">Contributing</a></li>
-
-
-
- <li class=""><a href="/docs/maintaining/">Maintaining Jekyll</a></li>
-
-
-
- <li class=""><a href="/docs/conduct/">Code of Conduct</a></li>
-
-
-
- <li class=""><a href="/docs/history/">History</a></li>
-
-</ul>
-
-
- </aside>
-</div>
-
-
- <div class="clear"></div>
-
- </div>
- </section>
-
-
- <footer>
- <div class="grid">
- <div class="unit one-third center-on-mobiles">
- <p>The contents of this website are <br />© 2020 under the terms of the <a href="https://github.com/jekyll/jekyll/blob/master/LICENSE">MIT License</a>.</p>
- </div>
- <div class="unit two-thirds align-right center-on-mobiles">
- <p>
- Proudly hosted by
- <a href="https://github.com">
- <img src="/img/footer-logo.png" width="100" height="30" alt="GitHub • Social coding">
- </a>
- </p>
- </div>
- </div>
-</footer>
-
- <script>
- var anchorForId = function (id) {
- var anchor = document.createElement("a");
- anchor.className = "header-link";
- anchor.href = "#" + id;
- anchor.innerHTML = "<span class=\"sr-only\">Permalink</span><i class=\"fa fa-link\"></i>";
- anchor.title = "Permalink";
- return anchor;
- };
-
- var linkifyAnchors = function (level, containingElement) {
- var headers = containingElement.getElementsByTagName("h" + level);
- for (var h = 0; h < headers.length; h++) {
- var header = headers[h];
-
- if (typeof header.id !== "undefined" && header.id !== "") {
- header.appendChild(anchorForId(header.id));
- }
- }
- };
-
- document.onreadystatechange = function () {
- if (this.readyState === "complete") {
- var contentBlock = document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0];
- if (!contentBlock) {
- return;
- }
- for (var level = 1; level <= 6; level++) {
- linkifyAnchors(level, contentBlock);
- }
- }
- };
-</script>
-
-
- <!-- Google Analytics (https://www.google.com/analytics) -->
- <script>
- !function(j,e,k,y,l,L){j.GoogleAnalyticsObject=y,j[y]||(j[y]=function(){
- (j[y].q=j[y].q||[]).push(arguments)}),j[y].l=+new Date,l=e.createElement(k),
- L=e.getElementsByTagName(k)[0],l.src='https://www.google-analytics.com/analytics.js',
- L.parentNode.insertBefore(l,L)}(window,document,'script','ga');
-
- ga('create', 'UA-50755011-1', 'jekyllrb.com');
- ga('send', 'pageview');
-
- </script>
-
-
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
-<script type="text/javascript"> docsearch({
-apiKey: '50fe39c839958dfad797000f33e2ec17',
-indexName: 'jekyllrb',
-inputSelector: '#docsearch-input',
-enhancedSearchInput: true,
-debug: false // Set debug to true if you want to inspect the dropdown
-});
-</script>
-
-</body>
+ <meta charset="utf-8">
+ <title>Redirecting…</title>
+ <link rel="canonical" href="https://jekyllrb.com/docs/liquid/">
+ <script>location="https://jekyllrb.com/docs/liquid/"</script>
+ <meta http-equiv="refresh" content="0; url=https://jekyllrb.com/docs/liquid/">
+ <meta name="robots" content="noindex">
+ <h1>Redirecting…</h1>
+ <a href="https://jekyllrb.com/docs/liquid/">Click here if you are not redirected.</a>
</html>