Skip to content

Commit

Permalink
fixed25
Browse files Browse the repository at this point in the history
  • Loading branch information
Kokecoco committed Jun 27, 2024
1 parent d1c2f04 commit bdaf997
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 10 deletions.
13 changes: 8 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ sass:

category_dir: categories

collections:
categories:
output: true
permalink: /categories/:name/

plugins:
- jekyll-sitemap

defaults:
-
scope:
path: "categories/"
values:
layout: category


9 changes: 6 additions & 3 deletions _layouts/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
---
layout: default
---
<h1>Category: {{ page.category }}</h1>
<h1>Category: {{ page.title }}</h1>

<ul>
{% for post in site.categories[page.category] %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% for post in site.categories[page.title] %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
<span>{{ post.date | date: "%Y-%m-%d" }}</span>
</li>
{% endfor %}
</ul>
7 changes: 5 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ <h1>{{ page.title }}</h1>
<hr>
<footer class="post-footer">
<p>
カテゴリー: {% for category in page.categories %}{{ category }}
{% if forloop.last == false %}, {% endif %} {% endfor %}
カテゴリー:
{% for category in page.categories %}
<a href="{{ '/categories/' | append: category | relative_url }}">{{ category }}</a>
{% if forloop.last == false %}, {% endif %}
{% endfor %}
</p>
</footer>
</article>
4 changes: 4 additions & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ article {
padding: 20px;
margin-bottom: 20px;
}

h1 {
margin: 1rem;
}
12 changes: 12 additions & 0 deletions categories/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: default
title: Categories
permalink: /categories/
---

<h1>Categories</h1>
<ul>
{% for category in site.categories %}
<li><a href="{{ site.baseurl }}/categories/{{ category[0] | slugify }}/">{{ category[0] }}</a></li>
{% endfor %}
</ul>
5 changes: 5 additions & 0 deletions categories/ブログ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: category
title: ブログ
permalink: /categories/ブログ/
---
5 changes: 5 additions & 0 deletions categories/使い方説明.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: category
title: 使い方説明
permalink: /categories/使い方説明/
---

0 comments on commit bdaf997

Please sign in to comment.