Skip to content

Commit

Permalink
Use everywhere (posts/collections) a category to group them together
Browse files Browse the repository at this point in the history
  • Loading branch information
aheritier committed Sep 15, 2014
1 parent c811cb8 commit 714ece1
Show file tree
Hide file tree
Showing 20 changed files with 93 additions and 93 deletions.
18 changes: 9 additions & 9 deletions _config.yml
Expand Up @@ -62,19 +62,19 @@ defaults:
path: "docs/build"
type: "docs"
values:
group: "build"
category: "build"
-
scope:
path: "docs/ide"
type: "docs"
values:
group: "ide"
category: "ide"
-
scope:
path: "docs/scm"
type: "docs"
values:
group: "scm"
category: "scm"
-
scope:
path: ""
Expand All @@ -86,37 +86,37 @@ defaults:
path: "rules/architecture"
type: "rules"
values:
group: "architecture"
category: "architecture"
-
scope:
path: "rules/build"
type: "rules"
values:
group: "build"
category: "build"
-
scope:
path: "rules/coding"
type: "rules"
values:
group: "coding"
category: "coding"
-
scope:
path: "rules/ergonomics"
type: "rules"
values:
group: "ergonomics"
category: "ergonomics"
-
scope:
path: "rules/formatting"
type: "rules"
values:
group: "formatting"
category: "formatting"
-
scope:
path: "rules/run"
type: "rules"
values:
group: "run"
category: "run"


# Themes are encouraged to use these universal variables
Expand Down
17 changes: 17 additions & 0 deletions _includes/category
@@ -0,0 +1,17 @@
{% comment %}<!--
The category include is a display helper for category.
Usage:
1) assign the 'category' variable to a valid category.
2) include category
example:
<ul>
{% assign category = page.category %}
{% include category %}
</ul>

-->{% endcomment %}
{% assign label_text = category %}
{% assign label_type = 'primary' %}
{% assign label_fa_icon = 'fa-folder' %}
{% include label %}
{% assign category = nil %}
14 changes: 14 additions & 0 deletions _includes/doc_category
@@ -0,0 +1,14 @@
{% comment %}<!--
The doc_category include is a display helper for documentation category.
Usage:
1) assign the 'category' variable to a valid category.
2) include doc_category
example:
<ul>
{% assign category = page.category %}
{% include doc_category %}
</ul>

-->{% endcomment %}
{% include category %}
{% assign category = nil %}
14 changes: 0 additions & 14 deletions _includes/doc_group

This file was deleted.

17 changes: 0 additions & 17 deletions _includes/group

This file was deleted.

8 changes: 4 additions & 4 deletions _includes/pages_list
Expand Up @@ -10,8 +10,8 @@ Usage:
</ul>

Grouping: (optional):
assign the 'group' variable to constrain the list to only pages/posts
in the given group. Note you must define the group manually in the page/post
assign the 'category' variable to constrain the list to only pages/posts
in the given category. Note you must define the category manually in the page/post
meta-data to use this feature.
Grouping is mainly helpful for non-post pages.
If you want to group posts, it's easier/better to tag them, then pass the tagged posts array.
Expand All @@ -22,7 +22,7 @@ Usage:

{% for node in pages_list %}
{% if node.title != null and node.published != false %}
{% if group == null or group == node.group %}
{% if category == null or category == node.category %}
{% if page.url == node.url %}
<li class="active"><a href="{{BASE_PATH}}{{node.url}}" class="active">{% if node.fa-icon != null %}<i class="fa fa-{{node.fa-icon}} fa-fw"></i>&nbsp;{% endif %}{{node.title}}</a></li>
{% else %}
Expand All @@ -32,4 +32,4 @@ Usage:
{% endif %}
{% endfor %}
{% assign pages_list = nil %}
{% assign group = nil %}
{% assign category = nil %}
10 changes: 5 additions & 5 deletions _includes/pages_listgroup
Expand Up @@ -6,12 +6,12 @@ Usage:
example:
<ul>
{% assign pages_list = site.pages %}
{% include pages_listgroup %}
{% include pages_listcategory %}
</ul>

