style tags page

This commit is contained in:
Chester How 2020-09-16 13:47:11 +08:00
parent 34df66d7ef
commit 7ddb37b309
4 changed files with 129 additions and 122 deletions

View File

@ -4,9 +4,9 @@
<h2 class="nav-title">{{ site.title }}</h2>
</a>
<ul>
<li><a href="{{ site.baseurl }}/">Posts</a></li>
<li><a href="{{ '/tags' | prepend: site.baseurl }}">Tags</a></li>
<li><a href="{{ '/about' | prepend: site.baseurl }}">About</a></li>
<li><a href="{{ site.baseurl }}/">Posts</a></li>
</ul>
</div>
</nav>

View File

@ -1,7 +1,7 @@
---
layout: default
permalink: /404.html
title: "404"
permalink: /404.html
---
<div class="notfound">

View File

@ -1,49 +1,53 @@
---
layout: default
permalink: /tags.html
title: "Tags"
permalink: /tags/
---
<div class="tags">
<div class="tags-header">
<div class="tags-header-title">
<h2>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</h2>
</div>
<div class="tags-header-line"></div>
</div>
<div class="tags-content">
<div class="tags-content-clouds">
{% for tag in site.tags %}
<a href="#{{ tag[0] }}" title="{{ tag[0] }}" rel="{{ tag[1].size }}">
{{ tag[0] }}
</a>
{% endfor %}
</div>
<div class="tags-content-list">
{% for tag in site.tags %}
<div class="tags-content-item">
<span class="tags-content-item-seperator" id="{{ tag[0] }}">
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M341.333333 375.466667a33.962667 33.962667 0 0 1-24.132266-10.001067l-256-256a34.133333 34.133333 0 1 1 48.264533-48.264533l256 256A34.133333 34.133333 0 0 1 341.333333 375.466667z" fill="#808080"></path>
<path d="M597.333333 955.733333a17.015467 17.015467 0 0 1-12.066133-5.000533l-426.666667-426.666667A17.015467 17.015467 0 0 1 153.6 512V170.666667a17.066667 17.066667 0 0 1 17.066667-17.066667h341.333333c4.522667 0 8.874667 1.792 12.066133 5.000533l426.666667 426.666667a17.0496 17.0496 0 0 1 0 24.132267l-341.333333 341.333333A17.015467 17.015467 0 0 1 597.333333 955.733333zM187.733333 504.9344l409.6 409.6L914.5344 597.333333l-409.6-409.6H187.733333v317.201067zM597.333333 785.066667a17.015467 17.015467 0 0 1-12.066133-5.000534l-213.333333-213.333333a17.0496 17.0496 0 0 1 0-24.132267l170.666666-170.666666a17.0496 17.0496 0 0 1 24.132267 0l213.333333 213.333333a17.0496 17.0496 0 0 1 0 24.132267l-170.666666 170.666666A17.015467 17.015467 0 0 1 597.333333 785.066667zM408.132267 554.666667L597.333333 743.867733 743.867733 597.333333 554.666667 408.132267 408.132267 554.666667z" fill="#808080"></path>
<path d="M401.92 280.746667c16.503467 17.066667 24.746667 37.256533 24.746667 60.586666s-8.2432 43.52-24.746667 60.586667C385.416533 418.423467 365.226667 426.666667 341.333333 426.666667c-23.330133 0-43.229867-8.2432-59.733333-24.746667-17.066667-17.066667-25.6-37.256533-25.6-60.586667s8.533333-43.52 25.6-60.586666c16.503467-16.503467 36.4032-24.746667 59.733333-24.746667 23.893333 0 44.0832 8.2432 60.586667 24.746667z" fill="#808080"></path>
</svg>
<span class="tags-content-item-text">{{ tag[0] }}</span>
</span>
{% for post in tag[1] %}
<div class="tags-content-post">
<a href="{{ post.url}}" title="{{ post.title }}">
<span class="tags-content-post-title">{{ post.title }}</span>
</a>
<span class="tags-content-post-meta">
<time datetime="{{ post.date | date:'%Y-%m-%d' }}">
{{ post.date | date:"%Y-%m-%d" }}
</time>
</span>
</div>
<!-- <hr> -->
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
<div class="tags-header">
<h2 class="tags-header-title">{{ page.title }}</h2>
<div class="tags-header-line"></div>
</div>
<div class="tags-clouds">
{% for tag in site.tags %}
<a href="#{{ tag[0] }}">{{ tag[0] }}</a>
{% endfor %}
</div>
{% for tag in site.tags %}
<div class="tags-item" id="{{ tag[0] }}">
<svg
class="tags-item-icon"
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-tag"
>
<path
d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"
></path>
<line x1="7" y1="7" x2="7.01" y2="7"></line>
</svg>
<h2 class="tags-item-label">{{ tag[0] }}</h2>
{% for post in tag[1] %}
<a class="tags-post" href="{{ post.url | prepend: site.baseurl }}">
<div>
<span class="tags-post-title">{{ post.title }}</span>
<div class="tags-post-line"></div>
</div>
<span class="tags-post-meta">
<time datetime="{{ post.date }}">
{{ post.date | date:"%Y-%m-%d" }}
</time>
</span>
</a>
{% endfor %}
</div>
{% endfor %}
</div>

