Uncomplicate the sidebar

This commit is contained in:
Adam Hollett
2016-03-15 19:36:23 -04:00
committed by Tetsuro
parent 2790e8c339
commit 4d1378b4b3
41 changed files with 49 additions and 55 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<header class="home--banner"> <header class="home--banner">
<h1>Liquid</h1> <h1>Liquid</h1>
<p>Ruby library for rendering safe templates which cannot affect the security of the server they are rendered on.</p> <p>Safe, customer facing template language for flexible web apps.</p>
<p class="btn-row"> <p class="btn-row">
<a href="https://github.com/Shopify/liquid/archive/master.zip" target="_blank" class="btn"><i class="icon fa fa-2x fa-arrow-circle-down"></i>Download</a> <a href="https://github.com/Shopify/liquid/archive/master.zip" target="_blank" class="btn"><i class="icon fa fa-2x fa-arrow-circle-down"></i>Download</a>
<a href="https://github.com/Shopify/liquid" target="_blank" class="btn"><i class="icon fa fa-2x fa-github"></i>View on Github</a> <a href="https://github.com/Shopify/liquid" target="_blank" class="btn"><i class="icon fa fa-2x fa-github"></i>View on Github</a>
+7 -17
View File
@@ -2,25 +2,15 @@
<div class="sidebar--logo"> <div class="sidebar--logo">
<a href="/">Liquid</a> <a href="/">Liquid</a>
</div> </div>
<nav class="sidebar--nav"> <nav class="sidebar--nav"> {% assign sections = "basics, tags, filters" | split: ", " %}
{% capture folders %}basics,tags,filters{% endcapture %}
{% assign sections = folders | split: "," %}
{% for section in sections %} {% for section in sections %}
<ul class="section"> <h3 class="section__header">{{ section | capitalize }}</h3>
<li>
<h3 class="section__header">{{ section | capitalize }}</h3> <ul class="section__links">
<ul class="section__links"> {% for page in site.pages %}{% if page.url contains section/ %}{% unless page.path contains "index" %}
{% for page in site.pages %} <li><a href="{{ page.url | prepend: site.baseurl }}" class="section__link">{{ page.title }}</a></li>
{% if page.path contains section/ %} {% endunless %}{% endif %}{% endfor %}
{% unless page.path contains "index.html" %}
<li><a href="{{ page.url | prepend: site.baseurl }}" class="section__link">{{ page.title }}</a></li>
{% endunless %}
{% endif %}
{% endfor %}
</ul>
</li>
</ul> </ul>
{% endfor %} {% endfor %}
+3
View File
@@ -20,8 +20,11 @@
<div class="content__area"> <div class="content__area">
<div class="content__list"> <div class="content__list">
<h1>{{ page.title }}</h1> <h1>{{ page.title }}</h1>
{{ content }} {{ content }}
</div> </div>
</div> </div>
+1
View File
@@ -84,6 +84,7 @@ $wrapper-width: 800px;
.section__links { .section__links {
margin-left: $spacing-unit / 2; margin-left: $spacing-unit / 2;
margin-bottom: $spacing-unit;
font-weight: normal; font-weight: normal;
font-size: 0.9em; font-size: 0.9em;
} }
+1 -1
View File
@@ -2,7 +2,7 @@
title: append title: append
--- ---
`append` concatenates two strings and returns the concatenated value. Concatenates two strings and returns the concatenated value.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: capitalize title: capitalize
--- ---
`capitalize` makes the first character of your string capitalized. Makes the first character of a string capitalized.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: date title: date
--- ---
`date` converts a timestamp into another date format. The format for this syntax is the same as [`strftime`](//strftime.net). Converts a timestamp into another date format. The format for this syntax is the same as [`strftime`](//strftime.net).
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: default title: default
--- ---
`default` lets you specify a fallback in case a value doesn't exist. `default` will show its value if the left side is `nil`, `false`, or empty. Allows you to specify a fallback in case a value doesn't exist. `default` will show its value if the left side is `nil`, `false`, or empty.
In this example, `product_price` is not defined, so the default value is used. In this example, `product_price` is not defined, so the default value is used.
+1 -1
View File
@@ -2,7 +2,7 @@
title: divided_by title: divided_by
--- ---
`divided_by` divides its input (left side) by its argument (right side). It uses `to_number`, which converts to a decimal value unless already a numeric. Divides a number by its argument.
The result is rounded down to the nearest integer (that is, the [floor](/filters/floor)). The result is rounded down to the nearest integer (that is, the [floor](/filters/floor)).
+1 -1
View File
@@ -2,7 +2,7 @@
title: downcase title: downcase
--- ---
`downcase` makes each character in a string lowercase. It has no effect on strings which are already all lowercase. Makes each character in a string lowercase. It has no effect on strings which are already all lowercase.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: escape title: escape
--- ---
Escapes a string by replacing some characters with escape sequences (so that the string can be used in a URL, for example). It doesn't change strings that have nothing to escape. Escapes a string by replacing characters with escape sequences (so that the string can be used in a URL, for example). It doesn't change strings that don't have anything to escape.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: escape_once title: escape_once
--- ---
Escapes a string without changing existing escaped entities. It doesn't change strings that have nothing to escape. Escapes a string without changing existing escaped entities. It doesn't change strings that don't have anything to escape.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: first title: first
--- ---
`first` returns the first element of an array without sorting the array. Returns the first item of an array.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: floor title: floor
--- ---
`floor` rounds the input down to the nearest whole number. Rounds a number down to the nearest whole number.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: join title: join
--- ---
`join` combines the elements of an array into a single string using the string you provide as a separator. Combines the items in an array into a single string using the argument as a separator.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: last title: last
--- ---
`last` returns the last element of an array without sorting the array. Returns the last item of an array.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: lstrip title: lstrip
--- ---
`lstrip` removes all whitespace (tabs, spaces, and newlines) from the left side of a string. Removes all whitespaces (tabs, spaces, and newlines) from a string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: minus title: minus
--- ---
`minus` subtracts the number passed in from the input number. Subtracts a number from another number.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: modulo title: modulo
--- ---
`modulo` returns the remainder when the input is divided by the passed-in parameter. Returns the remainder of a division operation.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: newline_to_br title: newline_to_br
--- ---
Replace every newline (`\n`) with an HTML line break (`<br>`). Replaces every newline (`\n`) with an HTML line break (`<br>`).
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: plus title: plus
--- ---
`plus` adds the number passed in to the input number. Adds a number with another number.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: prepend title: prepend
--- ---
`prepend` adds a string to the beginning of the input string. Concatenates a string to the beginning of a string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: remove title: remove
--- ---
`remove` removes every occurrence of of the passed-in substring from the input string. Removes every occurrence of an argument from a string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: remove_first title: remove_first
--- ---
`remove` removes the first occurrence of of the passed-in substring from the input string. Removes only the first occurrence of an argument from a string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: replace title: replace
--- ---
`replace` replaces every occurrence of the first passed-in string in the input string with the second passed-in string. Replaces every occurrence of an argument in a string with the second argument.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: replace_first title: replace_first
--- ---
`replace_first` replaces the first occurrence of the first passed-in string in the input string with the second passed-in string. Replaces only the first occurrence of an argument in a string with the second argument.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: reverse title: reverse
--- ---
`reverse` reverses the order of the items in an array. `reverse` cannot reverse a string. Reverses the order of the items in an array. `reverse` cannot reverse a string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: round title: round
--- ---
`round` rounds an input number to the nearest integer or, if a number is specified as a parameter, to that number of decimal places. Rounds an input number to the nearest integer or, if a number is specified as an argument, to that number of decimal places.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: rstrip title: rstrip
--- ---
`rstrip` removes all whitespace (tabs, spaces, and newlines) from the right side of a string. Removes all whitespace (tabs, spaces, and newlines) from the right side of a string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: size title: size
--- ---
`size` returns the number of characters in a string or the number of items in an array. `size` can also be used with dot notation (for example, `{% raw %}{{ my_string.size }}{% endraw %}`). This allows you to use `size` inside other tags like conditionals. Returns the number of characters in a string or the number of items in an array. `size` can also be used with dot notation (for example, `{% raw %}{{ my_string.size }}{% endraw %}`). This allows you to use `size` inside tags such as conditionals.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: slice title: slice
--- ---
`slice` returns a substring of 1 character beginning at the index specified by the parameter passed in. An optional second parameter specifies the length of the substring to be returned. Returns a substring of 1 character beginning at the index specified by the argument passed in. An optional second argument specifies the length of the substring to be returned.
String indices are numbered starting from 0. String indices are numbered starting from 0.
+1 -1
View File
@@ -2,7 +2,7 @@
title: split title: split
--- ---
`split` divides an input string into an array using the passed-in substring as a separator. `split` is commonly used to convert comma-separated items from a string to an array. Divides an input string into an array using the argument as a separator. `split` is commonly used to convert comma-separated items from a string to an array.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: strip title: strip
--- ---
`strip` removes all whitespace (tabs, spaces, and newlines) from both the left and right sides of a string. It does not affect spaces between words. Removes all whitespace (tabs, spaces, and newlines) from both the left and right side of a string. It does not affect spaces between words.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: strip_html title: strip_html
--- ---
`strip_html` removes any HTML tags from a string. Removes any HTML tags from a string.
```liquid ```liquid
+1 -1
View File
@@ -2,7 +2,7 @@
title: strip_newlines title: strip_newlines
--- ---
`strip_newlines` removes any newline characters (line breaks) from a string. Removes any newline characters (line breaks) from a string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: times title: times
--- ---
`times` multiplies its input by its argument. Multiplies a number by another number.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: truncatewords title: truncatewords
--- ---
`truncate` shortens a string down to the number of words passed as a parameter. If the number of words specified is less than the number of words in the string, an ellipsis (...) is appended to the string. Shortens a string down to the number of words passed as the argument. If the number of words specified is less than the number of words in the string, an ellipsis (...) is appended to the string.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: uniq title: uniq
--- ---
`uniq` removes any duplicate elements in an array. Removes any duplicate elements in an array.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: upcase title: upcase
--- ---
`upcase` makes each character in a string uppercase. It has no effect on strings which are already all uppercase. Makes each character in a string uppercase. It has no effect on strings which are already all uppercase.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -2,7 +2,7 @@
title: url_encode title: url_encode
--- ---
`url_encode` converts any URL-unsafe characters in a string into percent-encoded characters. Converts any URL-unsafe characters in a string into percent-encoded characters.
```liquid ```liquid
{% raw %} {% raw %}
+1 -1
View File
@@ -8,7 +8,7 @@ Liquid is an open-source template language created by [Shopify](https://www.shop
Liquid has been in production use since June 2006 and is now used by many other hosted web applications. Liquid has been in production use since June 2006 and is now used by many other hosted web applications.
It was developed for usage in Ruby on Rails web applications and integrates seamlessly as a plugin but it also works well as a stand alone library. It was developed for usage in Ruby on Rails web applications and integrates seamlessly as a plugin but it also works well as a stand-alone library.
## Introduction ## Introduction