mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Changing sidebar to deeplinks
Fixed up navigation, collection contents are now output on one page. CSS cleanup
This commit is contained in:
@@ -17,12 +17,5 @@ defaults:
|
|||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: ""
|
path: ""
|
||||||
type: "filters"
|
|
||||||
values:
|
|
||||||
layout: "default"
|
|
||||||
-
|
|
||||||
scope:
|
|
||||||
path: ""
|
|
||||||
type: "tags"
|
|
||||||
values:
|
values:
|
||||||
layout: "default"
|
layout: "default"
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
---
|
---
|
||||||
title: split
|
title: split
|
||||||
---
|
---
|
||||||
|
|
||||||
|
The `split` filter takes on a substring as a parameter. The substring is used as a delimiter to divide a string into an array. You can output different parts of an array using [array filters](/themes/liquid-documentation/filters/array-filters).
|
||||||
|
|
||||||
|
<p class="input">Input</p>
|
||||||
|
{% highlight liquid %}{% raw %}
|
||||||
|
{% assign words = "Hi, how are you today?" | split: ' ' %}
|
||||||
|
|
||||||
|
{% for word in words %}
|
||||||
|
{{ word }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endraw %}{% endhighlight %}
|
||||||
|
|
||||||
|
<p class="output">Output</p>
|
||||||
|
{% highlight text %}
|
||||||
|
Hi,
|
||||||
|
how
|
||||||
|
are
|
||||||
|
you
|
||||||
|
today?
|
||||||
|
{% endhighlight %}
|
||||||
|
|||||||
+11
-3
@@ -5,6 +5,14 @@ title: uniq
|
|||||||
|
|
||||||
<p>Removes any duplicate instances of an element in an array.</p>
|
<p>Removes any duplicate instances of an element in an array.</p>
|
||||||
|
|
||||||
| Input | Output |
|
<p class="input">Input</p>
|
||||||
|:-------------------------------------------|:-------|
|
<div>{% highlight html %}{% raw %}
|
||||||
| {% raw %}`{% assign fruits = "orange apple banana apple orange" %} {{ fruits | split: ' ' | uniq | join: ' ' }}`{% endraw %} | orange apple banana |
|
{% assign fruits = "orange apple banana apple orange" %}
|
||||||
|
{{ fruits | split: ' ' | uniq | join: ' ' }}
|
||||||
|
{% endraw %}{% endhighlight %}</div>
|
||||||
|
|
||||||
|
<p class="output">Output</p>
|
||||||
|
<div>{% highlight html%}{% raw %}
|
||||||
|
orange apple banana
|
||||||
|
{% endraw %}{% endhighlight %}</div>
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<ul class="section__links">
|
<ul class="section__links">
|
||||||
{% for doc in site.collections[section_title].docs %}
|
{% for doc in site.collections[section_title].docs %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ doc.url }}" class="section__link {% if doc.title == page.title %}section__link--is-active{% endif %}">{{ doc.title }}</a>
|
<a href="/{{ collection[0] }}#{{ doc.title }}" class="section__link">{{ doc.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -40,13 +40,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content__area">
|
<div class="content__area">
|
||||||
<div class="content__wrapper">
|
<div class="content__list">
|
||||||
<h1>{% unless page.url == "/index.html" %}{{ page.collection | capitalize }} → {% endunless %} {{ page.title }}</h1>
|
|
||||||
<div class="content">
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
layout: default
|
|
||||||
---
|
|
||||||
<div class="post">
|
|
||||||
|
|
||||||
<header class="post-header">
|
|
||||||
<h1 class="post-title">{{ page.title }}</h1>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article class="post-content">
|
|
||||||
{{ content }}
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
layout: default
|
|
||||||
---
|
|
||||||
<div class="post">
|
|
||||||
|
|
||||||
<header class="post-header">
|
|
||||||
<h1 class="post-title">{{ page.title }}</h1>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article class="post-content">
|
|
||||||
{{ content }}
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
layout: post
|
|
||||||
title: "Test Post"
|
|
||||||
date: 2015-01-26 17:50:59
|
|
||||||
categories: liquid docs yo
|
|
||||||
---
|
|
||||||
|
|
||||||
# Heading 1
|
|
||||||
|
|
||||||
## Heading 2
|
|
||||||
|
|
||||||
### Heading 3
|
|
||||||
|
|
||||||
#### Heading 4
|
|
||||||
|
|
||||||
This is a dummy paragraph... find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
|
|
||||||
|
|
||||||
> Blockquote
|
|
||||||
|
|
||||||
Code snippet:
|
|
||||||
|
|
||||||
{% highlight ruby %}
|
|
||||||
def print_hi(name)
|
|
||||||
puts "Hi, #{name}"
|
|
||||||
end
|
|
||||||
print_hi('Tom')
|
|
||||||
#=> prints 'Hi, Tom' to STDOUT.
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help].
|
|
||||||
|
|
||||||
[jekyll]: http://jekyllrb.com
|
|
||||||
[jekyll-gh]: https://github.com/jekyll/jekyll
|
|
||||||
[jekyll-help]: https://github.com/jekyll/jekyll-help
|
|
||||||
@@ -82,12 +82,11 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2em;
|
font-size: 2.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
text-decoration: underline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ $wrapper-width: 800px;
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content__wrapper {
|
.content__list {
|
||||||
max-width: $wrapper-width;
|
max-width: $wrapper-width;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0 $spacing-unit;
|
padding: 0 $spacing-unit;
|
||||||
|
|||||||
@@ -8,3 +8,7 @@ td {
|
|||||||
p {
|
p {
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content__item {
|
||||||
|
margin-bottom: $spacing-unit * 2;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
{% for doc in site.collections["filters"].docs %}
|
||||||
|
<div id="{{ doc.title }}" class="content__item">
|
||||||
|
<h2>{{ doc.title }}</h2>
|
||||||
|
<div class="content">
|
||||||
|
{{ doc.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
{% for doc in site.collections["tags"].docs %}
|
||||||
|
<div id="{{ doc.title }}" class="content__item">
|
||||||
|
<h2>{{ doc.title }}</h2>
|
||||||
|
<div class="content">
|
||||||
|
{{ doc.content }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
Reference in New Issue
Block a user