| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
See also contributing/liquid-helpers.md
This directory contains custom Liquid tags for outputting dynamic content. These custom tags exist for a few reasons:
Tags can be used in:
Tags always expect a single argument, a language agnostic href:
{% link_with_intro /getting-started-with-github-desktop %}where the reference must be in the parent file, content/desktop/index.md, as it points to content/desktop/getting-started-with-github-desktop.
The href can also be an absolute path:
{% link_with_intro /desktop/getting-started-with-github-desktop %}where the reference can be in any file.
Note: Every href, whether relative or absolute, must start with a slash (/). Do not include content in the href.
The tag above will output this HTML for English pages:
<a class="link-with-intro Bump-link--hover no-underline" href="/en/desktop/getting-started-with-github-desktop">
<h4 class="link-with-intro-title">Getting started with GitHub Desktop<span class="Bump-link-symbol">→</span></h4>
</a>
<p class="link-with-intro-intro">Get GitHub Desktop set up to manage your project work. Authenticate to GitHub.com or GitHub Enterprise Server, keep the app up-to-date, and review your preferred settings.</p>and this HTML for Spanish pages:
<a class="link-with-intro Bump-link--hover no-underline" href="/es/desktop/getting-started-with-github-desktop">
<h4 class="link-with-intro-title">Comenzar con GitHub Desktop<span class="Bump-link-symbol">→</span></h4></a>
<p class="link-with-intro-intro">Configura GitHub Desktop para administrar tu proyecto de trabajo. Autentícate en GitHub.com o en el Servidor de GitHub Enterprise, mantén la app actualizada y revisa tu configuración preferida.</p>Note that link tags will only render links that are available in the current page version (i.e. GitHub.com vs Enterprise), so it's not necessary to add Liquid conditionals around them.
| Markup | Renders |
|---|---|
| {% link /href %} | The linked page's title, with no special styling. |
| {% link_with_intro /href %} | The linked page's title and intro. |
| {% homepage_link_with_intro /href %} | The linked page's title and intro, with homepage-specific styling. |
| {% link_in_list /href %} | The linked page's title in a list item. |
| {% topic_link_in_list /href %} | The linked map topic's title in a list item (used in category TOCs). |
| {% indented_data_reference site.data.foo.bar spaces=NUMBER %} | The data reference with the specified number of spaces prepended to each line. |
Each custom tag has the following:
The class and the template should have corresponding names, like lib/liquid-tags/my-tag.js and includes/liquid-tags/my-tag.html
You must also register the new tag in lib/render-content.js with a line like this:
renderContent.liquid.registerTag('my_tag', require('./liquid-tags/my-tag'))
| Back | FazBrowse Home | New Git URL |