🎨 Finish folder structure redesign and add some scripts.
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
{{- $lang := replaceRE "-([a-z]+)" (upper (substr .Site.Language -3)) .Site.Language -}}
|
||||
{{- .Scratch.Set "lang" $lang -}}
|
||||
{{- $vendors := .Site.Data.resources.vendors -}}
|
||||
{{- $pluginVen := .Site.Params.vendors.plugins -}}
|
||||
{{- $pluginCDN := index $vendors $pluginVen -}}
|
||||
{{- .Scratch.Set "pluginCDN" $pluginCDN -}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $lang }}">
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
{{ range .Paginator.Pages.GroupByDate "2006" }}
|
||||
<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 }}
|
||||
{{ end }}
|
||||
@@ -27,9 +27,8 @@
|
||||
{{- T "PostArchiveKeepOn" }}
|
||||
</span>
|
||||
</div>
|
||||
{{ range (.Paginate (.Data.Pages.GroupByDate "2006") 5 ).PageGroups }}
|
||||
{{- partial "post/list.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ .Render "list" }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{{- define "title" }}{{- .Title }} - {{ .Site.Title -}}{{- end }}
|
||||
|
||||
{{- define "main_inner_class" }}post posts-expand{{- end }}
|
||||
|
||||
{{- define "main" }}
|
||||
{{ partial "post/index.html" (dict "ctx" . "IsHome" false) }}
|
||||
{{ partial "post.html" (dict "ctx" . "IsHome" false) }}
|
||||
{{- end }}
|
||||
6
layouts/_default/taxonomy.html
Normal file
6
layouts/_default/taxonomy.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- define "title" -}}
|
||||
{{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
{{ define "main" }}
|
||||
{{ .Data.Singular }}
|
||||
{{- end }}
|
||||
6
layouts/_default/terms.html
Normal file
6
layouts/_default/terms.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- define "title" -}}
|
||||
{{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | dict "Some" | T "AllSome" }} - {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
{{ define "main" }}
|
||||
{{ .Data.Terms }}
|
||||
{{ end }}
|
||||
@@ -2,7 +2,7 @@
|
||||
{{- define "main" }}
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
|
||||
{{- range $paginator.Pages }}
|
||||
{{ partial "post/index.html" (dict "ctx" . "IsHome" true) }}
|
||||
{{ partial "post.html" (dict "ctx" . "IsHome" true) }}
|
||||
{{- end }}
|
||||
{{- partial "partials/pagination.html" . }}
|
||||
{{- end }}
|
||||
@@ -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">
|
||||
©
|
||||
<span itemprop="copyrightYear">
|
||||
@@ -88,4 +79,13 @@
|
||||
{{ $pb := printf "<a href='https://gohugo.io' target='_blank'>Hugo</a> & <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 }}
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
10
layouts/partials/post.html
Normal file
10
layouts/partials/post.html
Normal 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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 }}
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 }}
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user