Refactor config and sidebar

This commit is contained in:
Adam Hollett
2015-12-04 21:16:07 -05:00
parent 90825277d3
commit 1ce90ed355
5 changed files with 32 additions and 78 deletions
+1 -13
View File
@@ -6,7 +6,7 @@ baseurl: "" # the subpath of your site, e.g. /blog/
url: http://liquidmarkup.org # the base hostname & protocol for your site
markdown: kramdown
highlighter: pygments
permalink: /:year/:month/:day/:basename:output_ext
permalink: pretty
exclude:
- README.md
- CNAME
@@ -19,15 +19,3 @@ defaults:
path: "" # an empty string here means all files in the project
values:
layout: "default"
- scope:
path: "basics"
values:
type: "basics"
- scope:
path: "filters"
values:
type: "filters"
- scope:
path: "tags"
values:
type: "tags"
+28
View File
@@ -0,0 +1,28 @@
<div class="sidebar">
<div class="sidebar--logo">
<a href="/">Liquid</a>
</div>
<nav class="sidebar--nav">
{% capture folders %}basics,tags,filters{% endcapture %}
{% assign sections = folders | split: "," %}
{% for section in sections %}
<ul class="section">
<li>
<h3 class="section__header">{{ section | capitalize }}</h3>
<ul class="section__links">
{% for page in site.pages %}
{% if page.path contains section/ %}
{% 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>
{% endfor %}
</nav>
</div>
+1 -62
View File
@@ -16,68 +16,7 @@
</head>
<body>
<div class="sidebar">
<div class="sidebar--logo">
<a href="/">Liquid</a>
</div>
<nav class="sidebar--nav">
<!-- Basics -->
<ul class="section">
<li>
<h3 class="section__header">Basics</h3>
<ul class="section__links">
{% for doc in site.pages %}
{% if doc.type == "basics" %}
{% unless doc.path contains "index.html" %}
<li>
<a href="/{{ doc.type }}/{{ doc.title | slugify }}" class="section__link">{{ doc.title }}</a>
</li>
{% endunless %}
{% endif %}
{% endfor %}
</ul>
</li>
</ul>
<!-- Tags -->
<ul class="section">
<li>
<h3 class="section__header">Tags</h3>
<ul class="section__links">
{% for doc in site.pages %}
{% if doc.type == "tags" %}
{% unless doc.path contains "index.html" %}
<li>
<a href="/{{ doc.type }}/{{ doc.title | slugify }}" class="section__link">{{ doc.title }}</a>
</li>
{% endunless %}
{% endif %}
{% endfor %}
</ul>
</li>
</ul>
<!-- Filters -->
<ul class="section">
<li>
<h3 class="section__header">Filters</h3>
<ul class="section__links">
{% for doc in site.pages %}
{% if doc.type == "filters" %}
{% unless doc.path contains "index.html" %}
<li>
<a href="/{{ doc.type }}/{{ doc.title | slugify }}" class="section__link">{{ doc.title }}</a>
</li>
{% endunless %}
{% endif %}
{% endfor %}
</ul>
</li>
</ul>
</nav>
</div>
{% include sidebar.html %}
<div class="content__area">
<div class="content__list">
+1 -1
View File
@@ -1,5 +1,5 @@
---
title: Truthy and Falsy
title: Truthy and falsy
---
In programming, anything that returns `true` in a conditional is called **truthy**. Anything that returns `false` in a conditional is called **falsy**. All object types can be described as either truthy or falsy.
+1 -2
View File
@@ -1,8 +1,7 @@
---
title: Control flow
---
TAGS!
## case/when
<p>Creates a switch statement to compare a variable with different values. <code>case</code> initializes the switch statement, and <code>when</code> compares its values.</p>