From a3cb5a359b0bec758bcae92e2a9586426e2619e0 Mon Sep 17 00:00:00 2001 From: mivinci <1366723936@qq.com> Date: Thu, 9 Sep 2021 15:56:22 +0800 Subject: [PATCH] refactor header --- assets/sass/atom.scss | 20 ++++++++++++++++++++ assets/sass/main.scss | 15 +++++++++++---- layouts/_default/list.html | 25 +++++++++++-------------- layouts/_default/single.html | 23 ++++++++++++++++------- layouts/index.html | 11 ++++------- layouts/partials/footer.html | 6 +++--- layouts/partials/header.html | 18 ++++++++---------- layouts/partials/list.html | 4 ++++ layouts/partials/paginator.html | 2 +- layouts/partials/toc.html | 2 +- 10 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 layouts/partials/list.html diff --git a/assets/sass/atom.scss b/assets/sass/atom.scss index 11d6655..8059163 100644 --- a/assets/sass/atom.scss +++ b/assets/sass/atom.scss @@ -1,6 +1,8 @@ * { line-height: 1; -webkit-tap-highlight-color: rgba(0,0,0,0); + user-select: none; + outline: none; } $unit: 0.25rem; @@ -80,6 +82,18 @@ $screens: ( .#{$prefix}text-sm { font-size: .9rem; } + .#{$prefix}text-md { + font-size: 1.25rem; + } + .#{$prefix}text-xl { + font-size: 1.5rem; + } + .#{$prefix}text-2xl { + font-size: 1.75rem; + } + .#{$prefix}text-3xl { + font-size: 2rem; + } .#{$prefix}text-4xl { font-size: 2.25rem; } @@ -117,3 +131,9 @@ $screens: ( .cursor-pointer { cursor: pointer; } + +.not-first\:ml-3 { + &:not(:first-child) { + margin-left: 0.75rem; + } +} \ No newline at end of file diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 82a55fd..86d2b4e 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -44,6 +44,7 @@ h4, h5 { font-family: "Noto Serif SC", 'Times New Roman', Times, sans-serif; font-weight: 700; + line-height: 1.5; } p { @@ -62,6 +63,7 @@ code { font-size: 13px; } +.tag, p code { background-color: var(--bd); padding: 0.2em 0.4em; @@ -70,9 +72,14 @@ p code { a { text-decoration: none; + color: inherit; } -a:not(.icon) { +a:hover { + color: var(--pm); +} + +main a:not(.icon) { color: inherit; text-decoration: underline; text-decoration-color: var(--pm); @@ -81,13 +88,13 @@ a:not(.icon) { transition: background-position 0.2s ease-in-out; } -a:not(.icon):hover, -a:not(.icon):focus { +main a:not(.icon):hover, +main a:not(.icon):focus { background-position: 0 100%; color: #fff; } -a.icon:hover { +main a.icon:hover { transform: translateY(-5px); transition: transform 0.3s ease-in-out; } diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 925aa43..c4ca39c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,17 +1,14 @@ {{ define "main" }} -
- {{ if isset .Data "Term" }} -

{{ .Data.Singular | title }} - "{{ .Data.Term }}"

- {{ else }} - +
+ {{ if isset .Data "Term" }} +

{{ .Data.Singular | title }} - "{{ .Data.Term }}"

+ {{ else }} +

{{ .Title }}

+ {{ end }} +
+ {{ range .Data.Pages }} + {{ partial "list.html" . }} {{ end }} -
- {{ range .Data.Pages }} -
-
{{ dateFormat .Site.Params.timeformat .Date }}
- {{ .Title }} -
- {{ end }} -
-
+ +
{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 15995a1..663b5d8 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,18 +1,27 @@ {{ define "main" }} -
-

{{ .Title }}

-
+{{ if .Params.toc }} +{{ partial "toc.html" . }} +{{ end }} +

{{ .Title }}

+
+
Posted at — {{ dateFormat .Site.Params.timeformat .Date }} {{ if .Draft }} - + DRAFT {{ end }}
-

{{ .Description | markdownify | safeHTML }}

- {{ if .Params.toc }} - {{ partial "toc.html" . }} + {{ if .Params.tags }} +
+ {{ range .Params.tags }} + #{{ . }} + {{ end }} +
{{ end }} +
+
+

{{ .Description | markdownify | safeHTML }}

{{ .Content }}
diff --git a/layouts/index.html b/layouts/index.html index 0ecfcec..8e25ef6 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,20 +1,17 @@ {{ define "main" }}
-

{{ .Site.Params.iam }} {{ .Site.Author.name }}

+

{{ .Site.Params.iam }} {{ .Site.Author.name }}

{{ .Site.Author.slogon }}

{{ .Site.Author.description | markdownify | safeHTML }}

{{ if eq .Paginator.PageNumber 1 }} -

Recent Posts

+

Recent Posts

{{ else }} -

Older Posts

+

Older Posts

{{ end }}
{{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }} {{ range $paginator.Pages }} -
-
{{ dateFormat .Site.Params.timeformat .Date }}
- {{ .Title }} -
+ {{ partial "list.html" . }} {{ end }} {{ partial "paginator.html" . }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a21191d..f44e585 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,8 +1,8 @@ -