Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiaoheiAh/hugo-theme-pure.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorotis <xiaohei.zyx@gmail.com>2019-12-31 17:34:50 +0300
committerotis <xiaohei.zyx@gmail.com>2019-12-31 17:34:50 +0300
commit2e8ad4f04155d878cc2a24dfcd2abcf5ab17a82c (patch)
tree9b0fa517a1aa707c8afe561c5b7b1ba8518a9292 /layouts
parentcc5d55842c57834a71dac41b281935e1017f0136 (diff)
minify css&js & async performance
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/article.html2
-rw-r--r--layouts/partials/head.html16
-rw-r--r--layouts/partials/item-post.html2
-rw-r--r--layouts/partials/script.html6
4 files changed, 7 insertions, 19 deletions
diff --git a/layouts/partials/article.html b/layouts/partials/article.html
index b0e7380..ec979cf 100644
--- a/layouts/partials/article.html
+++ b/layouts/partials/article.html
@@ -14,7 +14,7 @@
{{- partial "post/category.html" . }}
{{- partial "post/tag.html" . }}
{{- partial "post/pv.html" . }}
- <span class="post-comment"><i class="icon icon-comment"></i> <a href="{{ .RelPermalink }}#comments"
+ <span class="post-comment"><i class="icon icon-comment"></i>&nbsp;<a href="{{ .RelPermalink }}#comments"
class="article-comment-link">{{T "article_comments" }}</a></span>
{{- partial "post/wc.html" . }}
</div>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index afce617..88261db 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -46,30 +46,18 @@
{{- end -}}
</title>
<!-- Canonical links -->
-
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
-<<<<<<< HEAD
-
- <link rel="stylesheet" href="{{ "css/style.css" | absURL }}">
- <link rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/9.15.10/styles/github.min.css">
- {{- if eq .Site.Params.comment.type "gitalk"}}
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
- {{- end }}
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.css">
- {{ with .Site.Params.customCSS }}
- <link rel="stylesheet" href="{{ . | absURL }}">{{ end }}
-
-=======
{{ $css := resources.Get "css/style.css" | minify | fingerprint}}
<link rel="stylesheet" href="{{ $css.Permalink }}">
+ {{ with .Site.Params.customCSS }}
+ <link rel="stylesheet" href="{{ . | absURL }}" async>{{ end }}
<link rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/9.15.10/styles/github.min.css" async>
{{- if eq .Site.Params.comment.type "gitalk"}}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css" async>
{{- end }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.css" async>
->>>>>>> feat-optimization
{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/spf13/hugo/blob/master/tpl/tplimpl/template_embedded.go#L158 */}}
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/google_news.html" . -}}
diff --git a/layouts/partials/item-post.html b/layouts/partials/item-post.html
index 6acd9e2..e9fc2c4 100644
--- a/layouts/partials/item-post.html
+++ b/layouts/partials/item-post.html
@@ -1,6 +1,6 @@
<a href="{{- .Permalink }}" class="collection-item" itemprop="url" target="_blank">
{{- if .Date }}
- <time datetime="{{ .Date }}" itemprop="datePublished">
+ <time datetime="{{ .Date }}" itemprop="datePublished" style="margin-right: 5px;">
{{- .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
</time>
{{- end }}
diff --git a/layouts/partials/script.html b/layouts/partials/script.html
index ec8f898..f76e1ed 100644
--- a/layouts/partials/script.html
+++ b/layouts/partials/script.html
@@ -7,7 +7,7 @@
</script>
<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/highlight.min.js"></script>
{{- range .Site.Params.highlightjs.langs }}
-<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/{{.}}.min.js"></script>
+<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/{{.}}.min.js" defer></script>
{{- end -}}
<script>
hljs.configure({
@@ -39,8 +39,8 @@
})(window);
</script>
{{- $insight := resources.Get "js/insight.js" | resources.Minify | resources.Fingerprint "sha512" }}
-<script type="text/javascript" src="{{- $insight.Permalink }}"></script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.min.js"></script>
+<script type="text/javascript" src="{{- $insight.Permalink }}" defer></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.min.js" defer></script>
<script>
tocbot.init({
// Where to render the table of contents.