🎨 Finish folder structure redesign and add some scripts.

This commit is contained in:
凡梦星尘
2022-06-08 14:51:30 +08:00
parent 168fb20cbb
commit 2973eaf85d
27 changed files with 456 additions and 96 deletions

View File

@@ -1,13 +1,4 @@
{{- $ft := .Site.Params.footer }}
{{- if $ft.beian.enable }}
{{- with $ft.beian }}
<div class="beian">
<a href="https://beian.miit.gov.cn" target="_blank">{{ .icp }}</a>
<img src="/imgs/gongan.png" alt="{{ .provinceAbbr }}公网安备">
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{ .gonganNum }}" target="_blank">{{ .provinceAbbr }}公网安备 {{ .gonganNum }} 号</a>
</div>
{{- end }}
{{- end }}
<div class="copyright">
&copy;
<span itemprop="copyrightYear">
@@ -88,4 +79,13 @@
{{ $pb := printf "<a href='https://gohugo.io' target='_blank'>Hugo</a> &amp; <a href='https://github.com/hugo-next' target='_blank'>NexT.%s</a>" .Site.Params.scheme }}
{{- printf (T "FooterPowerby") $pb | safeHTML }}
</div>
{{- end }}
{{- if $ft.beian.enable }}
{{- with $ft.beian }}
<div class="beian">
<a href="https://beian.miit.gov.cn" target="_blank">{{ .icp }}</a>
<img src="/imgs/gongan.png" alt="{{ .provinceAbbr }}公网安备">
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{ .gonganNum }}" target="_blank">{{ .provinceAbbr }}公网安备 {{ .gonganNum }} 号</a>
</div>
{{- end }}
{{- end }}

View File

@@ -1,7 +1,7 @@
<meta itemprop="name" content="{{ .Title }}" />
<meta itemprop="description" content="{{ .Description | default .Site.Params.description }}" />
{{- if .IsPage }}
{{- with .PublishDate }}
{{- with .Date }}
<meta itemprop="datePublished" {{ . }} />
{{- end }}
{{- with .Lastmod }}

View File

@@ -8,10 +8,10 @@
<meta property="og:image:type" content="image/jpeg/png/svg/jpg" />
<meta property="og:url" content="{{ .Permalink }}"/>
<meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:locale" content="{{ .Scratch.Get "lang" }}"/>
<meta property="og:locale" content="{{ .Site.LanguageCode }}"/>
{{- if .IsPage }}
<meta property="article:author" content="{{ .Params.Author | default .Site.Params.Author }}" />
<meta property="article:published_time" content="{{ .PublishDate }}" />
<meta property="article:published_time" content="{{ .Date }}" />
<meta property="article:modified_time" content="{{ .Lastmod }}" />
{{- end }}
{{- end }}

View File

@@ -0,0 +1,10 @@
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="{{ .Site.LauageCode }}">
{{ partial "post/header.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
{{ partial "post/body.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
<footer class="post-footer">
{{ partial "post/footer.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
</footer>
</article>
</div>

View File

@@ -16,9 +16,9 @@
{{- end }}
</li>
<li class="post-copyright-link">
{{- if isset .Params "originlink" }}
{{- if isset .Params "link" }}
<strong>{{ print (T "PostCROriginLink") (T "SymbolColon") }} </strong>
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.OriginLink }}</a>
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.Link }}</a>
{{- else }}
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong>
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Permalink }}</a>

View File

@@ -20,8 +20,8 @@
</span>
{{- end }}
{{- if $.IsHome }}
{{- if and (isset .Params "link") (ne .Params.Link "") }}
<a href="{{ .Params.Link }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external">
{{- if and (isset .Params "extlink") (ne .Params.Extlink "") }}
<a href="{{ .Params.Extlink }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external">
{{ .Title }}
<i class="fa fa-external-link-alt"></i>
</a>

View File

@@ -1,13 +1,13 @@
{{- if .Site.Params.postMeta.created }}
{{ $timeF := .Site.Params.timeFormat }}
{{ $createdTime := (.Date.Format $timeF) | default (.PublishDate.Format $timeF) }}
{{ $createdTime := (.Date.Format $timeF) | default (.Date.Format $timeF) }}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">{{- print (T "PostPublishDate") (T "SymbolColon") -}}</span>
<time title="{{ print (T "PostPublishDate") (T "SymbolColon") }}{{ .PublishDate }}" itemprop="dateCreated datePublished" datetime="{{ .PublishDate }}">
{{- .PublishDate.Format .Site.Params.dateFormat -}}
<time title="{{ print (T "PostPublishDate") (T "SymbolColon") }}{{ .Date }}" itemprop="dateCreated datePublished" datetime="{{ .Date }}">
{{- .Date.Format .Site.Params.dateFormat -}}
</time>
</span>
{{- end }}

