feat: new style and faster
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
{{ $style := resources.Get "css/main.scss" | resources.ToCSS | resources.Minify}}
|
||||
{{ $iconfont := resources.Get "font/iconfont.css" | resources.Minify }}
|
||||
<link rel="stylesheet" href="{{ $iconfont.RelPermalink }}">
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
@@ -3,13 +3,12 @@
|
||||
©
|
||||
{{ with .Site.Params.since }}
|
||||
<span itemprop="copyrightYear">{{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}</span>
|
||||
{{ else }}
|
||||
<span itemprop="copyrightYear">{{ now.Year }}</span>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.author }}
|
||||
<span class="author" itemprop="copyrightHolder"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author }}</a> |
|
||||
</span>
|
||||
{{ with .Site.Author.Name }}
|
||||
<span class="author" itemprop="copyrightHolder"><a href="{{ .Site.BaseURL }}">{{ . }}</a> | </span>
|
||||
{{ end }}
|
||||
<span>{{ (printf (T "powered") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>`) | safeHTML }} | {{ T "theme" }}<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt</a></span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{{ partial "js.html" . }}
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
{{ partial "css.html" . }}
|
||||
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link rel="alternate" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}">
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
{{ $cdn_url := .Scratch.Get "cdn_url" }}
|
||||
|
||||
<div class="intro">
|
||||
{{ $avatar := "" }}
|
||||
{{ if or .Params.gravatar.Email (and .Site.Params.gravatar.Email (ne .Params.gravatar.Email false)) }}
|
||||
{{ $avatar = (printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" (md5 .Site.Params.gravatar.email)) }}
|
||||
{{ else if .Site.Params.avatar }}
|
||||
{{ $avatar = (printf "%s%s" $cdn_url .Site.Params.avatar) }}
|
||||
{{ $avatar = .Site.Params.avatar }}
|
||||
{{ end }}
|
||||
{{ if $avatar }}
|
||||
<div class="avatar">
|
||||
@@ -22,12 +20,12 @@
|
||||
<div id={{ $id }} class="typeit"></div>
|
||||
<script>
|
||||
var typeitMap = window.typeitMap || {};
|
||||
typeitMap[{{ $id }}] = true;
|
||||
typeitMap["{{ $id }}"] = true;
|
||||
</script>
|
||||
</h2>
|
||||
{{ end }}
|
||||
|
||||
<div class="social-links">
|
||||
{{ partial "social.html" . }}
|
||||
{{ partial "home/social.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,59 +0,0 @@
|
||||
{{ $cdn_url := .Scratch.Get "cdn_url" }}
|
||||
|
||||
<div class="post-warp">
|
||||
{{ partial "intro.html" . }}
|
||||
{{ range (.Paginate (where .Pages "Type" "posts")).Pages }}
|
||||
<article class="post" itemscope itemtype="http://schema.org/Article">
|
||||
<header class="post-header">
|
||||
<h1 class="post-title" itemprop="name headline">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</h1>
|
||||
</header>
|
||||
<div class="post-content">
|
||||
<!--featured_image-->
|
||||
{{ with .Params.featured_image }}
|
||||
{{ $img := . }}
|
||||
<p>
|
||||
<img itemprop="image" src="{{ printf "%s%s" $cdn_url $img }}" class="featured_image">
|
||||
</p>
|
||||
{{ end }}
|
||||
<!-- end featured_image-->
|
||||
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
<div class="post-footer">
|
||||
<div class="post-meta">
|
||||
<span class="post-time">
|
||||
<time datetime={{.Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} itemprop="datePublished">
|
||||
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}
|
||||
</time>
|
||||
</span>
|
||||
in
|
||||
{{ with .Params.categories }}
|
||||
<i class="iconfont icon-folder"></i>
|
||||
<span class="post-category">
|
||||
{{ range . }}
|
||||
{{ $name := . }}
|
||||
{{ with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) }}
|
||||
<a href="{{ .Permalink }}">{{ $name }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ with .Params.tags }}
|
||||
<div class="post-tags">
|
||||
{{ range . }}
|
||||
<span class="tag">
|
||||
<a href="{{ "tags/" | absURL }}{{ . | urlize }}/">#{{ . }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "paginator.html" . }}
|
||||
</div>
|
||||
@@ -1 +0,0 @@
|
||||
{{ partial "intro.html" . }}
|
||||
@@ -1,20 +1,10 @@
|
||||
{{ $cdn_url := .Scratch.Get "cdn_url" }}
|
||||
{{ $postHasImages := .Scratch.Get "postHasImages" }}
|
||||
|
||||
{{ $scripts := resources.Get "/js/main.js" | slice }}
|
||||
{{ $dynamicToTop := resources.Get "/js/dynamicToTop.min.js" }}
|
||||
{{ $lightGallery_init := resources.Get "/js/lightGallery-init.js" }}
|
||||
{{ $dynamicToTop := resources.Get "/js/dynamicToTop.js" }}
|
||||
|
||||
<!-- jQuery https://github.com/jquery/jquery -->
|
||||
{{ $jquery := `
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
` }}
|
||||
<!-- lightGallery https://github.com/sachinchoolur/lightGallery -->
|
||||
{{ $lightGallery := `
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.12/dist/css/lightgallery.min.css" integrity="sha256-8rfHbJr+ju3Oc099jFJMR1xAPu8CTPHU8uP5J3X/VAY=" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.12/dist/js/lightgallery-all.min.js" integrity="sha256-w14QFJrxOYkUnF0hb8pVFCSgYcsF0hMIKrqGb8A7J8A=" crossorigin="anonymous"></script>
|
||||
` }}
|
||||
<!-- lazysizes https://github.com/aFarkas/lazysizes -->
|
||||
{{ $lazysizes := `
|
||||
<script src="https://cdn.jsdelivr.net/npm/lazysizes@5.1.1/lazysizes.min.js" integrity="sha256-6zKmNZVeImc0d1Y55vm4So/0W5mbwWiPS4zJt3F4t2A=" crossorigin="anonymous"></script>
|
||||
` }}
|
||||
@@ -26,19 +16,19 @@
|
||||
` }}
|
||||
<!-- TypeIt https://github.com/alexmacarthur/typeit -->
|
||||
{{ $typeit := `
|
||||
<script src="https://cdn.jsdelivr.net/npm/typeit@6.0.3/dist/typeit.min.js" integrity="sha256-jl1b2Wp4cXCUyX8FxPZ8Z0PPIPV3QYNb/jPSLGDej2c=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/typeit@6.0.3/dist/typeit.min.js" integrity="sha256-jl1b2Wp4cXCUyX8FxPZ8Z0PPIPV3QYNb/jPSLGDej2c=" crossorigin="anonymous"></script>
|
||||
` }}
|
||||
<!-- jQuery.countdown https://github.com/hilios/jQuery.countdown/ -->
|
||||
<!-- jQuery.countdown https://github.com/hilios/jQuery.countdown -->
|
||||
{{ $countdown := `
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery-countdown@2.2.0/dist/jquery.countdown.min.js" integrity="sha256-Ikk5myJowmDQaYVCUD0Wr+vIDkN8hGI58SGWdE671A8=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery-countdown@2.2.0/dist/jquery.countdown.min.js" integrity="sha256-Ikk5myJowmDQaYVCUD0Wr+vIDkN8hGI58SGWdE671A8=" crossorigin="anonymous"></script>
|
||||
` }}
|
||||
<!-- jQuery.countdown https://github.com/hilios/jQuery.countdown/ -->
|
||||
<!-- MetingJS https://github.com/metowolf/MetingJS -->
|
||||
{{ $metingjs := `
|
||||
<!-- require APlayer -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
|
||||
<!-- require MetingJS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>
|
||||
<!-- require APlayer -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
|
||||
<!-- require MetingJS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>
|
||||
` }}
|
||||
|
||||
{{ $jquery | safeHTML }}
|
||||
@@ -49,24 +39,18 @@
|
||||
{{ $metingjs | safeHTML }}
|
||||
{{ end }}
|
||||
{{ $countdown | safeHTML }}
|
||||
|
||||
{{ $scripts = $scripts | append $dynamicToTop }}
|
||||
|
||||
{{ if $postHasImages }}
|
||||
{{ $lightGallery | safeHTML }}
|
||||
{{ $lazysizes | safeHTML }}
|
||||
{{ $scripts = $scripts | append $lightGallery_init }}
|
||||
{{ $scripts = $scripts | resources.Concat "/js/vendor_gallery.js" | resources.Minify }}
|
||||
{{ else }}
|
||||
{{ $scripts = $scripts | resources.Concat "/js/vendor_no_gallery.js" | resources.Minify }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.Math .Site.Params.Math }}
|
||||
{{ $katex | safeHTML }}
|
||||
{{ end }}
|
||||
|
||||
{{ $lazysizes | safeHTML }}
|
||||
|
||||
{{ $scripts = $scripts | append $dynamicToTop }}
|
||||
{{ $scripts = $scripts | resources.Concat "/js/vendor_post.js" | resources.Minify }}
|
||||
{{ else }}
|
||||
{{ $scripts = $scripts | resources.Concat "/js/vendor_main.js" | resources.Minify}}
|
||||
{{ end }}
|
||||
|
||||
<script src="{{ printf "%s%s" $cdn_url $scripts.RelPermalink }}" async=""></script>
|
||||
<script src="{{ $scripts.RelPermalink }}" async=""></script>
|
||||
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
|
||||
@@ -80,15 +80,10 @@
|
||||
}
|
||||
},
|
||||
{{ end }}
|
||||
{{ if .Params.author }}
|
||||
{{ if .Site.Author.Name }}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Params.author }}"
|
||||
},
|
||||
{{ else if .Site.Author.name }}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Author.name }}"
|
||||
"name": "{{ .Site.Author.Name }}"
|
||||
},
|
||||
{{ end }}
|
||||
"description": "{{ .Description }}"
|
||||
|
||||
Reference in New Issue
Block a user