🎨 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,10 @@
--- ---
title: '{{ replace .Name "-" " " | title }}' title: "{{ replace .Name "-" " " | title }}"
description: 'Short description of the article.' description: "{{ .Name }}"
keywords: 'Key words' keywords: "{{replace .Name "-" ","}}"
isCJKLanguage: true
author: 'Author of the article' date: {{ .Date }}
lastmod: '{{ .Date }}' lastmod: {{ .Date }}
publishDate: '{{ .Date }}'
weight: 1
categories: categories:
- -
@ -15,7 +12,36 @@ tags:
- -
- -
toc: false # 原文作者
draft: true # Post's origin author name
url: '{{ lower .Name }}.html' #author:
# 原文链接
# Post's origin link URL
#link:
# 图片链接用在open graph和twitter卡片上
# Image source link that will use in open graph and twitter card
#imgs:
# 在首页展开内容
# Expand content on the home page
#expand: true
# 外部链接地址,访问时直接跳转
# It's means that will redirecting to external links
#extlink:
# 在当前页面开启或关闭评论功能
# Switch to enabled or disabled comment plugins in this post
#comment:
# enable: false
# 开启文章目录功能
# Enable table of content
#toc: false
# 绝对访问路径
# Absolute link for visit
#url: "{{ lower .Name }}.html"
# 开启文章置顶,数字越小越靠前
# Sticky post set-top in home page and the smaller nubmer will more forward.
#weight: 1
--- ---
{{ .Name }}
<!--more-->

View File

@ -38,17 +38,17 @@ NexT.boot.refresh = function() {
* Need to add config option in Front-End at 'scripts/helpers/next-config.js' file. * Need to add config option in Front-End at 'scripts/helpers/next-config.js' file.
*/ */
CONFIG.prism && window.Prism.highlightAll(); CONFIG.prism && window.Prism.highlightAll();
CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', { /*CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', {
background: 'var(--content-bg-color)' background: 'var(--content-bg-color)'
}); });*/
CONFIG.lazyload && window.lozad('.post-body img').observe(); CONFIG.lazyload && window.lozad('.post-body img').observe();
CONFIG.pangu && window.pangu.spacingPage(); CONFIG.pangu && window.pangu.spacingPage();
CONFIG.exturl && NexT.utils.registerExtURL(); CONFIG.exturl && NexT.utils.registerExtURL();
NexT.utils.registerCopyCode(); NexT.utils.registerCopyCode();
NexT.utils.registerTabsTag(); NexT.utils.registerTabsTag();
NexT.utils.registerActiveMenuItem(); /*NexT.utils.registerActiveMenuItem();
NexT.utils.registerLangSelect(); NexT.utils.registerLangSelect();*/
NexT.utils.registerSidebarTOC(); NexT.utils.registerSidebarTOC();
NexT.utils.registerPostReward(); NexT.utils.registerPostReward();
NexT.utils.wrapTableWithBox(); NexT.utils.wrapTableWithBox();

View File

