Add collection layout

This commit is contained in:
Daniel Rudolf 2015-11-02 01:41:15 +01:00
parent 99ca791921
commit 5fc79a5094
4 changed files with 88 additions and 89 deletions

74
_layouts/collection.html Normal file
View file

@ -0,0 +1,74 @@
{% include itemumentHeader.html %}
<head>
{% include headInclude.html %}
<title>{% if page.title %}{{ page.title }} | {{ site.title }}{% else %}{{ site.title }} - {{ site.description }}{% endif %}</title>
</head>
<body class="full-layout">
<div class="body-wrapper">
<div class="top-wrapper">
{% include pageHeader.html %}
</div>
<div class="light-wrapper">
<div class="inner">
{% if page.headline or page.title %}
<h1 class="aligncenter">
{% if page.headline %}
{{ page.headline | markdownify | remove: '<p>' | remove: '</p>' }}
{% else %}
{{ page.title }}
{% endif %}
</h1>
{% endif %}
{% if page.description %}
<p class="description aligncenter">
{{ page.description | markdownify | remove: '<p>' | remove: '</p>' }}
</p><br />
{% endif %}
{{ content }}
{% if page.collection %}
{% assign items = site[page.collection]|sort:"nav" %}
<div class="one-fourth">
<ul>
{% for item in items %}
{% for section in item.toc %}
<li>
{% if section[1]._title %}
<a href="#{{ section[0] }}">{{ section[1]._title }}</a>
<ul>
{% for subSection in section[1] %}
{% if subSection[0] != "_title" %}
<li><a href="#{{ subSection[0] }}">{{ subSection[1] }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a href="#{{ section[0] }}">{{ section[1] }}</a>
{% endif %}
</li>
{% endfor %}
{% endfor %}
</ul>
</div>
<div class="three-fourth last">
{% for item in items %}
{{ item.output }}
{% endfor %}
<hr />
</div>
<div class="clear"></div>
{% endif %}
</div>
</div>
{% include pageFooter.html %}
</div>
</body>
{% include itemumentFooter.html %}

View file

@ -1,47 +1,10 @@
---
layout: default
layout: collection
title: Docs
headline: Pico Documentation
description: |
Pico is a flat file CMS, this means there is no administration backend or database to deal with.
You simply create .md files in the "content" folder and that becomes a page.
collection: docs
nav: 2
---
{% assign docs = site.docs|sort:"nav" %}
<div class="light-wrapper">
<div class="inner">
<h1 class="aligncenter">Pico Documentation</h1>
<p class="description aligncenter">
Pico is a flat file CMS, this means there is no administration backend or database to deal with.<br />
You simply create .md files in the "content" folder and that becomes a page.
</p><br />
<div class="one-fourth">
<ul>
{% for doc in docs %}
{% for item in doc.toc %}
<li>
{% if item[1]._title %}
<a href="#{{ item[0] }}">{{ item[1]._title }}</a>
<ul>
{% for sub in item[1] %}
{% if sub[0] != "_title" %}
<li><a href="#{{ sub[0] }}">{{ sub[1] }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a href="#{{ item[0] }}">{{ item[1] }}</a>
{% endif %}
</li>
{% endfor %}
{% endfor %}
</ul>
</div>
<div class="three-fourth last">
{% for doc in docs %}
{{ doc.output }}
{% endfor %}
<hr>
</div>
<div class="clear"></div>
</div>
</div>

View file

@ -1,46 +0,0 @@
---
layout: default
title: Development
nav: 3
---
{% assign docs = site.plugin-dev|sort:"nav" %}
<div class="light-wrapper">
<div class="inner">
<h1 class="aligncenter">Create your own plugins &amp; themes</h1>
<p class="description aligncenter">
Below is our developer documentation, you may also refer to Picos <a href="{{ site.base_url }}/phpDoc/master/">class documentation</a>
</p><br />
<div class="one-fourth">
<ul>
{% for doc in docs %}
{% for item in doc.toc %}
<li>
{% if item[1]._title %}
<a href="#{{ item[0] }}">{{ item[1]._title }}</a>
<ul>
{% for sub in item[1] %}
{% if sub[0] != "_title" %}
<li><a href="#{{ sub[0] }}">{{ sub[1] }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a href="#{{ item[0] }}">{{ item[1] }}</a>
{% endif %}
</li>
{% endfor %}
{% endfor %}
</ul>
</div>
<div class="three-fourth last">
{% for doc in docs %}
{{ doc.output }}
{% endfor %}
<hr>
</div>
<div class="clear"></div>
</div>
</div>

8
plugin-dev.md Normal file
View file

@ -0,0 +1,8 @@
---
layout: collection
title: Development
headline: Create your own plugins & themes
description: Below is our developer documentation, you may also refer to Picos [class documentation]({{ site.base_url }}/phpDoc/master/).
collection: plugin-dev
nav: 3
---