🎨 Finish all baseof display coding.

This commit is contained in:
凡梦星尘 2022-06-09 09:12:22 +08:00
parent 2973eaf85d
commit 3bc7506f36
20 changed files with 262 additions and 94 deletions

View File

@ -1,10 +1,14 @@
.category-all-page { .category-all-page {
min-height: 700px;
.category-all-title { .category-all-title {
font-size: 1.35em;
text-align: center; text-align: center;
} }
.category-all { .category-all {
margin-top: 20px; margin-top: 40px;
} }
.category-list { .category-list {

View File

@ -1,5 +1,19 @@
.tag-cloud { .tag-cloud {
text-align: center; text-align: center;
min-height: 700px;
.tag-cloud-title {
text-align: center;
font-size: 1.35em;
.tag-list-count {
font-size: 0.56em;
}
}
.tag-cloud-tags {
margin-top: 40px;
}
a { a {
display: inline-block; display: inline-block;
@ -12,6 +26,7 @@
.tag-cloud-#{$tag-cloud} { .tag-cloud-#{$tag-cloud} {
border-bottom-color: $tag-cloud-color; border-bottom-color: $tag-cloud-color;
color: $tag-cloud-color; color: $tag-cloud-color;
font-size: #{0.85+($tag-cloud * 0.05)}em
} }
} }

View File

@ -116,6 +116,6 @@
@if $busuanzi_enable and $busuanzi_post_views { @if $busuanzi_enable and $busuanzi_post_views {
#busuanzi_container_page_pv { #busuanzi_container_page_pv {
display: none; display: inline-block;
} }
} }

View File

@ -0,0 +1,4 @@
.fa-spin {
-webkit-animation: fa-spin .8s infinite linear;
animation: fa-spin .8s infinite linear;
}

View File

@ -0,0 +1 @@
@import 'animation';

View File

@ -10,3 +10,4 @@
@import 'tags'; @import 'tags';
@import 'pagination'; @import 'pagination';
@import 'comments'; @import 'comments';
@import 'fontawesome';

View File

@ -47,16 +47,13 @@ BackTopLabel:
TagsCounterTitle: TagsCounterTitle:
zero: 暂无标签 zero: 暂无标签
one: 目前共计 1 个标签 other: "目前共计 <strong>{{ .Count }}</strong> 个标签"
other: "目前共计 %d 个标签"
CatesCounterTitle: CatesCounterTitle:
zero: 暂无分类 zero: 暂无分类
one: 目前共计 1 个分类 other: "目前共计 <strong>{{ .Count }}</strong> 个分类"
other: "目前共计 %d 个分类"
ArchiveCounterTitle: ArchiveCounterTitle:
zero: 暂无日志。 zero: 暂无日志
one: 目前共计 1 篇日志 other: "目前共计 <strong>{{ .Count }}</strong> 篇日志"
other: "目前共计 {{ .Count }} 篇日志"
PostArchiveCheersUm: PostArchiveCheersUm:
other: 嗯.. other: 嗯..
@ -92,7 +89,7 @@ PostReading:
PostReadTime: PostReadTime:
other: "{{- .ReadingTime -}}分钟" other: "{{- .ReadingTime -}}分钟"
PostViews: PostViews:
other: 浏览 other: 浏览
PostCatgs: PostCatgs:
other: 分类 other: 分类
PostTags: PostTags:

View File

@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}" dir="{{ $.Param "contentdir" | default "zh" }}">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8;"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="robots" content="all" />
<meta name="robots" content="index,follow"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="{{ i18n "404PageTitle" }}"/>
<link rel="shortcut icon" href="/img/favicon.ico" />
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png" />
<link rel="apple-touch-icon-precomposed" href="/img/apple-touch-icon.png" />
<script type="text/javascript" src="https://volunteer.cdn-go.cn/404/latest/404.js" rendertarget="public_page"></script>
<title>{{ i18n "404PageTitle" }}</title>
<style type="text/css">
*{margin: 0;padding: 0;}
::-webkit-scrollbar {display:none}
.back_home_box {
box-sizing: border-box;
position: fixed;
top: 36px;
right: 50px;
z-index: 1050;
padding: 0;
width: initial;
font-size: 14px;
opacity: 0.6;
color: #fff;
cursor: pointer;
text-align: center;
}
.btn {
display:inline-block;
padding:6px 12px;
margin-bottom:0;
text-align:center;
white-space:nowrap;
vertical-align:middle;
-ms-touch-action:manipulation;
touch-action:manipulation;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
background-image:none;
border:1px solid transparent;
border-radius:4px
}
.btn:hover {
background-color: #ff3434;
}
.btn-primary {
color:#fff;
/* background-color:#337ab7; */
border-color:#2e6da4;
}
.btn_blue {
padding: 10px;
text-align: center;
border-radius: 8px;
background: #e26464;
color: #fff;
letter-spacing: 3px;
border: 0;
font-size: 18px;
text-decoration-line: none;
}
#public_page {
margin:0px;
padding:0px;
width: 100%;
height: 100%;
overflow-y: hidden;
overflow-x: hidden;
max-width: 100vw;
}
</style>
</head>
<body>
<div id="public_page"></div>
<div class="back_home_box">
<a href="{{ "/" | relLangURL }}" class="btn btn-primary btn_blue">返回主页</a>
</div>
</body>

