💄🔧 Update the sidebar info.

This commit is contained in:
凡梦星尘 2023-01-02 18:00:44 +08:00
parent a2019876a2
commit 835e98d85d
7 changed files with 36 additions and 114 deletions

View File

@ -18,9 +18,6 @@ CateTitle:
AllSome: AllSome:
other: "All {{ .Some }}" other: "All {{ .Some }}"
NavToggleLabel:
other: Toggle navigation bar
MSearchLabel: MSearchLabel:
other: Search other: Search
@ -31,12 +28,23 @@ SymbolComma:
SymbolPeriod: SymbolPeriod:
other: "." other: "."
Sidebar:
label:
posts: Posts
categories: Categories
tags: Tags
rss: RSS
ccommons: "Creative Commons"
navToggle: "Toggle Navigation Bar"
toc: TOC
overview: Overview
SbPostsLable: SbPostsLable:
other: "Posts" other: ""
SbCatesTitle: SbCatesTitle:
other: "Categories" other: ""
SbTagsTitle: SbTagsTitle:
other: "Tags" other: ""
TableOfContents: TableOfContents:
other: "TOC" other: "TOC"
SiteOverview: SiteOverview:

View File

@ -32,20 +32,17 @@ SymbolComma:
SymbolPeriod: SymbolPeriod:
other: "。" other: "。"
SbPostsLable: Sidebar:
other: 日志 label:
SbCatesTitle: posts: 日志
other: 分类 categories: 分类
SbTagsTitle: tags: 标签
other: 标签 rss: RSS 订阅
TableOfContents: ccommons: 共享知识
other: 文章目录 toc: 文章目录
SiteOverview: overview: 站点概览
other: 站点概览 navToggle: 切换导航栏
RSSLable: search: 搜索
other: RSS 订阅
CCLinkTitle:
other: 共享知识
TagsCounterTitle: TagsCounterTitle:
zero: 暂无标签 zero: 暂无标签

View File

@ -17,7 +17,7 @@
{{ if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }} {{ if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }}
<li class="menu-item menu-item-search"> <li class="menu-item menu-item-search">
<a role="button" class="popup-trigger hvr-icon-pulse"> <a role="button" class="popup-trigger hvr-icon-pulse">
{{ if $ms.icons }}<i class="fa fa-search fa-fw hvr-icon"></i>{{ end }}{{ T "MSearchLabel" }} {{ if $ms.icons }}<i class="fa fa-search fa-fw hvr-icon"></i>{{ end }}{{ T "Sidebar.label.search" }}
</a> </a>
</li> </li>
{{ end }} {{ end }}

View File

@ -1,82 +0,0 @@
{{ $SP := .Site.Params }}
<aside class="sidebar">
<div class="sidebar-inner sidebar-overview-active">
<ul class="sidebar-nav">
<li class="sidebar-nav-toc">{{ T "TableOfContents" }}</li>
<li class="sidebar-nav-overview">{{ T "SiteInfo" }}</li>
</ul>
<div class="sidebar-panel-container">
<div class="post-toc-wrap sidebar-panel">
</div>
<div class="site-overview-wrap sidebar-panel">
<div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image" alt="{{ $SP.author }}" src="{{ $SP.avatar.url }}">
<p class="site-author-name" itemprop="name">{{ $SP.author }}</p>
<div class="site-description" itemprop="description">{{ $SP.description }}</div>
</div>
<div class="site-state-wrap site-overview-item animated">
{{ if $SP.siteState }}
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="{{ "/archives/" | relLangURL }}">
<span class="site-state-item-count">{{ len (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}</span>
<span class="site-state-item-name">{{ T "SitePostsTitle" }}</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="{{ "/categories/" | relLangURL }}">
<span class="site-state-item-count">{{ len .Site.Taxonomies.categories }}</span>
<span class="site-state-item-name">{{ T "SiteCatesTitle" }}</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="{{ "/tags/" | relLangURL }}">
<span class="site-state-item-count">{{ len .Site.Taxonomies.tags }}</span>
<span class="site-state-item-name">{{ T "SiteTagsTitle" }}</span>
</a>
</div>
</nav>
{{ end }}
<div class="rss-link">
<a href="{{ "/index.xml" | relLangURL }}" rel="alternate" type="application/rss+xml" target="_blank">
<i class="fa fa-rss"></i>
{{ T "RSSTitle" }}
</a>
</div>
</div>
<div class="links-of-social site-overview-item animated">
{{ $si := $SP.socialIcons }}
{{ range $SP.socials }}
{{ range $name,$val := . }}
{{ $vals := split $val "||" }}
{{ $url := trim (index $vals 0) " " }}
{{ $icon := trim (index $vals 1) " " }}
<span class="links-of-social-item">
<a href="{{ $url }}" title="{{ $name }} → {{ $url }}" rel="noopener" {{ if and $si.enable $si.transition }} class="hvr-icon-pulse" {{ end }} target="_blank">
{{ if $si.enable }}
<i class="{{ $icon }} fa-fw {{ if $si.transition }} hvr-icon {{ end }}"></i>
{{ end }}
{{ if or (not $si.enable) (not $si.iconsOnly) }}
{{ $name }}
{{ end }}
</a>
</span>
{{ end }}
{{ end }}
</div>
{{ $cc := $SP.creativeCommons }}
{{ if and $cc $cc.sidebar }}
<div class="cc-license animated" itemprop="license">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr .Site.Language 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "CCLinkTitle" }}">
<img src="/imgs/cc/{{ $cc.size }}/{{ replace $cc.license "-" "_" }}.svg" alt="{{ T "CCLinkTitle" }}">
</a>
</div>
{{ end }}
</div>
</div>
<div class="back-to-top" role="button" aria-label="返回顶部">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
</div>
</aside>