Grouping: (optional):
assign the 'group' variable to constrain the list to only pages/posts
in the given group. Note you must define the group manually in the page/post
assign the 'category' variable to constrain the list to only pages/posts
in the given category. Note you must define the category manually in the page/post
meta-data to use this feature.
Grouping is mainly helpful for non-post pages.
If you want to group posts, it's easier/better to tag them, then pass the tagged posts array.
Expand All @@ -21,7 +21,7 @@ Usage:

{% for node in pages_list %}
{% if node.title != null and node.published != false %}
{% if group == null or group == node.group %}
{% if category == null or category == node.category %}
{% if page.url == node.url %}
<a href="{{BASE_PATH}}{{node.url}}" class="list-group-item active">{{node.title}}</a>
{% else %}
Expand All @@ -31,4 +31,4 @@ Usage:
{% endif %}
{% endfor %}
{% assign pages_list = nil %}
{% assign group = nil %}
{% assign category = nil %}
14 changes: 14 additions & 0 deletions _includes/rule_category
@@ -0,0 +1,14 @@
{% comment %}<!--
The rule_category include is a display helper for rule category.
Usage:
1) assign the 'category' variable to a valid category.
2) include rule_category
example:
<ul>
{% assign category = page.category %}
{% include rule_category %}
</ul>

-->{% endcomment %}
{% include category %}
{% assign category = nil %}
14 changes: 0 additions & 14 deletions _includes/rule_group

This file was deleted.

16 changes: 8 additions & 8 deletions _includes/rules_rows
Expand Up @@ -6,12 +6,12 @@ Usage:
example:
<ul>
{% assign pages_list = site.pages %}
{% include pages_listgroup %}
{% include rules_row %}
</ul>