View File

@ -1,3 +1,6 @@
{{- .Scratch.Set "postsCount" (len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)) -}}
{{- .Scratch.Set "catsCount" (len .Site.Taxonomies.categories) -}}
{{- .Scratch.Set "tagsCount" (len .Site.Taxonomies.tags) -}}
{{- $vendors := .Site.Data.resources.vendors -}} {{- $vendors := .Site.Data.resources.vendors -}}
{{- $pluginVen := .Site.Params.vendors.plugins -}} {{- $pluginVen := .Site.Params.vendors.plugins -}}
{{- $pluginCDN := index $vendors $pluginVen -}} {{- $pluginCDN := index $vendors $pluginVen -}}

View File

@ -7,7 +7,7 @@
<div class="post-content"> <div class="post-content">
<div class="collection-title"> <div class="collection-title">
{{- $cheers := "Um" }} {{- $cheers := "Um" }}
{{- $posts := .Scratch.Get "posts" }} {{- $posts := .Scratch.Get "postsCount" }}
{{- if gt $posts 210 }} {{- if gt $posts 210 }}
{{- $cheers = "Excellent" }} {{- $cheers = "Excellent" }}
{{- else if gt $posts 130 }} {{- else if gt $posts 130 }}
@ -21,9 +21,9 @@
{{- end }} {{- end }}
<span class="collection-header"> <span class="collection-header">
{{- T (printf "PostArchiveCheers%s" $cheers) }} {{- T (printf "PostArchiveCheers%s" $cheers) }}
{{- T "SymbolComma"}} {{- T "SymbolComma" }}
{{- T "ArchiveCounterTitle" $posts }} {{- T "ArchiveCounterTitle" $posts | safeHTML }}
{{- T "SymbolComma"}} {{- T "SymbolComma" }}
{{- T "PostArchiveKeepOn" }} {{- T "PostArchiveKeepOn" }}
</span> </span>
</div> </div>

View File

