feat: add bilibili diagram echarts and improve style

This commit is contained in:
Dillon
2019-08-17 23:16:09 +08:00
parent 00b6b7f6ce
commit 6981f1e285
26 changed files with 1182 additions and 133 deletions

View File

@@ -22,33 +22,39 @@
{{ range . }}
{{- $name := . -}}
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
<i class="far fa-folder"></i>&nbsp;
<a href="{{ .Permalink }}">{{ $name }}</a>
<i class="far fa-folder"></i>&nbsp;<a href="{{ .Permalink }}">{{ $name }}</a>
{{ end -}}
{{ end }}
</span>
{{- end }}
</div>
<div class="post-meta-other">
<i class="far fa-calendar-alt"></i>&nbsp;
<span class="post-time"><time datetime={{ $publish_date }}>{{ $publish_date }}</time></span>&nbsp;
<i class="fas fa-pencil-alt"></i>&nbsp;
{{ T "wordCount" .WordCount }}&nbsp;
<i class="far fa-clock"></i>&nbsp;
{{ T "readingTime" .ReadingTime }}&nbsp;
{{ if and .Site.Params.valine.enable .Site.Params.valine.visitor }}
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
<i class="far fa-eye"></i>
{{ T "pageviews" | safeHTML }}
</span>
{{ end }}
<span class="post-time"><i class="far fa-calendar-alt"></i>&nbsp;<time datetime={{ $publish_date }}>{{ $publish_date }}</time>&nbsp;</span>
<i class="fas fa-pencil-alt"></i>&nbsp;{{ T "wordCount" .WordCount }}&nbsp;
<i class="far fa-clock"></i>&nbsp;{{ T "readingTime" .ReadingTime }}&nbsp;
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.valine.enable | and .Site.Params.valine.visitor -}}
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
<i class="far fa-eye"></i>&nbsp;{{ T "pageviews" | safeHTML }}&nbsp;
</span>
{{- end -}}
</div>
</div>
{{ if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
<div class="post-toc" id="post-toc">
<h2 class="post-toc-title">{{ T "toc" }}</h2>
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
<div class="post-toc-content{{ if not (or .Params.autoCollapseToc (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false))) }} always-active{{ end }}">
{{.TableOfContents}}
</div>
</div>
{{- end }}
<div class="post-content">
<!--featured_image-->
{{ with .Params.featured_image }}
<img src="{{ . }}" class="featured_image">
<img src=/images/loading.svg data-sizes=auto data-src={{ . }} alt="featured image" class="featured_image lazyload">
{{ end }}
<!-- end featured_image-->
@@ -60,45 +66,39 @@
{{ $finalContent := $altContent | replaceRE $reAltTitleIn $reAltTitleOut | safeHTML }}
{{ $finalContent }}
</div>
<div class="post-info">
<p class="post-info-item">
<span>{{ T "lastMod" }}:</span>
<span>{{ $modify_date }}</span>
</p>
<p class="post-info-item">
{{ if and ( $.Param "socialShare" ) (gt (len ($.Param "share")) 0) }}
<span>{{ T "share" }}:</span>
<span>{{ partial "post/share-links.html" . }}</span>
{{ end }}
</p>
</div>
<div class="post-tags">
<section>
{{ with .Params.tags }}
{{ range . }}
<span class="tag">
<i class="fas fa-tag"></i><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">&nbsp;{{.}}&nbsp;</a>
</span>
<div class="post-footer">
<div class="post-info">
<div class="post-info-mod"><span>{{ printf (T "lastMod") $modify_date }}</span></div>
<div class="post-info-share">
{{ if and ( $.Param "socialShare" ) (gt (len ($.Param "share")) 0) }}
<span>{{ partial "post/share-links.html" . }}</span>
{{ end }}
{{ end }}
</section>
<section>
<span><a href="javascript:window.history.back();">{{ T "back" }}</a></span>
|
<span><a href="{{ .Site.BaseURL }}">{{ T "home" }}</a></span>
</section>
</div>
</div>
</div>
<div class="post-nav">
{{ if .PrevInSection }}
<a href="{{.PrevInSection.Permalink}}" class="prev" rel="prev" title="{{ .PrevInSection.Title}}"><i class="fas fa-angle-left"></i>&nbsp;{{ .PrevInSection.Title}}</a>
{{ end }}
{{ if .NextInSection }}
<a href="{{.NextInSection.Permalink}}" class="next" rel="next" title="{{.NextInSection.Title}}">{{.NextInSection.Title}}&nbsp;<i class="fas fa-angle-right"></i></a>
{{ end }}
<div class="post-tags">
<section>
{{ with .Params.tags }}
{{ range . }}
<span class="tag">
<i class="fas fa-tag"></i><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">&nbsp;{{.}}&nbsp;</a>
</span>
{{ end }}
{{ end }}
</section>
<section>
<span><a href="javascript:window.history.back();">{{ T "back" }}</a></span>&nbsp;|&nbsp;<span><a href="{{ .Site.BaseURL }}">{{ T "home" }}</a></span>
</section>
</div>
<div class="post-nav">
{{ if .PrevInSection }}
<a href="{{.PrevInSection.Permalink}}" class="prev" rel="prev" title="{{ .PrevInSection.Title}}"><i class="fas fa-angle-left"></i>&nbsp;{{ .PrevInSection.Title}}</a>
{{ end }}
{{ if .NextInSection }}
<a href="{{.NextInSection.Permalink}}" class="next" rel="next" title="{{.NextInSection.Title}}">{{.NextInSection.Title}}&nbsp;<i class="fas fa-angle-right"></i></a>
{{ end }}
</div>
</div>
<div class="post-comment">