💄 Add new tool buttons in page side.

This commit is contained in:
凡梦星尘
2022-09-25 21:40:36 +08:00
parent 523c12f0ec
commit 4037ea0d68
16 changed files with 1191 additions and 46 deletions

View File

@@ -3,6 +3,7 @@
{{- define "main_inner_class" }}flinks posts-expand{{- end }}
{{ define "main" }}
<div class="flinks-block">
<h1 class="flinks-block-title">{{ .Title }}</h1>
<div class="flinks-lists">
@@ -30,5 +31,4 @@
<div class="flinks-page-desc">{{ .Content }}</div>
</div>
{{ end }}

View File

@@ -5,7 +5,7 @@
{{- $fc := .active }}
{{- $sc := "" }}
{{- $sn := "" }}
<div class="post-comments">
<div id="comments" class="post-comments">
<div class="comment-head">
<div class="comment-headline">
<i class="fas fa-comments fa-fw"></i>

View File

@@ -1,4 +1,10 @@
{{- $ft := .Site.Params.footer }}
{{ if $ft.translate }}
<div class="google-translate">
<i class="fa fa-language"></i>
<div id="google_translate_element"></div>
</div>
{{ end }}
<div class="copyright">
&copy;
<span itemprop="copyrightYear">
@@ -18,36 +24,6 @@
</span>
<span class="author" itemprop="copyrightHolder">{{ $ft.copyright | default .Site.Params.author }}</span>
</div>
{{/* TODO
<!--
{{- if config.symbols_count_time.total_symbols or config.symbols_count_time.total_time }}
<div class="wordcount">
{{- if config.symbols_count_time.total_symbols }}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-chart-line"></i>
</span>
{{- if .Site.Params.symbols_count_time.item_text_total }}
<span>{{ __('symbols_count_time.count_total') + __('symbol.colon') }}</span>
{{- end }}
<span title="{{ __('symbols_count_time.count_total') }}">{{ symbolsCountTotal(site) }}</span>
</span>
{{- end }}
{{- if config.symbols_count_time.total_time }}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-coffee"></i>
</span>
{{- if .Site.Params.symbols_count_time.item_text_total }}
<span>{{ __('symbols_count_time.time_total') }} &asymp;</span>
{{- end }}
<span title="{{ __('symbols_count_time.time_total') }}">{{ symbolsTimeTotal(site, config.symbols_count_time.awl, config.symbols_count_time.wpm, __('symbols_count_time.time_minutes')) }}</span>
</span>
{{- end }}
</div>
{{- end }}
-->
*/}}
{{- with .Site.Params.busuanzi }}
{{- if .enable }}
<div class="busuanzi-count">

View File

@@ -61,8 +61,19 @@
{{- $search := resources.Get "js/third-party/search/algolia.js" }}
{{- $nextjs = $nextjs | append $search }}
{{ end }}
{{ if .Site.Params.footer.translate }}
{{- $gt := resources.Get "js/third-party/others/google-translate.js" }}
{{- $nextjs = $nextjs | append $gt }}
{{ $gtCss := resources.Get "css/gt.scss" }}
{{ $style := $gtCss | resources.ToCSS | minify }}
<script type="text/javascript">
window.translateelement_styles = "{{- $style.RelPermalink -}}";
</script>
{{ end }}
{{- $nextjs = $nextjs | resources.Concat "js/main.js"}}
{{ if hugo.IsProduction }}
{{- $nextjs = $nextjs | minify | fingerprint }}
{{ end }}
<script type="text/javascript" src="{{ $nextjs.RelPermalink }}" defer></script>

View File

@@ -1,9 +1,22 @@
{{- if and .Site.Params.backTop.enable (not .Site.Params.backTop.sidebar) }}
<div class="back-to-top" role="button" aria-label="{{ T "BackTopLabel" }}">
<div class="tool-buttons" >
<a id="goto-comments" class="button goto-comments" href="#comments" title="{{ T "ToolBtns.comment" }}">
<i class="fas fa-comments"></i>
</a>
<div class="button" title="{{ T "ToolBtns.theme" }}">
<i class="fas fa-adjust"></i>
</div>
{{ if .Site.Params.footer.translate }}
<a class="button" href="#google_translate_element" title="{{ T "ToolBtns.lang" }}">
<i class="fas fa-globe"></i>
</a>
{{ end }}
{{- if and .Site.Params.backTop.enable (not .Site.Params.backTop.sidebar) }}
<div class="back-to-top" role="button" title="{{ T "ToolBtns.backTop" }}">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
{{- end }}
{{- end }}
</div>
{{- if .Site.Params.readingProgress.enable }}
<div class="reading-progress-bar"></div>