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> <h2 class="nav-title">{{ site.title }}</h2>
</a> </a>
<ul> <ul>
<li><a href="{{ site.baseurl }}/">Posts</a></li>
<li><a href="{{ '/tags' | prepend: site.baseurl }}">Tags</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="{{ '/about' | prepend: site.baseurl }}">About</a></li>
<li><a href="{{ site.baseurl }}/">Posts</a></li>
</ul> </ul>
</div> </div>
</nav> </nav>

View file

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

View file

@ -1,49 +1,53 @@
--- ---
layout: default layout: default
permalink: /tags.html
title: "Tags" title: "Tags"
permalink: /tags/
--- ---
<div class="tags"> <div class="tags">
<div class="tags-header"> <div class="tags-header">
<div class="tags-header-title"> <h2 class="tags-header-title">{{ page.title }}</h2>
<h2>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</h2>
</div>
<div class="tags-header-line"></div> <div class="tags-header-line"></div>
</div> </div>
<div class="tags-content"> <div class="tags-clouds">
<div class="tags-content-clouds">
{% for tag in site.tags %} {% for tag in site.tags %}
<a href="#{{ tag[0] }}" title="{{ tag[0] }}" rel="{{ tag[1].size }}"> <a href="#{{ tag[0] }}">{{ tag[0] }}</a>
{{ tag[0] }}
</a>
{% endfor %} {% endfor %}
</div> </div>
<div class="tags-content-list">
{% for tag in site.tags %} {% for tag in site.tags %}
<div class="tags-content-item"> <div class="tags-item" id="{{ tag[0] }}">
<span class="tags-content-item-seperator" id="{{ tag[0] }}"> <svg
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24"> class="tags-item-icon"
<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> xmlns="http://www.w3.org/2000/svg"
<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> width="20"
<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> 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> </svg>
<span class="tags-content-item-text">{{ tag[0] }}</span> <h2 class="tags-item-label">{{ tag[0] }}</h2>
</span>
{% for post in tag[1] %} {% for post in tag[1] %}
<div class="tags-content-post"> <a class="tags-post" href="{{ post.url | prepend: site.baseurl }}">
<a href="{{ post.url}}" title="{{ post.title }}"> <div>
<span class="tags-content-post-title">{{ post.title }}</span> <span class="tags-post-title">{{ post.title }}</span>
</a> <div class="tags-post-line"></div>
<span class="tags-content-post-meta"> </div>
<time datetime="{{ post.date | date:'%Y-%m-%d' }}"> <span class="tags-post-meta">
<time datetime="{{ post.date }}">
{{ post.date | date:"%Y-%m-%d" }} {{ post.date | date:"%Y-%m-%d" }}
</time> </time>
</span> </span>
</div> </a>
<!-- <hr> -->
{% endfor %} {% endfor %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div>
</div>

View file

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