@ -1,6 +1,22 @@
{{- define "title" -}} {{- define "title" -}}
{{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title -}} {{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{ define "main_inner_class" }}{{ .Data.Plural }} posts-collapse{{ end }}
{{ define "main" }} {{ define "main" }}
{{ .Data.Singular }} <div class="post-block">
<div class="post-content">
<div class="collection-title">
<span class="collection-header">
<h2>
{{ .Title }}
<small>{{ T .Data.Singular | default .Data.Singular }}</small>
</h2>
</span>
</div>
{{ .Render "list" }}
</div>
</div>
{{- partial "pagination.html" . }}
{{- end }} {{- end }}

View File

@ -1,6 +1,44 @@
{{- define "title" -}} {{- define "title" -}}
{{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | dict "Some" | T "AllSome" }} - {{ .Site.Title -}} {{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | dict "Some" | T "AllSome" }} - {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{ define "main" }} {{- define "main_inner_class" }}{{.Data.Plural}} posts-expand{{ end -}}
{{ .Data.Terms }} {{- define "main" }}
{{ end }} <div class="post-block" lang="{{ .Site.LanguageCode }}">
<dive class="post-body">
{{- if eq .Data.Plural "categories" }}
{{ $cats := .Site.Taxonomies.categories }}
<div class="category-all-page">
<div class="category-all-title">
{{- T "CatesCounterTitle" (.Scratch.Get "catsCount") | safeHTML -}}
</div>
<div class="category-all">
<ul class="category-list">
{{- range $name, $items := $cats }}
<li class="category-list-item">
<a class="category-list-link" href="{{ "/categories/" | relLangURL }}{{ $name | urlize | lower }}" data-pjax-state="">{{ $name }}</a>
<span class="category-list-count">{{ len $items }}</span>
</li>
{{- end }}
</ul>
</div>
</div>
{{- end }}
{{- if eq .Data.Plural "tags" }}
{{ $tags := .Site.Taxonomies.tags }}
<div class="tag-cloud">
<div class="tag-cloud-title">
{{- T "TagsCounterTitle" (.Scratch.Get "tagsCount") | safeHTML -}}
</div>
<div class="tag-cloud-tags">
{{ $randNums := (seq 10) }}
{{- range $name, $items := $tags }}
<a class="tag-cloud-{{ index (shuffle $randNums) 0 }}" href="{{ "/tags/" | relLangURL }}{{ $name | urlize | lower }}">{{ $name }}
<span class="tag-list-count"><sup>({{ len $items }})</sup></span>
</a>
{{- end }}
</div>
</div>
{{- end }}
</div>
</div>
{{- end }}

View File

@ -1,5 +1,3 @@
{{ $posts := len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
{{- .Scratch.Set "posts" $posts -}}
{{- $ms := .Site.Params.menuSets }} {{- $ms := .Site.Params.menuSets }}
{{- $curP := .Page }} {{- $curP := .Page }}
<nav class="site-nav"> <nav class="site-nav">
@ -11,7 +9,7 @@
<a href="{{ .URL }}" class="hvr-icon-pulse {{if $active }} menu-item-active{{ end }}" rel="section"> <a href="{{ .URL }}" class="hvr-icon-pulse {{if $active }} menu-item-active{{ end }}" rel="section">
{{- if $ms.icons }}<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{ end }}{{- .Name }} {{- if $ms.icons }}<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{ end }}{{- .Name }}
{{- if and $ms.badges (eq .Identifier "archives" ) }} {{- if and $ms.badges (eq .Identifier "archives" ) }}
<span class="badge">{{ $posts }}</span> <span class="badge">{{ $.Scratch.Get "postsCount" }}</span>
{{- end }} {{- end }}
</a> </a>
</li> </li>

View File

@ -1,10 +1,28 @@
<div class="post-block"> <div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="{{ .Site.LauageCode }}"> <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="{{ .Site.LauageCode }}">
{{- with .ctx }}
<link itemprop="mainEntityOfPage" href="{{ .Permalink }}">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="{{ .Site.Params.avatar.url }}">
<meta itemprop="name" content="{{ .Params.author | default .Site.Params.author }}">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="{{ .Site.Params.author }}">
<meta itemprop="description" content="{{ .Site.Params.description }}">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="{{ .Title }}">
<meta itemprop="description" content="{{ .Description | default .Summary }}">
</span>
{{- end }}
<header class="post-header">
{{ partial "post/header.html" (dict "ctx" .ctx "IsHome" .IsHome) }} {{ partial "post/header.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
</header>
<div class="post-body" itemprop="articleBody">
{{ partial "post/body.html" (dict "ctx" .ctx "IsHome" .IsHome) }} {{ partial "post/body.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
</div>
<footer class="post-footer"> <footer class="post-footer">
{{ partial "post/footer.html" (dict "ctx" .ctx "IsHome" .IsHome) }} {{ partial "post/footer.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
</footer> </footer>
</article> </article>
</div> </div>

View File

@ -1,13 +1,11 @@
{{ with .ctx }} {{ with .ctx }}
<div class="post-body" itemprop="articleBody"> {{- if $.IsHome }}
{{- if $.IsHome }}
{{- if .Params.Expand }} {{- if .Params.Expand }}
{{ .Content }} {{ .Content }}
{{- else }} {{- else }}
{{ .Summary }} {{ .Summary }}
{{- end }} {{- end }}
{{- else }} {{- else }}
{{ .Content }} {{ .Content }}
{{- end }} {{- end }}
</div>
{{ end }} {{ end }}

View File

@ -1,19 +1,5 @@
{{ with .ctx }} {{ with .ctx }}
<link itemprop="mainEntityOfPage" href="{{ .Permalink }}"> {{- if $.IsHome }} <h2 {{ else }} <h1 {{ end -}} class="post-title" itemprop="name headline">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="{{ .Site.Params.avatar.url }}">
<meta itemprop="name" content="{{ .Params.author | default .Site.Params.author }}">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="{{ .Site.Params.author }}">
<meta itemprop="description" content="{{ .Site.Params.description }}">
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="{{ .Title }}">
<meta itemprop="description" content="{{ .Description | default .Summary }}">
</span>
<header class="post-header">
{{- if $.IsHome }} <h2 {{ else }} <h1 {{ end -}} class="post-title" itemprop="name headline">
{{- if and .Weight (gt .Weight 0) }} {{- if and .Weight (gt .Weight 0) }}
<span class="post-sticky-flag" title="{{ T "PostStickyTitle" }}"> <span class="post-sticky-flag" title="{{ T "PostStickyTitle" }}">
<i class="fa fa-thumbtack"></i> <i class="fa fa-thumbtack"></i>
@ -36,7 +22,7 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if $.IsHome }} </h2> {{ else }} </h1> {{ end -}} {{- if $.IsHome }} </h2> {{ else }} </h1> {{ end -}}
<div class="post-meta-container"> <div class="post-meta-container">
<div class="post-meta-items"> <div class="post-meta-items">
{{ partial "post/header_meta/created_date.html" . }} {{ partial "post/header_meta/created_date.html" . }}
{{ partial "post/header_meta/update_date.html" . }} {{ partial "post/header_meta/update_date.html" . }}
@ -49,6 +35,5 @@
{{ partial "post/header_meta/views.html" . }} {{ partial "post/header_meta/views.html" . }}
</div> </div>
{{ end }} {{ end }}
</div> </div>
</header>
{{ end }} {{ end }}

View File

@ -7,7 +7,7 @@
<span class="post-meta-item-text">{{- print (T "PostCatgs") (T "SymbolColon") -}}</span> <span class="post-meta-item-text">{{- print (T "PostCatgs") (T "SymbolColon") -}}</span>
{{- range (first 1 .Params.categories) }} {{- range (first 1 .Params.categories) }}
<span itemprop="about" itemscope itemtype="http://schema.org/Thing"> <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="{{ . | urlize }}" itemprop="url" rel="index"> <a href="/categories/{{ . | urlize }}" itemprop="url" rel="index">
<span itemprop="name">{{- . -}}</span> <span itemprop="name">{{- . -}}</span>
</a> </a>
</span> </span>

View File

@ -22,6 +22,6 @@
<i class="{{ .Site.Params.busuanzi.postViewsIcon }}"></i> <i class="{{ .Site.Params.busuanzi.postViewsIcon }}"></i>
</span> </span>
<span class="post-meta-item-text">{{ print (T "PostViews") (T "SymbolColon") }}</span> <span class="post-meta-item-text">{{ print (T "PostViews") (T "SymbolColon") }}</span>
<span id="busuanzi_value_page_pv"></span> <span id="busuanzi_value_page_pv"><i class="fa fa-sync fa-spin"></i></span>
</span> </span>
{{- end }} {{- end }}

View File

@ -3,7 +3,6 @@
<span class="post-meta-item-icon"> <span class="post-meta-item-icon">
<i class="far fa-file-word"></i> <i class="far fa-file-word"></i>
</span> </span>
<span class="post-meta-item-text">{{- print (T "PostWords") (T "SymbolColon") -}}</span> <span class="post-meta-item-text">{{- print (T "PostWords") (T "SymbolColon") -}}</span><span>{{- T "PostWordCount" . -}}</span>
<span>{{- T "PostWordCount" . -}}</span>
</span> </span>
{{- end }} {{- end }}

View File

@ -13,19 +13,19 @@
<nav class="site-state"> <nav class="site-state">
<div class="site-state-item site-state-posts"> <div class="site-state-item site-state-posts">
<a href="{{ "/posts/" | relLangURL }}"> <a href="{{ "/posts/" | relLangURL }}">
<span class="site-state-item-count">{{ .Scratch.Get "posts" }}</span> <span class="site-state-item-count">{{ .Scratch.Get "postsCount" }}</span>
<span class="site-state-item-name">{{ T "SbPostsLable" }}</span> <span class="site-state-item-name">{{ T "SbPostsLable" }}</span>
</a> </a>
</div> </div>
<div class="site-state-item site-state-categories"> <div class="site-state-item site-state-categories">
<a href="{{ "/categories/" | relLangURL }}"> <a href="{{ "/categories/" | relLangURL }}">
<span class="site-state-item-count">{{ len .Site.Taxonomies.categories }}</span> <span class="site-state-item-count">{{ .Scratch.Get "catsCount" }}</span>
<span class="site-state-item-name">{{ T "SbCatesTitle" }}</span> <span class="site-state-item-name">{{ T "SbCatesTitle" }}</span>
</a> </a>
</div> </div>
<div class="site-state-item site-state-tags"> <div class="site-state-item site-state-tags">
<a href="{{ "/tags/" | relLangURL }}"> <a href="{{ "/tags/" | relLangURL }}">
<span class="site-state-item-count">{{ len .Site.Taxonomies.tags }}</span> <span class="site-state-item-count">{{ .Scratch.Get "tagsCount" }}</span>
<span class="site-state-item-name">{{ T "SbTagsTitle" }}</span> <span class="site-state-item-name">{{ T "SbTagsTitle" }}</span>
</a> </a>
</div> </div>