From 1cccd9bdb2dc20a165afa49f24ca4f278e79d5e9 Mon Sep 17 00:00:00 2001 From: Aiden X Date: Sun, 23 Aug 2020 22:59:31 +0800 Subject: feat(*): use baseof page --- layouts/_default/baseof.html | 17 ++++++------- layouts/_default/single.html | 41 ++++++++++++++++++++++--------- layouts/index.html | 58 ++++++++++++++++++++++---------------------- layouts/partials/footer.html | 29 ++++++++++++++++++++-- layouts/partials/head.html | 13 ++++++++++ layouts/partials/header.html | 22 ++--------------- 6 files changed, 107 insertions(+), 73 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 5f8e2ec..0c2e761 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,11 +1,8 @@ - - - {{- partial "head.html" . -}} - - {{- partial "header.html" . -}} -
- {{- block "main" . }}{{- end }} -
- {{- partial "footer.html" . -}} - + +{{ partial "head.html" . }} + +{{ partial "header.html" . }} +{{ block "main" . }} {{ end }} +{{ partial "footer.html" . }} + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index cf0926a..b63d448 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,16 +1,33 @@ -{{ partial "header.html" . }} - -
-
-
-
-
- {{.Title}} +{{ define "main" }} +
+
+
+
+
+ {{.Title}} +
+
+
+ {{ .Date.Format "2006-01-02" }} +
+ {{ if .Params.tags }} +
+ {{ range $k, $v := .Params.tags }} + + #{{ . }} + + {{ end }} +
+ {{ end }} +
+
+ {{.Content}} +
- {{.Content}} +
+
+
-
- -{{partial "footer.html" . }} +{{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 04da3f9..16274ff 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,36 +1,36 @@ -{{ partial "header.html" . }} - -
-
-
- {{ range (.Site.RegularPages.GroupByDate "2006") }} -
-
{{ .Key }}
- {{ range .Pages }} -
-
+{{ define "main" }} +
+
+
+ {{ range (.Site.RegularPages.GroupByDate "2006") }} +
+
{{ .Key }}
+ {{ range .Pages }} +
+
-
-
- - {{.Title}} - -
- {{ $length := (len .Summary) }} - {{ if gt (len .Summary) 100 }} - {{ $length = 100 }} - {{ end }} - {{ slicestr .Summary 0 $length | plainify | htmlUnescape }} +
+
+ + {{.Title}} + +
+ {{ $length := (len .Summary) }} + {{ if gt $length 0 }} + {{ if gt $length 100 }} + {{ $length = 100 }} + {{ end }} + {{ slicestr .Summary 0 $length | plainify | htmlUnescape }} + {{ end }} +
-
- {{ end }} -
- {{ end }} + {{ end }} +
+ {{ end }} +
-
- -{{ partial "footer.html" . }} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 74164f0..d9ad6cd 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,10 +1,35 @@ -
Less is More
- ©2018-{{now.Year}} + + {{ $year := "2020" }} + {{ $created := $.Site.Params.siteCreated }} + {{ if and $created (lt $created now.Year) }} + {{ $year = printf "%d - %d" $created now.Year }} + {{ else }} + {{ $year = printf "%d" now.Year }} + {{ end }} + © {{ $year }} + 粤ICP备120011798号
+ + + +{{ $built := resources.Get "js/less.js" | js.Build "less.js" }} + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e69de29..72ba546 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -0,0 +1,13 @@ + + + + + {{ $options := (dict "targetPath" "less.css" "outputStyle" "compressed" "enableSourceMap" true) }} + {{ $style := resources.Get "scss/less.scss" | resources.ToCSS $options }} + + + + + 面向自由编程 + \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index b330262..4c6bb51 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,18 +1,3 @@ - - - - - - - {{ $options := (dict "targetPath" "less.css" "outputStyle" "compressed" "enableSourceMap" true) }} - {{ $style := resources.Get "scss/less.scss" | resources.ToCSS $options }} - - - - 面向自由编程 - - \ No newline at end of file -- cgit v1.2.3