👷 Add sidebar site overview content.

This commit is contained in:
凡梦星尘 2022-05-27 16:25:56 +08:00
parent cdbb3f751a
commit f56f229bd7
13 changed files with 184 additions and 31 deletions

View File

@ -13,6 +13,9 @@
} }
.cc-license { .cc-license {
margin-top: 6px;
.cc-opacity { .cc-opacity {
border-bottom: 0; border-bottom: 0;
opacity: .7; opacity: .7;

View File

@ -1,4 +1,4 @@
.links-of-author { .links-of-author, .links-of-social {
a { a {
font-size: $font-size-smaller; font-size: $font-size-smaller;
} }

View File

@ -8,6 +8,11 @@
// Fix issue #103 // Fix issue #103
// The click area of the link becomes smaller // The click area of the link becomes smaller
padding: 0 15px; padding: 0 15px;
border-left: 1px solid #eee;
&:first-child {
border-left: none;
}
a { a {
border-bottom: 0; border-bottom: 0;
@ -15,6 +20,8 @@
} }
} }
.site-state-item-count { .site-state-item-count {
display: block; display: block;
font-size: $site-state-item-count-font-size; font-size: $site-state-item-count-font-size;

View File

@ -51,7 +51,7 @@
} }
} }
.links-of-author { .links-of-author, .links-of-social {
&:not(:first-child) { &:not(:first-child) {
margin-top: 15px; margin-top: 15px;
} }

View File

@ -49,11 +49,11 @@
} }
} }
.links-of-author { .links-of-author, .links-of-social {
@include flex-wrap(); @include flex-wrap();
} }
.links-of-author-item { .links-of-author-item, .links-of-social-item {
@include sidebar-inline-links-item(); @include sidebar-inline-links-item();
@if not $social_icons_only { @if not $social_icons_only {

View File

@ -1,9 +1,9 @@
# Public CDN vendor list # Public CDN vendor list
# #
vendors: { vendors:
"cdnjs": "//cdnjs.cloudflare.com/ajax/libs/${name}/${version}/${file}", cdnjs: "//cdnjs.cloudflare.com/ajax/libs/${name}/${version}/${file}"
"unpkg": "//unpkg.com/${name}@${version}/${file}" unpkg: "//unpkg.com/${name}@${version}/${file}"
}
# Javascript Resources # Javascript Resources
# #

View File

@ -116,8 +116,8 @@ params:
# Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero # Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero
license: by-nc-sa license: by-nc-sa
# Available values: big | small # Available values: big | small
size: small size: big
sidebar: false sidebar: true
post: false post: false
# You can set a language value if you prefer a translated version of CC license, e.g. deed.zh # You can set a language value if you prefer a translated version of CC license, e.g. deed.zh
# CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org # CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org
@ -175,7 +175,7 @@ params:
# Manual define the sidebar width. If commented, will be default for: # Manual define the sidebar width. If commented, will be default for:
# Muse | Mist: 320 # Muse | Mist: 320
# Pisces | Gemini: 240 # Pisces | Gemini: 240
width: 240 width: 256
# Sidebar Display (only for Muse | Mist), available values: # Sidebar Display (only for Muse | Mist), available values:
# - post expand on posts automatically. Default. # - post expand on posts automatically. Default.
@ -192,11 +192,11 @@ params:
# Sidebar Avatar # Sidebar Avatar
avatar: avatar:
# Replace the default image and set the url here. # Replace the default image and set the url here.
url: #/images/avatar.gif url: /imgs/hugo_next_avatar.png
# If true, the avatar will be displayed in circle. # If true, the avatar will be displayed in circle.
rounded: false rounded: true
# If true, the avatar will be rotated with the cursor. # If true, the avatar will be rotated with the cursor.
rotated: false rotated: true
# Posts / Categories / Tags in sidebar. # Posts / Categories / Tags in sidebar.
siteState: true siteState: true
@ -205,10 +205,18 @@ params:
# Usage: `Key: permalink || icon` # Usage: `Key: permalink || icon`
# Key is the link label showing to end users. # Key is the link label showing to end users.
# Value before `||` delimiter is the target permalink, value after `||` delimiter is the name of Font Awesome icon. # Value before `||` delimiter is the target permalink, value after `||` delimiter is the name of Font Awesome icon.
social: socials:
#GitHub: https://github.com/yourname || fab fa-github # - name: GitHub
#E-Mail: mailto:yourname@gmail.com || fa fa-envelope # icon: fab fa-github
#Weibo: https://weibo.com/yourname || fab fa-weibo # url: https://github.com/yourname
# weight: 1
# - name: 微博
# icon: fab fa-weibo
# url: https://weibo.com/yourname
# weight: 2
social0: Github || https://github.com/elkan1788 || fab fa-github
#social1: E-Mail || mailto:yourname@gmail.com || fa fa-envelope
social2: 知乎 || https://www.zhihu.com/people/lisenhui || fa fa-book
#Google: https://plus.google.com/yourname || fab fa-google #Google: https://plus.google.com/yourname || fab fa-google
#Twitter: https://twitter.com/yourname || fab fa-twitter #Twitter: https://twitter.com/yourname || fab fa-twitter
#FB Page: https://www.facebook.com/yourname || fab fa-facebook #FB Page: https://www.facebook.com/yourname || fab fa-facebook
@ -220,17 +228,18 @@ params:
socialIcons: socialIcons:
enable: true enable: true
iconsOnly: false iconsOnly: false
transition: false transition: true
# Blog rolls # Blog rolls
linksSets: linksSets:
icon: fa fa-globe icon: fa fa-globe
title: Links title: 友情链接
# Available values: block | inline # Available values: block | inline
layout: block layout: inline
links: links:
#Title: https://example.com link0: Hugo-NexT || https://gitee.com/hugo-next/hugo-theme-next
link1: 凡梦星尘空间站 || https://lisenhui.cn
# Table of Contents in the Sidebar # Table of Contents in the Sidebar
# Front-matter variable (nonsupport wrap expand_all). # Front-matter variable (nonsupport wrap expand_all).

View File

@ -10,10 +10,10 @@ publishDate: '2022-05-21T17:06:24+08:00'
weight: 1 weight: 1
categories: categories:
- - Blog
tags: tags:
- - Hugo
- - Startup
toc: false toc: false
draft: true draft: true

View File

@ -11,20 +11,22 @@ MSearchLabel:
ColoneFlag: ColoneFlag:
other: ":" other: ":"
SitePostsTitle: SbPostsLable:
other: "日志" other: "日志"
SiteCatesTitle: SbCatesTitle:
other: "分类" other: "分类"
SiteTagsTitle: SbTagsTitle:
other: "标签" other: "标签"
TableOfContents: TableOfContents:
other: "文章目录" other: "文章目录"
SiteInfo: SiteOverview:
other: "站点概览" other: "站点概览"
RSSTitle: RSSLable:
other: "RSS 订阅" other: "RSS 订阅"
CCLinkTitle: CCLinkTitle:
other: "共享知识" other: "共享知识"
BackTop:
other: "返回顶部"
PostPublishDate: PostPublishDate:
other: "发表于" other: "发表于"

View File

@ -35,6 +35,7 @@
</div> </div>
<!-- Sidebar --> <!-- Sidebar -->
{{- if ne $P.sidebar.display "remove" }} {{- if ne $P.sidebar.display "remove" }}
{{- partial "sidebar" (dict "P" $P "Page" .Page "Scratch" .Scratch) }}
{{- end }} {{- end }}
</header> </header>
<!-- Widgets --> <!-- Widgets -->

View File

@ -0,0 +1,37 @@
<div class="toggle sidebar-toggle" role="button">
<span class="toggle-line"></span>
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</div>
<aside class="sidebar">
{{- $toc := and (isset .Page.Params "toc") .Page.Params.toc }}
<div class="sidebar-inner {{ if $toc }}sidebar-nav-active sidebar-toc-active{{ else }}sidebar-overview-active{{ end }}">
<ul class="sidebar-nav">
<li class="sidebar-nav-toc">
{{ T "TableOfContents" }}
</li>
<li class="sidebar-nav-overview">
{{ T "SiteOverview" }}
</li>
</ul>
<div class="sidebar-panel-container">
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">
{{- if $toc }}
<div class="post-toc animated">{{ .Page.TableOfContents }}</div>
{{- end }}
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
{{ partial "sidebar/overview" . }}
</div>
</div>
{{- if and .P.backTop.enable .P.backTop.sidebar }}
<div class="back-to-top animated" role="button" aria-label="{{ T "BackTop" }}">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
{{- end }}
</div>
</aside>
<div class="sidebar-dimmer"></div>

View File

View File

@ -0,0 +1,94 @@
{{- $author := .P.author }}
{{- $Site := .Page.Site }}
<div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
{{- with .P.avatar.url }}
<img class="site-author-image" itemprop="image" alt="{{ $author }}"
src="{{ . }}">
{{- end }}
<p class="site-author-name" itemprop="name">{{ $author }}</p>
<div class="site-description" itemprop="description">{{ .P.description }}</div>
</div>
{{- if .P.siteState }}
<div class="site-state-wrap site-overview-item animated">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="{{ "/archives/" | relLangURL }}">
<span class="site-state-item-count">{{ len $Site.RegularPages }}</span>
<span class="site-state-item-name">{{ T "SbPostsLable" }}</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 "SbCatesTitle" }}</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 "SbTagsTitle" }}</span>
</a>
</div>
</nav>
</div>
{{- end }}
{{- if and .P.chat.enable (or (or .P.chatra.enable .P.tidio.enable) .P.gitter.enable) }}
<div class="sidebar-button site-overview-item animated">
<button {{ if .P.gitter.enable }} class="js-gitter-toggle-chat-button" {{ end }}>
{{- if .P.chat.icon }}<i class="{{ .P.chat.icon }}"></i>{{ end }}
{{ .P.chat.text }}
</button>
</div>
{{- end }}
<div class="links-of-social site-overview-item animated">
{{ $si := .P.socialIcons }}
{{ range $key,$val := .P.socials }}
{{- $vals := split $val "||" }}
{{- $name := trim (index $vals 0) " " }}
{{- $url := trim (index $vals 1) " " }}
{{- $icon := trim (index $vals 2) " " }}
<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 }}
</div>
{{- $lang := .Scratch.Get "lang" }}
{{- with .P.creativeCommons }}
{{- if .sidebar }}
<div class="cc-license animated" itemprop="license">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr $lang 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "CCLinkTitle" }}">
<img src="/imgs/cc/{{ .size }}/{{ replace .license "-" "_" }}.svg" alt="{{ T "CCLinkTitle" }}">
</a>
</div>
{{- end }}
{{- end }}
{{- if .P.links }}
<div class="links-of-blogroll site-overview-item animated">
<div class="links-of-blogroll-title">
{{- if .P.linksSets.icon }}
<i class="{{ .P.linksSets.icon }} fa-fw"></i>
{{- end }}
{{- .P.linksSets.title }}
</div>
<ul class="links-of-blogroll-list">
{{- range $key,$val := .P.links }}
{{- $vals := split $val "||" }}
{{- $name := trim (index $vals 0) " " }}
{{- $url := trim (index $vals 1) " " }}
<li class="links-of-blogroll-item">
<a href="{{ $url }}" title="{{ $url }}" target="_blank">{{ $name }}</a>
</li>
{{- end }}
</ul>
</div>
{{- end }}