feat: tags templates
ci/woodpecker/pr/woodpecker Pipeline failed Details

pull/5/head
Aravinth Manivannan 2022-04-18 01:56:35 +05:30
parent aa3cf8702d
commit 5ffbb71006
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
5 changed files with 119 additions and 5 deletions

View File

@ -3,7 +3,8 @@
@import "./footer/mobile";
@import "./page/mobile";
@import "./blog/mobile";
@import "./tag/mobile";
header {
height: auto;
height: auto;
}

View File

@ -9,17 +9,42 @@ $std-trans: 0.3s;
.tag__item-link {
display: flex;
align-items: center;
align-items: start;
flex-direction: column;
flex: 2;
}
.tag__item {
border-bottom: 1px dashed #333;
margin: 10px;
padding: 10px;
display: flex;
justify-content: space-between;
padding: 5px;
}
.tag__item-title {
font-size: 1.4rem;
font-weight: 550;
}
.tag__meta {
font-size: 0.7rem;
}
.tag__rss-link {
margin: auto 20px;
}
.tag__title {
display: inline;
flex: 2;
}
.tag__title-container {
margin: 35px 0;
display: flex;
}
.tag__rss-link--single {
margin: auto;
}

8
sass/tag/mobile.scss Normal file
View File

@ -0,0 +1,8 @@
.tag__title-container {
flex-direction: column;
}
.tag__rss-link--icon {
margin: auto 0px;
}

37
templates/tags/list.html Normal file
View File

@ -0,0 +1,37 @@
{% extends "base.html" %} {% block meta %}
{% set title = taxonomy.name %}
{% set description = title %}
{{ macros::get_meta_tags(title=title, description=description) }}
{% endblock meta %} {% block content %}
<div class="blog__container">
<ul class="blog__list">
{% for term in terms %}
<li class="tag__item">
<a href="{{ term.permalink | safe }}" class="tag__item-link">
<h2 class="tag__item-title">#{{ term.name }}</h2>
{% set length = term.pages | length %}
{% set entry = "entries" %}
{% if length == 1 %}
{% set entry = "entry" %}
{% endif %}
<span class="tag__meta">{{ term.pages | length }} {{ entry }}</span>
</a>
<a class="tag__rss-link" href="{{ term.permalink }}atom.xml" target="_blank" rel="noopener" title="RSS">
<img
src="{{ get_url(path='/icons/rss.svg', cachebust=true) }}"
class="tag__rss-icon"
alt="RSS icon"
/>
</a>
</li>
</a>
{% endfor %}
</ul>
</div>
{% endblock content %}

View File

@ -0,0 +1,43 @@
{% extends "base.html" %} {% block meta %}
{% set description = term.name %}
{{ macros::get_meta_tags(title=description, description=description) }}
{% endblock meta %} {% block content %}
<div class="blog__container">
<div class="tag__title-container">
<h1 class="tag__title">#{{ term.name }}</h1>
<a class="tag__rss-link--single" href="{{ term.permalink }}atom.xml" target="_blank" rel="noopener" title="RSS">
<img
src="{{ get_url(path='/icons/rss.svg', cachebust=true) }}"
class="tag__rss-icon--single"
alt="RSS icon"
/>
</a></div>
<ul class="blog__list">
{% for page in term.pages %}
<li class="blog__post-item">
<a href="{{ page.permalink | safe }}" class="blog__post-link">
<h2 class="blog__post-title">{{ page.title }}</h2>
<p class="blog__post-meta">
{{ page.day }} {{ macros::get_month(month=page.month) }},
{{ page.year }} &middot; <b>{{ page.reading_time }} min read</b>
</p>
<p class="blog__post-description">{{ page.description | safe }} </p>
</a>
<div class="blog__post-tag-container">
{% for t in page.taxonomies.tags %}
<a class="blog__post-tag" href="/tags/{{t}}">#{{ t }}</a>
{% endfor %}
</div>
</li>
{% endfor %}
</ul>
</div>
{% block rss %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml", trailing_slash=false) }}">
{% endblock %}
{% endblock content %}