_layouts/page.html in jekyll-theme-acg-1.0.6 vs _layouts/page.html in jekyll-theme-acg-1.0.7
- old
+ new
@@ -1,13 +1,57 @@
---
layout: default
---
+{% capture workspace %}
+ {% assign color = page.color | default: site.color %}
+ {% assign title = page.title %}
+ {% assign description = page.description %}
+ {% assign content = content | strip %}
-{% assign color = page.color | default: site.color %}
+ {% assign list = "" | split: "" %}
-<div class="w-acg min-h-screen mt-16">
- <div class="w-full py-16 text-{{ color }}-50 flex flex-col justify-center items-center content-center">
- <div class="text-center text-4xl font-serif">{{ page.title }}</div>
- <div class="text-center text-base font-sans">{{ page.description }}</div>
+ {% if page.permalink == "/404.html" %}
+ {% capture title %}<span class="text-6xl">404</span>{% endcapture %}
+ {% capture description %}{{ site.acg.error | default: "Page not found." }}{% endcapture %}
+ {% elsif page.permalink == "/categories.html" %}
+ {% assign title = site.acg.categories %}
+ {% for item in site.categories %}{% assign list = list | push: item[0] %}{% endfor %}
+ {% elsif page.permalink == "/tags.html" %}
+ {% assign title = site.acg.tags %}
+ {% for item in site.tags %}{% assign list = list | push: item[0] %}{% endfor %}
+ {% endif %}
+
+ {% assign list = list | sort %}
+
+{% endcapture %}
+
+<div class="w-acg min-h-screen py-16">
+ <div class="w-full py-32 text-{{ color }}-50 flex flex-col justify-center items-center content-center">
+ <!-- title -->
+ <div class="text-center text-4xl font-serif py-8">
+ {% if page.type == "category" %}{% include item-category.html name=title title=true %}
+ {% elsif page.type == "tag" %}{% include item-tag.html name=title title=true %}
+ {% else %}{{ title }}{% endif %}
+ </div>
+ <!-- description -->
+ <div class="text-center text-base font-sans py-8">{{ description }}</div>
+ <!-- categories/tags: list -->
+ <div class="flex flex-wrap justify-center items-center content-center select-none">
+ {% if page.permalink == "/categories.html" %}
+ {% for name in list %}{% assign count = site.categories[name].size %}
+ <div class="m-1 px-2 bg-{{ color }}-50 bg-opacity-75 rounded">{% include item-category.html name=name count=count %}</div>
+ {% endfor %}
+ {% elsif page.permalink == "/tags.html" %}
+ {% for name in list %}{% assign count = site.tags[name].size %}
+ <div class="m-1 px-2 bg-{{ color }}-50 bg-opacity-75 rounded">{% include item-tag.html name=name count=count %}</div>
+ {% endfor %}
+ {% endif %}
+ </div>
+
+ <!-- content -->
+ {% if content != empty %}<article class="w-full my-4 mx-auto p-4 rounded-lg text-black bg-{{ color }}-50 bg-opacity-75 markdown-body">{{ content }}</article>{% endif %}
+ <!-- posts -->
+ {% if page.posts %}<div class="w-full p-4 flex flex-col space-y-4">{% include posts.html posts=page.posts %}</div>{% endif %}
+
</div>
- <article class="w-full my-4 mx-auto p-4 rounded-lg text-black bg-{{ color }}-50 bg-opacity-75 markdown-body">{{ content }}</article>
+
</div>