View File

@ -1,6 +1,6 @@
{{ if .Site.Params.creativeCommons.post }} {{ if .Site.Params.creativeCommons.post }}
<div class="post-copyright"> <div class="post-copyright">
<img src="/imgs/cc/cc.svg" width="75" height="75" align="right" alt="{{ T "CCLinkTitle" }}"/> <img src="/imgs/cc/cc.svg" width="75" height="75" align="right" alt="{{ T "Sidebar.label.ccommons" }}"/>
<ul> <ul>
<li class="post-copyright-title"> <li class="post-copyright-title">
<strong>{{ print (T "PostCopyRight.title") (T "SymbolColon") }}</strong> <strong>{{ print (T "PostCopyRight.title") (T "SymbolColon") }}</strong>

View File

@ -3,16 +3,15 @@
<span class="toggle-line"></span> <span class="toggle-line"></span>
<span class="toggle-line"></span> <span class="toggle-line"></span>
</div> </div>
<aside class="sidebar">
{{ $tocEnable := and .IsPage .Params.toc | default .Site.Params.toc.enable }} {{ $tocEnable := and .IsPage .Params.toc | default .Site.Params.toc.enable }}
<aside class="sidebar">
<div class="sidebar-inner {{ if $tocEnable }}sidebar-nav-active sidebar-toc-active{{ else }}sidebar-overview-active{{ end }}"> <div class="sidebar-inner {{ if $tocEnable }}sidebar-nav-active sidebar-toc-active{{ else }}sidebar-overview-active{{ end }}">
<ul class="sidebar-nav"> <ul class="sidebar-nav">
<li class="sidebar-nav-toc"> <li class="sidebar-nav-toc">
{{ T "TableOfContents" }} {{ T "Sidebar.label.toc" }}
</li> </li>
<li class="sidebar-nav-overview"> <li class="sidebar-nav-overview">
{{ T "SiteOverview" }} {{ T "Sidebar.label.overview" }}
</li> </li>
</ul> </ul>
<div class="sidebar-panel-container"> <div class="sidebar-panel-container">

View File

@ -14,19 +14,19 @@
<div class="site-state-item site-state-posts"> <div class="site-state-item site-state-posts">
<a href="{{ "/archives/" | relLangURL }}"> <a href="{{ "/archives/" | relLangURL }}">
<span class="site-state-item-count">{{ .Scratch.Get "postsCount" }}</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 "Sidebar.label.posts" }}</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">{{ .Scratch.Get "catsCount" }}</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 "Sidebar.label.categories" }}</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">{{ .Scratch.Get "tagsCount" }}</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 "Sidebar.label.tags" }}</span>
</a> </a>
</div> </div>
</nav> </nav>
@ -63,8 +63,8 @@
{{ with .Site.Params.creativeCommons }} {{ with .Site.Params.creativeCommons }}
{{ if .sidebar }} {{ if .sidebar }}
<div class="cc-license animated" itemprop="license"> <div class="cc-license animated" itemprop="license">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr $.Site.LanguageCode 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "CCLinkTitle" }}"> <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr $.Site.LanguageCode 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "Sidebar.label.ccommons" }}">
<img src="/imgs/img-lazy-loading.gif" data-src="/imgs/cc/{{ .size }}/{{ replace .license "-" "_" }}.svg" alt="{{ T "CCLinkTitle" }}"> <img src="/imgs/img-lazy-loading.gif" data-src="/imgs/cc/{{ .size }}/{{ replace .license "-" "_" }}.svg" alt="{{ T "Sidebar.label.ccommons" }}">
</a> </a>
</div> </div>
{{ end }} {{ end }}