View File

@ -1,86 +1,89 @@
.tags {
&-header {
&-title {
color: $default-shade;
font-family: $sans-serif;
font-size: 4rem;
margin: 1rem 0;
text-align: center;
}
&-line {
border-top: 0.4rem solid $default-shade;
display: block;
margin: 0 auto 3rem;
width: 4rem;
}
}
&-clouds {
text-align: center;
font-family: $sans-serif;
&-header {
&-title {
color: $default-shade;
font-size: 2rem;
margin: 1rem 0 0 0;
text-align: center;
}
a {
display: inline-block;
margin: 0 0.1rem 0.2rem;
padding: 0.2rem 0.5rem;
background: rgba(0, 0, 0, 0.05);
border-radius: 5px;
color: $default-color;
text-decoration: none;
&-line {}
&:hover,
&:active {
background: rgba(0, 0, 0, 0.1);
}
}
}
&-item {
&-icon {
height: 1rem;
}
&-content {
&-clouds {
margin: 20px 0 15px 0;
text-align: center;
&-label {
display: inline-block;
margin: 2rem 0 0.5rem;
font-family: $sans-serif;
color: $default-color;
}
}
a {
font-size: 1rem;
background: #C0C0C0;
display: inline-block;
border: 1px solid rgba(255, 255, 255, 0.8);
border-radius: 999em;
padding: 0 10px;
color: #ffffff;
line-height: 24px;
text-decoration: none;
margin: 0 2px;
margin-bottom: 6px;
&-post {
display: flex;
justify-content: space-between;
padding: 5px 0;
&:hover,
&:active {
background-color: #DFDFDF !important;
color: white;
border-color: white;
text-decoration: none;
}
}
}
&-list {}
&-item {
&-seperator {
color: #808080;
font-size: 1.2rem !important;
&::before {
margin-right: 5px;
}
}
&-text {}
}
&-post {
margin: 10px;
&-title {
line-height: 1.3;
margin-top: 30px;
margin-bottom: 8px;
}
&-meta {
color: #CCC;
text-align: right;
float: right;
}
a {
color: #404040;
&:hover,
&:focus {
color: #808080;
}
}
}
&-title {
color: $default-color;
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
&-line {
@include transition(all 0.3s ease-out);
border-top: 0.1rem solid $default-shade;
display: block;
width: 0;
}
&-meta {
color: $default-tint;
text-align: right;
white-space: nowrap;
}
&:hover,
&:active {
.tags-post-line {
width: 3rem;
}
.tags-post-meta {
color: $default-shade;
}
}
}
}