View File

@@ -1,5 +1,5 @@
{{- if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }}
{{- if and .Lastmod (gt .Lastmod .PublishDate) }}
{{- if and .Lastmod (gt .Lastmod .Date) }}
{{ $modTime := .Lastmod.Format .Site.Params.timeFormat }}
<span class="post-meta-item">
<span class="post-meta-item-icon">

View File

@@ -1,13 +0,0 @@
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="{{ .Scratch.Get "lang" }}">
{{ partial "post/header.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
<!-- POST BODY -->
{{ partial "post/body.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
<footer class="post-footer">
{{ partial "post/footer.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
</footer>
</article>
</div>

View File

@@ -1,27 +0,0 @@
<div class="collection-year">
<span class="collection-header">{{ .Key }}</span>
</div>
{{ range .Pages }}
<article itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<div class="post-meta-container">
{{ $month := .Date.Format .Site.Params.monthFormat }}
<time itemprop="dateCreated" datetime="{{ .Date.Format .Site.Params.timeFormat }}" content="{{ $month }}">
{{ $month }}
</time>
</div>
<div class="post-title">
{{- if isset .Params "extlink" }}
<a href="{{ .Params.extlink }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external" title="">
<span itemprop="name">{{- .Title -}}</span>
<i class="fa fa-external-link-alt"></i>
</a>
{{- else }}
<a class="post-title-link" href="{{ .Permalink }}" itemprop="url">
<span itemprop="name">{{ .Title }}</span>
</a>
{{- end }}
</div>
</header>
</article>
{{ end }}

View File

@@ -16,4 +16,82 @@
{{- $pluginJS = replace $pluginJS "${version}" $js.version }}
{{- $pluginJS = replace $pluginJS "${file}" $file }}
<script type="text/javascript" src="{{ $pluginJS }}"></script>
{{- end }}
{{- end }}
<script class="next-config" data-name="main" type="application/json">
{
"hostname": "theme-next.js.org",
"root": "/",
"images": "/images",
"scheme": "Gemini",
"darkmode": true,
"version": "8.12.1",
"exturl": true,
"sidebar":
{
"position": "left",
"display": "post",
"padding": 18,
"offset": 12
},
"copycode":
{
"enable": true,
"style": "default"
},
"bookmark":
{
"enable": false,
"color": "#222",
"save": "auto"
},
"mediumzoom": true,
"lazyload": false,
"pangu": false,
"comments":
{
"style": "tabs",
"active": null,
"storage": true,
"lazyload": true,
"nav": null
},
"stickytabs": false,
"motion":
{
"enable": false,
"async": false,
"transition":
{
"post_block": "fadeIn",
"post_header": "fadeInDown",
"post_body": "fadeInDown",
"coll_header": "fadeInLeft",
"sidebar": "fadeInUp"
}
},
"prism": false,
"i18n":
{
"placeholder": "Searching...",
"empty": "We didn't find any results for the search: ${query}",
"hits_time": "${hits} results found in ${time} ms",
"hits": "${hits} results found"
},
"path": "/search.json",
"localsearch":
{
"enable": true,
"trigger": "auto",
"top_n_per_article": 1,
"unescape": false,
"preload": false
}
}
</script>
{{ $config := resources.Get "js/config.js" }}
{{ $boot := resources.Get "js/next-boot.js" }}
{{ $utils := resources.Get "js/utils.js" }}
{{ $alljs := (slice $config $boot $utils) | resources.Concat "js/all.js"}}
<script defer src="{{ $alljs.RelPermalink }}"></script>

View File

@@ -12,7 +12,7 @@
<div class="site-state-wrap site-overview-item animated">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="{{ "/archives/" | relLangURL }}">
<a href="{{ "/posts/" | relLangURL }}">
<span class="site-state-item-count">{{ .Scratch.Get "posts" }}</span>
<span class="site-state-item-name">{{ T "SbPostsLable" }}</span>
</a>