🚧 optimization some module design.
This commit is contained in:
parent
a758a6bb3f
commit
a2f296601d
@ -1,4 +1,4 @@
|
|||||||
# Hugo theme of NexT
|
# Hugo NexT
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@ -761,7 +761,7 @@ params:
|
|||||||
serverURL: #<your waline server url>
|
serverURL: #<your waline server url>
|
||||||
|
|
||||||
# Artalk 评论插件
|
# Artalk 评论插件
|
||||||
# 更多配置信息请参考:
|
# 更多配置信息请参考:https://artalk.js.org
|
||||||
# Artalk comments system
|
# Artalk comments system
|
||||||
# More info see: https://artalk.js.org
|
# More info see: https://artalk.js.org
|
||||||
artalk:
|
artalk:
|
||||||
@ -801,16 +801,16 @@ params:
|
|||||||
giscus:
|
giscus:
|
||||||
# Github 仓库地址,格式:用户名/仓库名称
|
# Github 仓库地址,格式:用户名/仓库名称
|
||||||
# Github repository owner and name
|
# Github repository owner and name
|
||||||
repo: hugo-next/hugo-theme-next
|
repo: username/repo_name
|
||||||
# Giscus 生成的仓库 Id
|
# Giscus 生成的仓库 Id
|
||||||
# Generate repository Id from Giscus
|
# Generate repository Id from Giscus
|
||||||
repoId: R_kgDOHRjXGA
|
repoId: #<repo_id>
|
||||||
# 讨论区的分类名称
|
# 讨论区的分类名称
|
||||||
# Github discussions category
|
# Github discussions category
|
||||||
category: Comments
|
category: Announcements
|
||||||
# 讨论区分类 ID
|
# 讨论区分类 ID
|
||||||
# Generate category Id from Giscus
|
# Generate category Id from Giscus
|
||||||
categoryId: DIC_kwDOHRjXGM4CP8S4
|
categoryId: #<category_id>
|
||||||
# 讨论区帖子标题,可选值: pathname | url | title | og:title | 自定义
|
# 讨论区帖子标题,可选值: pathname | url | title | og:title | 自定义
|
||||||
# Available values: pathname | url | title | og:title | custom
|
# Available values: pathname | url | title | og:title | custom
|
||||||
mapping: title
|
mapping: title
|
||||||
@ -848,11 +848,12 @@ params:
|
|||||||
# Statistics and Analytics
|
# Statistics and Analytics
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
# 51La站点统计
|
analytics:
|
||||||
|
# 51La 站点统计
|
||||||
# 更多信息请参考:https://invite.51.la/1NUfGTS1?target=V6
|
# 更多信息请参考:https://invite.51.la/1NUfGTS1?target=V6
|
||||||
# 51La Analytics
|
# 51La Analytics
|
||||||
# See: https://invite.51.la/1NUfGTS1?target=V6
|
# See: https://invite.51.la/1NUfGTS1?target=V6
|
||||||
laId: # <app_id>
|
laId: #<anaytics_id>
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# Show Views / Visitors of the website / page with busuanzi.
|
# Show Views / Visitors of the website / page with busuanzi.
|
||||||
@ -1030,5 +1031,3 @@ params:
|
|||||||
css: css
|
css: css
|
||||||
js: js
|
js: js
|
||||||
images: imgs
|
images: imgs
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ next() {
|
|||||||
██║ ╚████║███████╗██╔╝ ██╗ ██║
|
██║ ╚████║███████╗██╔╝ ██╗ ██║
|
||||||
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝
|
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝
|
||||||
========================================
|
========================================
|
||||||
NexT version $1
|
Hugo NexT version $1
|
||||||
Documentation: https://hugo-next.eu.org
|
Documentation: https://hugo-next.eu.org
|
||||||
========================================
|
========================================
|
||||||
EOT
|
EOT
|
||||||
|
@ -1,22 +1,8 @@
|
|||||||
{{- .Scratch.Set "postsCount" (len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)) -}}
|
{{- partial "init.html" . -}}
|
||||||
{{- .Scratch.Set "catsCount" (len .Site.Taxonomies.categories) -}}
|
|
||||||
{{- .Scratch.Set "tagsCount" (len .Site.Taxonomies.tags) -}}
|
|
||||||
{{- $vendors := .Site.Data.resources.vendors -}}
|
|
||||||
{{- $pluginVen := .Site.Params.vendors.plugins -}}
|
|
||||||
{{- $pluginCDN := index $vendors $pluginVen -}}
|
|
||||||
{{- .Scratch.Set "pluginCDN" $pluginCDN -}}
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ .Site.LanguageCode }}">
|
<html lang="{{ .Site.LanguageCode }}">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width">
|
|
||||||
{{ hugo.Generator }}
|
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
|
|
||||||
<link rel="icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ .Site.Params.favicon.small }}">
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ .Site.Params.favicon.medium }}">
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon.appleTouchIcon }}">
|
|
||||||
{{- partial "head.html" . }}
|
{{- partial "head.html" . }}
|
||||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||||
<noscript>
|
<noscript>
|
||||||
@ -48,11 +34,11 @@
|
|||||||
</main>
|
</main>
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="footer-inner">
|
<div class="footer-inner">
|
||||||
{{- partial "footer" . }}
|
{{- partial "footer.html" . }}
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
{{- partial "scripts" . }}
|
{{- partialCached "scripts.html" . }}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,4 +1,2 @@
|
|||||||
{{- with .Site.Params.laId }}
|
<script charset="UTF-8" id="LA_COLLECT" src="https://sdk.51.la/js-sdk-pro.min.js"></script>
|
||||||
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
|
|
||||||
<script>LA.init({id: "{{ . }}",ck: "{{ . }}",autoTrack:true})</script>
|
<script>LA.init({id: "{{ . }}",ck: "{{ . }}",autoTrack:true})</script>
|
||||||
{{- end }}
|
|
@ -3,6 +3,6 @@
|
|||||||
{{- partial "head/twitter.html" . }}
|
{{- partial "head/twitter.html" . }}
|
||||||
{{- partial "head/googleplus.html" . }}
|
{{- partial "head/googleplus.html" . }}
|
||||||
{{- partial "head/facebook.html" . }}
|
{{- partial "head/facebook.html" . }}
|
||||||
{{ partial "head/verify.html" . }}
|
{{- partial "head/verify.html" . }}
|
||||||
{{- partial "head/style.html" . }}
|
{{- partialCached "head/style.html" . }}
|
||||||
{{- partial "head/analytics.html" . }}
|
{{- partialCached "head/analytics.html" . }}
|
@ -1 +1,5 @@
|
|||||||
{{- partial "_thirdparty/analytics/51la.html" . }}
|
{{- with .Site.Params.analytics }}
|
||||||
|
{{- if isset . "laid" }}
|
||||||
|
{{ partial "_thirdparty/analytics/51la.html" .laId }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -1,3 +1,16 @@
|
|||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
{{- if .Site.Params.darkmode }}
|
||||||
|
<meta name="theme-color" content="{{ .Site.Params.themeColor.dark }}" media="(prefers-color-scheme: dark)" />
|
||||||
|
{{- else }}
|
||||||
|
<meta name="theme-color" content="{{ .Site.Params.themeColor.light }}" media="(prefers-color-scheme: light)" />
|
||||||
|
{{- end }}
|
||||||
|
{{ hugo.Generator }}
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
|
||||||
|
<link rel="icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ .Site.Params.favicon.small }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ .Site.Params.favicon.medium }}">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon.appleTouchIcon }}">
|
||||||
<meta itemprop="name" content="{{ .Title }}" />
|
<meta itemprop="name" content="{{ .Title }}" />
|
||||||
<meta itemprop="description" content="{{ .Description | default .Site.Params.description }}" />
|
<meta itemprop="description" content="{{ .Description | default .Site.Params.description }}" />
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
@ -15,8 +28,3 @@
|
|||||||
{{- .Scratch.Set "metaImg" $img }}
|
{{- .Scratch.Set "metaImg" $img }}
|
||||||
<meta itemprop="image" content="{{ $img | absURL }}" />
|
<meta itemprop="image" content="{{ $img | absURL }}" />
|
||||||
<meta itemprop="keywords" content="{{ if and .IsPage (isset .Params "tags")}}{{ delimit .Params.tags "," }}{{ else }}{{ .Site.Params.keywords }}{{ end }}" />
|
<meta itemprop="keywords" content="{{ if and .IsPage (isset .Params "tags")}}{{ delimit .Params.tags "," }}{{ else }}{{ .Site.Params.keywords }}{{ end }}" />
|
||||||
{{- if .Site.Params.darkmode }}
|
|
||||||
<meta name="theme-color" content="{{ .Site.Params.themeColor.dark }}" media="(prefers-color-scheme: dark)" />
|
|
||||||
{{- else }}
|
|
||||||
<meta name="theme-color" content="{{ .Site.Params.themeColor.light }}" media="(prefers-color-scheme: light)" />
|
|
||||||
{{- end }}
|
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
{{- $scss := resources.Get "css/main.scss" }}
|
{{- $scss := resources.Get "css/main.scss" }}
|
||||||
{{- $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
|
{{- $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
|
||||||
{{- $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
|
{{- $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
|
||||||
|
{{- if hugo.IsProduction }}
|
||||||
|
{{- $css = $css | minify | fingerprint }}
|
||||||
|
{{- end }}
|
||||||
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
14
layouts/partials/init.html
Normal file
14
layouts/partials/init.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{{/* Use to defind global variables */}}
|
||||||
|
|
||||||
|
{{- if not hugo.IsExtended }}
|
||||||
|
{{- warnf "Hugo NexT 主题使用了 SCSS 框架,请到官方地址下载 Hugo Extended 版本:https://github.com/gohugoio/hugo/releases" -}}
|
||||||
|
{{- errorf "Because that use SCSS framework in Hugo NexT, Please download Hugo extended version on offical site: https://github.com/gohugoio/hugo/releases" -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- .Scratch.Set "postsCount" (len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)) -}}
|
||||||
|
{{- .Scratch.Set "catsCount" (len .Site.Taxonomies.categories) -}}
|
||||||
|
{{- .Scratch.Set "tagsCount" (len .Site.Taxonomies.tags) -}}
|
||||||
|
{{- $vendors := .Site.Data.resources.vendors -}}
|
||||||
|
{{- $pluginVen := .Site.Params.vendors.plugins -}}
|
||||||
|
{{- $pluginCDN := index $vendors $pluginVen -}}
|
||||||
|
{{- .Scratch.Set "pluginCDN" $pluginCDN -}}
|
@ -40,4 +40,7 @@
|
|||||||
{{- $nextjs = $nextjs | append $pjaxjs }}
|
{{- $nextjs = $nextjs | append $pjaxjs }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $nextjs = $nextjs | resources.Concat "js/hugo-next.js"}}
|
{{- $nextjs = $nextjs | resources.Concat "js/hugo-next.js"}}
|
||||||
|
{{ if hugo.IsProduction }}
|
||||||
|
{{- $nextjs = $nextjs | minify | fingerprint }}
|
||||||
|
{{ end }}
|
||||||
<script type="text/javascript" src="{{ $nextjs.RelPermalink }}" defer></script>
|
<script type="text/javascript" src="{{ $nextjs.RelPermalink }}" defer></script>
|
@ -6,7 +6,7 @@ homepage = "https://github.com/hugo-next/hugo-theme-next"
|
|||||||
tags = ["blog", "simple", "dark", "personal", "fast", "theme"]
|
tags = ["blog", "simple", "dark", "personal", "fast", "theme"]
|
||||||
features = ["some", "awesome", "features"]
|
features = ["some", "awesome", "features"]
|
||||||
min_version = "0.86.0"
|
min_version = "0.86.0"
|
||||||
demosite = "https://lisenhui.cn"
|
demosite = "https://preview.hugo-next.eu.org"
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "lisenhui"
|
name = "lisenhui"
|
||||||
|
Loading…
Reference in New Issue
Block a user