@ -207,7 +207,7 @@ NexT.utils = {
}, false); }, false);
}, },
registerActiveMenuItem: function() { /*registerActiveMenuItem: function() {
document.querySelectorAll('.menu-item a[href]').forEach(target => { document.querySelectorAll('.menu-item a[href]').forEach(target => {
const isSamePath = target.pathname === location.pathname || target.pathname === location.pathname.replace('index.html', ''); const isSamePath = target.pathname === location.pathname || target.pathname === location.pathname.replace('index.html', '');
const isSubPath = !CONFIG.root.startsWith(target.pathname) && location.pathname.startsWith(target.pathname); const isSubPath = !CONFIG.root.startsWith(target.pathname) && location.pathname.startsWith(target.pathname);
@ -228,7 +228,7 @@ NexT.utils = {
window.location.href = target.dataset.href; window.location.href = target.dataset.href;
}); });
}); });
}, },*/
registerSidebarTOC: function() { registerSidebarTOC: function() {
this.sections = [...document.querySelectorAll('.post-toc li a.nav-link')].map(element => { this.sections = [...document.querySelectorAll('.post-toc li a.nav-link')].map(element => {

View File

@ -8,6 +8,10 @@ baseURL: /
theme: hugo-theme-next theme: hugo-theme-next
paginate: 8
enableEmoji: true
# Make markdown content support HTML syntax # Make markdown content support HTML syntax
markup: markup:
goldmark: goldmark:
@ -19,10 +23,14 @@ languages:
zh-cn: zh-cn:
title: Hugo NexT title: Hugo NexT
languageName: 中文 languageName: 中文
languageCode: zh-CN
hasCJKLanguage: true
weight: 1 weight: 1
en-us: en:
title: Hugo NexT title: Hugo NexT
languageName: English languageName: English
languageCode: en
hasCJKLanguage: false
weight: 2 weight: 2
params: params:
author: Theme NexT author: Theme NexT

View File

@ -0,0 +1,202 @@
---
title: "支持 Emoji 表情"
description: "Hugo 和 NexT 中的 Emoji 的用法指南。"
keywords: "Hugo,NexT,Emoji"
date: 2022-06-04T19:46:45+08:00
lastmod: 2022-06-04T19:46:45+08:00
categories:
- 示例
tags:
- 表情
- emoji
toc: false
url: "emoji-support.html"
---
Emoji 可以通过多种方式在 Hugo 项目中启用。
[`emojify`](https://gohugo.io/functions/emojify/) 方法可以直接在模板中调用, 或者使用[行内 Shortcodes](https://gohugo.io/templates/shortcode-templates#inline-shortcodes).
要全局使用 emoji, 需要在你的[网站配置](https://gohugo.io/getting-started/configuration/)中设置 `enableEmoji``true`
然后你就可以直接在文章中输入 emoji 的代码。
<!--more-->
它们以**冒号**开头和结尾,并且包含 emoji 的 **代码**
```markdown
去露营啦! {:}tent: 很快就回来.
真开心! {:}joy:
```
呈现的输出效果如下:
去露营啦! :tent: 很快就回来。
真开心! :joy:
以下**符号清单**是 emoji 代码的非常有用的参考。
## 表情与情感
### 笑脸表情
| 图标 | 代码 | 图标 | 代码 |
| :-: | - | :-: | - |
| :grinning: | `grinning` | :smiley: | `smiley` |
| :smile: | `smile` | :grin: | `grin` |
| :laughing: | `laughing` <br /> `satisfied` | :sweat_smile: | `sweat_smile` |
| :rofl: | `rofl` | :joy: | `joy` |
| :slightly_smiling_face: | `slightly_smiling_face` | :upside_down_face: | `upside_down_face` |
| :wink: | `wink` | :blush: | `blush` |
| :innocent: | `innocent` | | |
### 爱意表情
| 图标 | 代码 | 图标 | 代码 |
| :-: | - | :-: | - |
| :heart_eyes: | `heart_eyes` | :kissing_heart: | `kissing_heart` |
| :kissing: | `kissing` | :relaxed: | `relaxed` |
| :kissing_closed_eyes: | `kissing_closed_eyes` | :kissing_smiling_eyes: | `kissing_smiling_eyes` |
### 吐舌头表情
| 图标 | 代码 | 图标 | 代码 |
| :-: | - | :-: | - |
| :yum: | `yum` | :stuck_out_tongue: | `stuck_out_tongue` |
| :stuck_out_tongue_winking_eye: | `stuck_out_tongue_winking_eye` | :stuck_out_tongue_closed_eyes: | `stuck_out_tongue_closed_eyes` |
| :money_mouth_face: | `money_mouth_face` | | |
### 国家和地区旗帜
| 图标 | 代码 | 图标 | 代码 |
| :-: | - | :-: | - |
| :andorra: | `andorra` | :united_arab_emirates: | `united_arab_emirates` |
| :afghanistan: | `afghanistan` | :antigua_barbuda: | `antigua_barbuda` |
| :anguilla: | `anguilla` | :albania: | `albania` |
| :armenia: | `armenia` | :angola: | `angola` |
| :antarctica: | `antarctica` | :argentina: | `argentina` |
| :american_samoa: | `american_samoa` | :austria: | `austria` |
| :australia: | `australia` | :aruba: | `aruba` |
| :aland_islands: | `aland_islands` | :azerbaijan: | `azerbaijan` |
| :bosnia_herzegovina: | `bosnia_herzegovina` | :barbados: | `barbados` |
| :bangladesh: | `bangladesh` | :belgium: | `belgium` |
| :burkina_faso: | `burkina_faso` | :bulgaria: | `bulgaria` |
| :bahrain: | `bahrain` | :burundi: | `burundi` |
| :benin: | `benin` | :st_barthelemy: | `st_barthelemy` |
| :bermuda: | `bermuda` | :brunei: | `brunei` |
| :bolivia: | `bolivia` | :caribbean_netherlands: | `caribbean_netherlands` |
| :brazil: | `brazil` | :bahamas: | `bahamas` |
| :bhutan: | `bhutan` | :botswana: | `botswana` |
| :belarus: | `belarus` | :belize: | `belize` |
| :canada: | `canada` | :cocos_islands: | `cocos_islands` |
| :congo_kinshasa: | `congo_kinshasa` | :central_african_republic: | `central_african_republic` |
| :congo_brazzaville: | `congo_brazzaville` | :switzerland: | `switzerland` |
| :cote_divoire: | `cote_divoire` | :cook_islands: | `cook_islands` |
| :chile: | `chile` | :cameroon: | `cameroon` |
| :cn: | `cn` | :colombia: | `colombia` |
| :costa_rica: | `costa_rica` | :cuba: | `cuba` |
| :cape_verde: | `cape_verde` | :curacao: | `curacao` |
| :christmas_island: | `christmas_island` | :cyprus: | `cyprus` |
| :czech_republic: | `czech_republic` | :de: | `de` |
| :djibouti: | `djibouti` | :denmark: | `denmark` |
| :dominica: | `dominica` | :dominican_republic: | `dominican_republic` |
| :algeria: | `algeria` | :ecuador: | `ecuador` |
| :estonia: | `estonia` | :egypt: | `egypt` |
| :western_sahara: | `western_sahara` | :eritrea: | `eritrea` |
| :es: | `es` | :ethiopia: | `ethiopia` |
| :eu: | `eu` <br /> `european_union` | :finland: | `finland` |
| :fiji: | `fiji` | :falkland_islands: | `falkland_islands` |
| :micronesia: | `micronesia` | :faroe_islands: | `faroe_islands` |
| :fr: | `fr` | :gabon: | `gabon` |
| :gb: | `gb` <br /> `uk` | :grenada: | `grenada` |
| :georgia: | `georgia` | :french_guiana: | `french_guiana` |
| :guernsey: | `guernsey` | :ghana: | `ghana` |
| :gibraltar: | `gibraltar` | :greenland: | `greenland` |
| :gambia: | `gambia` | :guinea: | `guinea` |
| :guadeloupe: | `guadeloupe` | :equatorial_guinea: | `equatorial_guinea` |
| :greece: | `greece` | :south_georgia_south_sandwich_islands: | `south_georgia_south_sandwich_islands` |
| :guatemala: | `guatemala` | :guam: | `guam` |
| :guinea_bissau: | `guinea_bissau` | :guyana: | `guyana` |
| :hong_kong: | `hong_kong` | :honduras: | `honduras` |
| :croatia: | `croatia` | :haiti: | `haiti` |
| :hungary: | `hungary` | :canary_islands: | `canary_islands` |
| :indonesia: | `indonesia` | :ireland: | `ireland` |
| :israel: | `israel` | :isle_of_man: | `isle_of_man` |
| :india: | `india` | :british_indian_ocean_territory: | `british_indian_ocean_territory` |
| :iraq: | `iraq` | :iran: | `iran` |
| :iceland: | `iceland` | :it: | `it` |
| :jersey: | `jersey` | :jamaica: | `jamaica` |
| :jordan: | `jordan` | :jp: | `jp` |
| :kenya: | `kenya` | :kyrgyzstan: | `kyrgyzstan` |
| :cambodia: | `cambodia` | :kiribati: | `kiribati` |
| :comoros: | `comoros` | :st_kitts_nevis: | `st_kitts_nevis` |
| :north_korea: | `north_korea` | :kr: | `kr` |
| :kuwait: | `kuwait` | :cayman_islands: | `cayman_islands` |
| :kazakhstan: | `kazakhstan` | :laos: | `laos` |
| :lebanon: | `lebanon` | :st_lucia: | `st_lucia` |
| :liechtenstein: | `liechtenstein` | :sri_lanka: | `sri_lanka` |
| :liberia: | `liberia` | :lesotho: | `lesotho` |
| :lithuania: | `lithuania` | :luxembourg: | `luxembourg` |
| :latvia: | `latvia` | :libya: | `libya` |
| :morocco: | `morocco` | :monaco: | `monaco` |
| :moldova: | `moldova` | :montenegro: | `montenegro` |
| :madagascar: | `madagascar` | :marshall_islands: | `marshall_islands` |
| :macedonia: | `macedonia` | :mali: | `mali` |
| :myanmar: | `myanmar` | :mongolia: | `mongolia` |
| :macau: | `macau` | :northern_mariana_islands: | `northern_mariana_islands` |
| :martinique: | `martinique` | :mauritania: | `mauritania` |
| :montserrat: | `montserrat` | :malta: | `malta` |
| :mauritius: | `mauritius` | :maldives: | `maldives` |
| :malawi: | `malawi` | :mexico: | `mexico` |
| :malaysia: | `malaysia` | :mozambique: | `mozambique` |
| :namibia: | `namibia` | :new_caledonia: | `new_caledonia` |
| :niger: | `niger` | :norfolk_island: | `norfolk_island` |
| :nigeria: | `nigeria` | :nicaragua: | `nicaragua` |
| :netherlands: | `netherlands` | :norway: | `norway` |
| :nepal: | `nepal` | :nauru: | `nauru` |
| :niue: | `niue` | :new_zealand: | `new_zealand` |
| :oman: | `oman` | :panama: | `panama` |
| :peru: | `peru` | :french_polynesia: | `french_polynesia` |
| :papua_new_guinea: | `papua_new_guinea` | :philippines: | `philippines` |
| :pakistan: | `pakistan` | :poland: | `poland` |
| :st_pierre_miquelon: | `st_pierre_miquelon` | :pitcairn_islands: | `pitcairn_islands` |
| :puerto_rico: | `puerto_rico` | :palestinian_territories: | `palestinian_territories` |
| :portugal: | `portugal` | :palau: | `palau` |
| :paraguay: | `paraguay` | :qatar: | `qatar` |
| :reunion: | `reunion` | :romania: | `romania` |
| :serbia: | `serbia` | :ru: | `ru` |
| :rwanda: | `rwanda` | :saudi_arabia: | `saudi_arabia` |
| :solomon_islands: | `solomon_islands` | :seychelles: | `seychelles` |
| :sudan: | `sudan` | :sweden: | `sweden` |
| :singapore: | `singapore` | :st_helena: | `st_helena` |
| :slovenia: | `slovenia` | :slovakia: | `slovakia` |
| :sierra_leone: | `sierra_leone` | :san_marino: | `san_marino` |
| :senegal: | `senegal` | :somalia: | `somalia` |
| :suriname: | `suriname` | :south_sudan: | `south_sudan` |
| :sao_tome_principe: | `sao_tome_principe` | :el_salvador: | `el_salvador` |
| :sint_maarten: | `sint_maarten` | :syria: | `syria` |
| :swaziland: | `swaziland` | :turks_caicos_islands: | `turks_caicos_islands` |
| :chad: | `chad` | :french_southern_territories: | `french_southern_territories` |
| :togo: | `togo` | :thailand: | `thailand` |
| :tajikistan: | `tajikistan` | :tokelau: | `tokelau` |
| :timor_leste: | `timor_leste` | :turkmenistan: | `turkmenistan` |
| :tunisia: | `tunisia` | :tonga: | `tonga` |
| :tr: | `tr` | :trinidad_tobago: | `trinidad_tobago` |
| :tuvalu: | `tuvalu` | :taiwan: | `taiwan` |
| :tanzania: | `tanzania` | :ukraine: | `ukraine` |
| :uganda: | `uganda` | :us: | `us` |
| :uruguay: | `uruguay` | :uzbekistan: | `uzbekistan` |
| :vatican_city: | `vatican_city` | :st_vincent_grenadines: | `st_vincent_grenadines` |
| :venezuela: | `venezuela` | :british_virgin_islands: | `british_virgin_islands` |
| :us_virgin_islands: | `us_virgin_islands` | :vietnam: | `vietnam` |
| :vanuatu: | `vanuatu` | :wallis_futuna: | `wallis_futuna` |
| :samoa: | `samoa` | :kosovo: | `kosovo` |
| :yemen: | `yemen` | :mayotte: | `mayotte` |
| :south_africa: | `south_africa` | :zambia: | `zambia` |
| :zimbabwe: | `zimbabwe` | | |

View File

@ -0,0 +1,40 @@
---
title: "欢迎加入 Hugo NexT 组织!"
description: "Hugo NexT 是专门为 Hugo 引擎所打造的主题,保持简单易用和强大的功能!"
keywords: "Hugo,NexT,组织"
date: 2022-06-01T15:59:41+08:00
lastmod: 2022-06-01T15:59:41+08:00
categories:
- 示例
tags:
- Hugo
- NexT
expand: true
extlink: https://gitee.com/hugo-next/hugo-theme-next/
#comment:
# enable: false
#toc: false
#url: "external-link.html"
weight: 1
---
欢迎来到 `Hugo NexT` 文档站点! 它是从 [Theme NexT](https://theme-next.js.org/) 移植过来的为 [Hugo](https://gohugo.io/)打造的高品质优雅主题,保持简单易用的特性和强大的功能。
# 用户指南
设置 NexT 主题很容易。只需遵循文档,就可快速创建您的个人网站!
# 反馈
- 访问 Awesome NexT 列表,与其他用户分享插件和教程。
- 加入我们的 Gitter 聊天。
- 在几秒钟内添加或改进翻译。
- 在 GitHub Issues 中报告一个 :bug:。
- 在 GitHub 上申请一个新特性。
- 为最受欢迎的功能请求投票。

View File

@ -1,10 +1,9 @@
--- ---
title: "世界,你好!" title: "世界,你好!"
description: "快速的描述下有关于 Hugo 建站的基本用法。" description: "快速的描述下有关于 Hugo 建站的基本用法。"
isCJKLanguage: true
lastmod: 2022-06-03T16:43:23+08:00 lastmod: 2022-06-03T16:43:23+08:00
publishDate: 2022-06-02T11:52:03+08:00 date: 2022-06-02T11:52:03+08:00
categories: categories:
- 博客 - 博客
@ -12,11 +11,8 @@ tags:
- Hugo - Hugo
- 开始 - 开始
toc: false
draft: false
expand: true
url: hello-world.html url: hello-world.html
weight: 1 weight: 2
--- ---
> “使用 `weight` 关键字置顶文章。” > “使用 `weight` 关键字置顶文章。”

View File

@ -1,11 +1,9 @@
{{- $lang := replaceRE "-([a-z]+)" (upper (substr .Site.Language -3)) .Site.Language -}}
{{- .Scratch.Set "lang" $lang -}}
{{- $vendors := .Site.Data.resources.vendors -}} {{- $vendors := .Site.Data.resources.vendors -}}
{{- $pluginVen := .Site.Params.vendors.plugins -}} {{- $pluginVen := .Site.Params.vendors.plugins -}}
{{- $pluginCDN := index $vendors $pluginVen -}} {{- $pluginCDN := index $vendors $pluginVen -}}
{{- .Scratch.Set "pluginCDN" $pluginCDN -}} {{- .Scratch.Set "pluginCDN" $pluginCDN -}}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ $lang }}"> <html lang="{{ .Site.LanguageCode }}">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">

View File

@ -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 }}

View File

@ -27,9 +27,8 @@
{{- T "PostArchiveKeepOn" }} {{- T "PostArchiveKeepOn" }}
</span> </span>
</div> </div>
{{ range (.Paginate (.Data.Pages.GroupByDate "2006") 5 ).PageGroups }}
{{- partial "post/list.html" . }} {{ .Render "list" }}
{{ end }}
</div> </div>
</div> </div>

View File

@ -1,5 +1,7 @@
{{- define "title" }}{{- .Title }} - {{ .Site.Title -}}{{- end }} {{- define "title" }}{{- .Title }} - {{ .Site.Title -}}{{- end }}
{{- define "main_inner_class" }}post posts-expand{{- end }} {{- define "main_inner_class" }}post posts-expand{{- end }}
{{- define "main" }} {{- define "main" }}
{{ partial "post/index.html" (dict "ctx" . "IsHome" false) }} {{ partial "post.html" (dict "ctx" . "IsHome" false) }}
{{- end }} {{- end }}

View File

@ -0,0 +1,6 @@
{{- define "title" -}}
{{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title -}}
{{- end -}}
{{ define "main" }}
{{ .Data.Singular }}
{{- end }}

View 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 }}

View File

@ -2,7 +2,7 @@
{{- define "main" }} {{- define "main" }}
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }} {{ $paginator := .Paginate (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
{{- range $paginator.Pages }} {{- range $paginator.Pages }}
{{ partial "post/index.html" (dict "ctx" . "IsHome" true) }} {{ partial "post.html" (dict "ctx" . "IsHome" true) }}
{{- end }} {{- end }}
{{- partial "partials/pagination.html" . }} {{- partial "partials/pagination.html" . }}
{{- end }} {{- end }}

View File

@ -1,13 +1,4 @@
{{- $ft := .Site.Params.footer }} {{- $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"> <div class="copyright">
&copy; &copy;
<span itemprop="copyrightYear"> <span itemprop="copyrightYear">
@ -89,3 +80,12 @@
{{- printf (T "FooterPowerby") $pb | safeHTML }} {{- printf (T "FooterPowerby") $pb | safeHTML }}
</div> </div>
{{- end }} {{- 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="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 }}
{{- with .PublishDate }} {{- with .Date }}
<meta itemprop="datePublished" {{ . }} /> <meta itemprop="datePublished" {{ . }} />
{{- end }} {{- end }}
{{- with .Lastmod }} {{- with .Lastmod }}

View File

@ -8,10 +8,10 @@
<meta property="og:image:type" content="image/jpeg/png/svg/jpg" /> <meta property="og:image:type" content="image/jpeg/png/svg/jpg" />
<meta property="og:url" content="{{ .Permalink }}"/> <meta property="og:url" content="{{ .Permalink }}"/>
<meta property="og:site_name" content="{{ .Site.Title }}" /> <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 }} {{- if .IsPage }}
<meta property="article:author" content="{{ .Params.Author | default .Site.Params.Author }}" /> <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 }}" /> <meta property="article:modified_time" content="{{ .Lastmod }}" />
{{- end }} {{- end }}
{{- 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 }} {{- end }}
</li> </li>
<li class="post-copyright-link"> <li class="post-copyright-link">
{{- if isset .Params "originlink" }} {{- if isset .Params "link" }}
<strong>{{ print (T "PostCROriginLink") (T "SymbolColon") }} </strong> <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 }} {{- else }}
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong> <strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong>
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Permalink }}</a> <a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Permalink }}</a>

View File

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

View File

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

View File

@ -1,5 +1,5 @@
{{- if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }} {{- 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 }} {{ $modTime := .Lastmod.Format .Site.Params.timeFormat }}
<span class="post-meta-item"> <span class="post-meta-item">
<span class="post-meta-item-icon"> <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

@ -17,3 +17,81 @@
{{- $pluginJS = replace $pluginJS "${file}" $file }} {{- $pluginJS = replace $pluginJS "${file}" $file }}
<script type="text/javascript" src="{{ $pluginJS }}"></script> <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"> <div class="site-state-wrap site-overview-item animated">
<nav class="site-state"> <nav class="site-state">
<div class="site-state-item site-state-posts"> <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-count">{{ .Scratch.Get "posts" }}</span>
<span class="site-state-item-name">{{ T "SbPostsLable" }}</span> <span class="site-state-item-name">{{ T "SbPostsLable" }}</span>
</a> </a>