feat: faster, support custom lib cdn and more standardized code style

This commit is contained in:
Dillon
2019-08-23 02:01:22 +08:00
parent f1ec275c9f
commit 934c3a5156
60 changed files with 10458 additions and 170 deletions

View File

@@ -1,4 +1,4 @@
{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }}
{{ define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end }}
{{ define "content" }}
{{ $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
@@ -31,7 +31,7 @@
<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 -}}
{{- 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>
@@ -40,7 +40,9 @@
</div>
{{ with .Params.featured_image }}
<img src=/images/loading.svg data-sizes=auto data-src={{ . }} alt="featured image" class="featured_image lazyload">
<div class="post-featured-image">
<img src=/images/loading.svg data-sizes=auto data-src={{ . }} alt="featured image" class="featured_image lazyload">
</div>
{{ end }}
{{ if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}