Grouping (optional):
assign the 'group' variable to constrain the list to only nodes
in the given group. Note you must define the group manually in the node
assign the 'category' variable to constrain the list to only nodes
in the given category. Note you must define the category manually in the node
meta-data to use this feature.
Grouping is mainly helpful for non-post pages.
If you want to group posts, it's easier/better to tag them, then pass the tagged posts array.
Expand All @@ -32,7 +32,7 @@ Usage:
{% for node in pages_list %}
{% if node.title != null and node.published != false %}
{% if sinceLevel == null or sinceLevel == node.sinceLevel %}
{% if group == null or group == node.group %}
{% if category == null or category == node.category %}
{% if status == null or status == node.status %}
<tr>
<td>
Expand All @@ -42,9 +42,9 @@ Usage:
{% if node.tagline %}<a href="{{BASE_PATH}}{{node.url}}">{{node.tagline}}</a>{% endif %}
</td>
<td>
{% unless node.group.empty? %}
{% assign group = node.group %}
{% include group %}
{% unless node.category.empty? %}
{% assign category = node.category %}
{% include category %}
{% endunless %}
</td>
<td>
Expand All @@ -66,6 +66,6 @@ Usage:
{% endif %}
{% endfor %}
{% assign pages_list = nil %}
{% assign group = nil %}
{% assign category = nil %}
{% assign status = nil %}
{% assign sinceLevel = nil %}
4 changes: 2 additions & 2 deletions _layouts/default.html
Expand Up @@ -76,12 +76,12 @@
<div class="collapse navbar-collapse" id="jb-navbar-collapse">
<ul class="nav navbar-nav">
{% assign pages_list = site.pages | sort: "order" %}
{% assign group = 'navigation' %}
{% assign category = 'navigation' %}
{% include pages_list %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% assign pages_list = site.pages | sort: "order" %}
{% assign group = 'navigation-right' %}
{% assign category = 'navigation-right' %}
{% include pages_list %}
<li><a href="https://twitter.com/{{site.author.twitter}}" title="Follow us on twitter"><i
class="fa fa-twitter-square fa-fw"></i>&nbsp;Follow us</a></li>
Expand Down
6 changes: 3 additions & 3 deletions _layouts/doc.html
Expand Up @@ -16,9 +16,9 @@ <h1>{{page.title}} {% if page.tagline %}<small>{{page.tagline}}</small>{% endif
<div class="row">
<div class="col-md-12">
<div class="pull-right">
{% unless page.group.empty? %}
{% assign group = page.group %}
{% include doc_group %}
{% unless page.category.empty? %}
{% assign category = page.category %}
{% include doc_category %}
{% endunless %}
{% unless page.tags.empty? %}
{% assign tags_list = page.tags %}
Expand Down
6 changes: 3 additions & 3 deletions _layouts/rule.html
Expand Up @@ -23,10 +23,10 @@ <h3 class="panel-title">About</h3>
<dl class="dl-horizontal">
<dt>Code</dt>
<dd>{{page.title}}</dd>
{% unless page.group.empty? %}
{% assign group = page.group %}
{% unless page.category.empty? %}
{% assign category = page.category %}
<dt>Type</dt>
<dd>{% include rule_group %}</dd>
<dd>{% include rule_category %}</dd>
{% endunless %}
<dt>Excerpt</dt>
<dd>{{page.tagline}}</dd>
Expand Down
2 changes: 1 addition & 1 deletion credits.html
Expand Up @@ -2,7 +2,7 @@
title: Credits
tagline: Give back to Caesar what is Caesar's
permalink: /credits/
group: navigation-right
category: navigation-right
order: 1
comments: false
---
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
@@ -1,7 +1,7 @@
---
title: Documentation
permalink: /docs/
group: navigation
category: navigation
order: 2
fa-icon: book
---
Expand All @@ -11,7 +11,7 @@
<div class="panel-heading"><i class="fa fa-files-o fa-fw"></i> Sources Management</div>
<div class="list-group">
{% assign pages_list = site.docs %}
{% assign group = "scm" %}
{% assign category = "scm" %}
{% include pages_listgroup %}
</div>
</div>
Expand All @@ -21,7 +21,7 @@
<div class="panel-heading"><i class="fa fa-cog fa-fw"></i> Build Management</div>
<div class="list-group">
{% assign pages_list = site.docs %}
{% assign group = "build" %}
{% assign category = "build" %}
{% include pages_listgroup %}
</div>
</div>
Expand All @@ -31,7 +31,7 @@
<div class="panel-heading"><i class="fa fa-file-text-o fa-fw"></i> IDE</div>
<div class="list-group">
{% assign pages_list = site.docs %}
{% assign group = "ide" %}
{% assign category = "ide" %}
{% include pages_listgroup %}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions index.html
Expand Up @@ -29,23 +29,23 @@ <h3>Documentation</h3>
<div class="panel-heading"><i class="fa fa-files-o fa-fw"></i> Sources Management</div>
<div class="list-group">
{% assign pages_list = site.docs %}
{% assign group = "scm" %}
{% assign category = "scm" %}
{% include pages_listgroup %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-cog fa-fw"></i> Build Management</div>
<div class="list-group">
{% assign pages_list = site.docs %}
{% assign group = "build" %}
{% assign category = "build" %}
{% include pages_listgroup %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-file-text-o fa-fw"></i> IDE</div>
<div class="list-group">
{% assign pages_list = site.docs %}
{% assign group = "ide" %}
{% assign category = "ide" %}
{% include pages_listgroup %}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions news/categories.html
Expand Up @@ -6,10 +6,10 @@
---
{% assign post_categories_list = site.categories %}
{% include post_categories_list %}
{% for category in site.categories %}
<h2 id="{{category[0]}}-ref">{{category[0] | join: "/"}}</h2>
{% for site_category in site.categories %}
<h2 id="{{site_category[0]}}-ref">{{site_category[0] | join: "/"}}</h2>
<ul>
{% assign pages_list = category[1] %}
{% assign pages_list = site_category[1] %}
{% include pages_list %}
</ul>
{% endfor %}

0 comments on commit 714ece1

Please sign in to comment.