🎨 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,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">

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" }}
</span>
</div>
{{ range (.Paginate (.Data.Pages.GroupByDate "2006") 5 ).PageGroups }}
{{- partial "post/list.html" . }}
{{ end }}
{{ .Render "list" }}
</div>
</div>

View File

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

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