Perf(SEO): optimize DOM

This commit is contained in:
Cell
2022-05-20 11:32:17 +08:00
parent e82a6549a6
commit 0963931d2e
6 changed files with 37 additions and 39 deletions
+2 -2
View File
@@ -3,13 +3,13 @@
{{- end -}}
{{- define "content" -}}
<div class="page" id="content-404">
<article class="page" id="content-404">
<h1 id="error-emoji"></h1>
<p class="error-text">
{{- T "pageNotFoundText" -}}&nbsp;
<a href="javascript:void(0);" title="{{ T `back` }}" onclick="window.history.back();"><i class="fa-regular fa-hand-point-left fa-fw"></i></a>
</p>
</div>
</article>
<script type="text/javascript">
(function() {
var emojiArray = ['\\(o_o)/', '(˚Δ˚)b', '(^-^*)', '(≥o≤)', '(^_^)b', '(·_·)','(=\'X\'=)', '(>_<)', '(;-;)'];
+8 -10
View File
@@ -2,16 +2,14 @@
{{- define "content" -}}
{{- $params := .Scratch.Get "params" -}}
<div class="page single special">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">
{{- .Title -}}
</h1>
<article class="page single special">
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">{{- .Title -}}</h1>
{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}
<h2 class="single-subtitle">{{ . }}</h2>
{{- end -}}
{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . }}</p>{{- end -}}
</div>
{{- /* Content */ -}}
<div class="content" id="content">
@@ -20,5 +18,5 @@
{{- /* Comment */ -}}
{{- partial "single/comment.html" . -}}
</div>
</article>
{{- end -}}
+8 -10
View File
@@ -2,16 +2,14 @@
{{- define "content" -}}
{{- $params := .Scratch.Get "params" -}}
<div class="page single special friends">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">
{{- .Title -}}
</h1>
<article class="page single special friends">
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">{{- .Title -}}</h1>
{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}
<h2 class="single-subtitle">{{ . }}</h2>
{{- end -}}
{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . }}</p>{{- end -}}
</div>
{{- /* Friend links */ -}}
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
@@ -38,5 +36,5 @@
{{- /* Comment */ -}}
{{- partial "single/comment.html" . -}}
</div>
</article>
{{- end -}}
+12 -10
View File
@@ -3,15 +3,17 @@
{{- end -}}
{{- define "content" -}}
<div class="page" id="content-offline">
<h1 class="offline-title animate__animated animate__pulse animate__faster">{{- T "offlineTitle" -}}</h1>
<h2 class="offline-subtitle">
<i class="fa-stack fa-xs">
<i class="fa-solid fa-wifi fa-stack-1x"></i>
<i class="fa-solid fa-ban fa-stack-2x"></i>
</i>
<span>ERROR_INTERNET_DISCONNECTED</span>
</h2>
<article class="page" id="content-offline">
<div class="header">
<h1 class="offline-title animate__animated animate__pulse animate__faster">{{- T "offlineTitle" -}}</h1>
<p class="offline-subtitle animate__animated animate__headShake">
<i class="fa-stack fa-xs">
<i class="fa-solid fa-wifi fa-stack-1x"></i>
<i class="fa-solid fa-ban fa-stack-2x"></i>
</i>
<span>ERROR_INTERNET_DISCONNECTED</span>
</p>
</div>
<p class="error-text">{{- T "offlineText" -}}</p>
</div>
</article>
{{- end -}}
+1 -1
View File
@@ -8,7 +8,7 @@
{{- if ne .Lastmod.Unix .Date.Unix }}
{{- $postCount = add $postCount 1 -}}
{{- if eq $hasTitle false -}}
<h3 class="group-title">{{- T "recentlyUpdated" -}}</h3>
<h2 class="group-title">{{- T "recentlyUpdated" -}}</h2>
{{- $hasTitle = true -}}
{{- end -}}
<article class="archive-item">
+6 -6
View File
@@ -18,13 +18,13 @@
</aside>
<article class="page single">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__flipInX">{{ .Title }}</h1>
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__flipInX">{{ .Title }}</h1>
{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}
<h2 class="single-subtitle">{{ . }}</h2>
{{- end -}}
{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . }}</p>{{- end -}}
</div>
{{- /* Meta */ -}}
<div class="post-meta">