Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds tagging (fixes #5) #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang={{site.language}}>
{% include head.html %}
<body>
<div id="wrapper">
<div id="logo">&nbsp;</div>
<h1 id="lefttitle">{{page.title}}</h1>
{{content}}
</div> <!-- /wrapper -->
</body>
</html>
17 changes: 0 additions & 17 deletions _layouts/overview.html

This file was deleted.

1 change: 1 addition & 0 deletions _posts/2017-08-20-html-ragout.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: recipe
title: Blindtext an HTML-Ragout
persons: 4
image:
categories: vegetarian
---

<!-- Zutaten -->
Expand Down
1 change: 1 addition & 0 deletions _posts/2017-08-21-css-ragout.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: recipe
title: Blindtext an CSS-Ragout
persons: 4
image: kaiserschmarrn.jpg
tags: easy fast
---

<!-- Zutaten -->
Expand Down
37 changes: 37 additions & 0 deletions categories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
layout: default
title: Categories
permalink: /categories/
---
<!-- Get the category name for every category on the site and set them
to the `site_categories` variable. -->
{% capture site_categories %}{% for category in site.categories %}{{ category | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}

<!-- `category_words` is a sorted array of the category names. -->
{% assign category_words = site_categories | split:',' | sort %}

<!-- List of all categories -->
<ul class="categories">
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ category_words[item] }}{% endcapture %}
<li>
<a href="#{{ this_word | cgi_escape }}" class="category">{{ this_word }}
<span>({{ site.categories[this_word].size }})</span>
</a>
</li>
{% endunless %}{% endfor %}
</ul>

<!-- Posts by category -->
<div>
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ category_words[item] }}{% endcapture %}
<h2 id="{{ this_word | cgi_escape }}">{{ this_word }}</h2>
{% for post in site.categories[this_word] %}{% if post.title != null %}
<div>
<a href="{{site.url}}{{site.baseurl}}{{ post.url }}">{{ post.title }}</a>
</div>
<div style="clear: both;"></div>
{% endif %}{% endfor %}
{% endunless %}{% endfor %}
</div>
9 changes: 8 additions & 1 deletion index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
---
layout: overview
layout: default
title: Übersicht #Overview
---
<div id="table-of-contents">
<ul id="toc">
{% for recipe in site.posts reversed %}
<li><a href="{{site.url}}{{site.baseurl}}{{recipe.url}}">{{recipe.title}}</a></li>
{% endfor %}
</ul>
</div> <!-- /table-of-contents -->
38 changes: 38 additions & 0 deletions tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: default
title: Tags
permalink: /tags/
---

<!-- Get the tag name for every tag on the site and set them
to the `site_tags` variable. -->
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}

<!-- `tag_words` is a sorted array of the tag names. -->
{% assign tag_words = site_tags | split:',' | sort %}

<!-- List of all tags -->
<ul class="tags">
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tag_words[item] }}{% endcapture %}
<li>
<a href="#{{ this_word | cgi_escape }}" class="tag">{{ this_word }}
<span>({{ site.tags[this_word].size }})</span>
</a>
</li>
{% endunless %}{% endfor %}
</ul>

<!-- Posts by Tag -->
<div>
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tag_words[item] }}{% endcapture %}
<h2 id="{{ this_word | cgi_escape }}">{{ this_word }}</h2>
{% for post in site.tags[this_word] %}{% if post.title != null %}
<div>
<a href="{{site.url}}{{site.baseurl}}{{ post.url }}">{{ post.title }}</a>
</div>
<div style="clear: both;"></div>
{% endif %}{% endfor %}
{% endunless %}{% endfor %}
</div>