Skip to content

Commit

Permalink
tags system
Browse files Browse the repository at this point in the history
tags
  • Loading branch information
StefanieB87 committed Jun 22, 2021
1 parent ea89d3b commit 80f5a53
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
11 changes: 11 additions & 0 deletions _includes/post-tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="post-tags">
Tags:
{% if post %}
{% assign tags = post.tags %}
{% else %}
{% assign tags = page.tags %}
{% endif %}
{% for tag in tags %}
<a href="/tags/#{{tag|slugize}}">{{tag}}</a>{% unless forloop.last %},{% endunless %}
{% endfor %}
</div>
5 changes: 5 additions & 0 deletions _posts/2021/2021-06-22-second-test.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: "post"
title: "second test"
date: "2021-06-22 03:47"
---
5 changes: 5 additions & 0 deletions _posts/2021/2021-06-22-test.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: "post"
title: "test"
date: "2021-06-22 03:46"
---
29 changes: 29 additions & 0 deletions tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
layout: page
permalink: /tags/
---

<ul class="tag-cloud">
{% for tag in site.tags %}
<li style="font-size: {{ tag | last | size | times: 100 | divided_by: site.tags.size | plus: 70 }}%">
<a href="#{{ tag | first | slugize }}">
{{ tag | first }}
</a>
</li>
{% endfor %}
</ul>

<div id="archives">
{% for tag in site.tags %}
<div class="archive-group">
{% capture tag_name %}{{ tag | first }}{% endcapture %}
<h3 id="#{{ tag_name | slugize }}">{{ tag_name }}</h3>
<a name="{{ tag_name | slugize }}"></a>
{% for post in site.tags[tag_name] %}
<article class="archive-item">
<h4><a href="{{ root_url }}{{ post.url }}">{{post.title}}</a></h4>
</article>
{% endfor %}
</div>
{% endfor %}
</div>
10 changes: 10 additions & 0 deletions wiki/testpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: post
title: This is an example.
tags:
- jekyll
- example
published: true
---

This is a post for an example.

0 comments on commit 80f5a53

Please sign in to comment.