From c2ead29ff9d376ec4c458bbcc2c281df49c5c767 Mon Sep 17 00:00:00 2001 From: Adam Hollett Date: Tue, 14 Jun 2016 11:04:31 -0400 Subject: [PATCH] Generate index pages for tags and filters --- _config.yml | 12 ++++++++++++ _includes/sidebar.html | 2 +- basics/index.html | 4 ---- basics/introduction.md | 2 ++ filters/index.html | 10 ---------- filters/index.md | 14 ++++++++++++++ tags/index.md | 16 ++++++++++++++++ 7 files changed, 45 insertions(+), 15 deletions(-) delete mode 100644 basics/index.html delete mode 100644 filters/index.html create mode 100644 filters/index.md create mode 100644 tags/index.md diff --git a/_config.yml b/_config.yml index 3aa3cb8..2c93bee 100644 --- a/_config.yml +++ b/_config.yml @@ -16,9 +16,21 @@ exclude: - node_modules keep_files: ["css"] +# Plugins +gems: + - jekyll-redirect-from + # Front matter defaults defaults: - scope: path: "" # an empty string here means all files in the project values: layout: default + - scope: + path: "filters" + values: + type: filter + - scope: + path: "tags" + values: + type: tag diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 0b91eb2..dfe0a12 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -9,7 +9,7 @@ {% endfor %} diff --git a/basics/index.html b/basics/index.html deleted file mode 100644 index 1ab753a..0000000 --- a/basics/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: default ---- - diff --git a/basics/introduction.md b/basics/introduction.md index 940952a..ed8a7e9 100644 --- a/basics/introduction.md +++ b/basics/introduction.md @@ -1,5 +1,7 @@ --- title: Introduction +redirect_from: + - /basics/ --- Liquid code can be categorized into [**objects**](#objects), [**tags**](#tags), and [**filters**](#filters). diff --git a/filters/index.html b/filters/index.html deleted file mode 100644 index 43d6324..0000000 --- a/filters/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: default ---- - -{% for doc in site.collections["filters"].docs %} -

{{ doc.title }}

-
- {{ doc.content }} -
-{% endfor %} diff --git a/filters/index.md b/filters/index.md new file mode 100644 index 0000000..7cd78ce --- /dev/null +++ b/filters/index.md @@ -0,0 +1,14 @@ +--- +title: Filters +type: index +--- + +**Filters** change the output of a Liquid object. You can append one or more filters to an object by separating the filter and its parameters by a pipe symbol `|`. + +{% assign filter_pages = site.pages | where: 'type', 'filter' %} + +{% for item in filter_pages %} +## [{{ item.title }}]({{ item.url }}) + +{{ item.content }} +{% endfor %} diff --git a/tags/index.md b/tags/index.md new file mode 100644 index 0000000..4684acf --- /dev/null +++ b/tags/index.md @@ -0,0 +1,16 @@ +--- +title: Tags +type: index +--- + +**Tags** create the logic and control flow for templates. They are denoted by curly braces and percent signs: {% raw %}`{%` and `%}`{% endraw %}. + +The markup used in tags does not produce any visible text. This means that you can assign variables and create conditions and loops without showing any of the Liquid logic on the page. + +{% assign tag_pages = site.pages | where: 'type', 'tag' %} + +{% for item in tag_pages %} +## [{{ item.title }}]({{ item.url }}) + +{{ item.content }} +{% endfor %}