From 4d0bc753f36765eb644bf17ec3d7eb2fbb1bb807 Mon Sep 17 00:00:00 2001 From: MeiK Date: Wed, 16 Dec 2020 11:50:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=9F=BA=E6=9C=AC=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +- layouts/partials/mobile-menus.html | 27 ++++ layouts/partials/overview.html | 232 ++++++++++++++--------------- layouts/partials/posts.html | 144 +++++++++--------- layouts/partials/user-profile.html | 14 +- static/css/github-style.css | 11 +- 6 files changed, 236 insertions(+), 198 deletions(-) create mode 100644 layouts/partials/mobile-menus.html diff --git a/README.md b/README.md index 00ba85f..11258c5 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,14 @@ - 提交热力图的标签显示没有完全对齐 - 多个可点击元素点击后会出现蓝色的边框 +- 移动端模式下点击热力图可能会导致样式错乱 TODO -- 移动端适配 +- SEO 优化 +- 评论 +- 自定义菜单 +- 更多链接平台支持 ## Init hugo site diff --git a/layouts/partials/mobile-menus.html b/layouts/partials/mobile-menus.html new file mode 100644 index 0000000..ca8c843 --- /dev/null +++ b/layouts/partials/mobile-menus.html @@ -0,0 +1,27 @@ +{{ $section := where .Site.RegularPages "Section" "in" (slice "post") }} +{{ $section_count := len $section }} +
+ +
\ No newline at end of file diff --git a/layouts/partials/overview.html b/layouts/partials/overview.html index bb0ba2c..8702062 100644 --- a/layouts/partials/overview.html +++ b/layouts/partials/overview.html @@ -8,147 +8,145 @@ {{ $section = where .Site.RegularPages "Section" "in" (slice "post") }} {{ $section_title = "Popular posts" }} {{ end }} -
-
-
- {{ with .Site.GetPage "/readme" }} -
-
-
-
- - - - - - - README.md -
+
+
+ {{ with .Site.GetPage "/readme" }} +
+
+
+
+ + + + + + + README.md
-
- {{- .Content -}} -
+
+ {{- .Content -}} +
- {{ end }} -
-
-

- {{ $section_title }} -

-
    - {{ range (first 6 $section) }} -
  1. -
    -
    -
    - +
    + {{ end }} +
    +
    +

    + {{ $section_title }} +

    +
      + {{ range (first 6 $section) }} +
    1. + + {{ $tag }} + + {{ end }} + {{ end }} +

    -
  2. - {{ end }} -
-
+
+ + {{ end }} +
+
- {{ $section := where .Site.RegularPages "Section" "in" (slice "post") }} -
-
-
-

-
-
- - - - +
+
+

+
+
+ + + + +
+
- -
-
- -
-
    -
-
-
- -

- Post activity -

- -
-
-
-
-
+
+
+ +
+
    +
+
+
+ +

+ Post activity +

+ +
+
+
-
+
+ +
+ {{ end }} \ No newline at end of file diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html index 1e923a8..6809636 100644 --- a/layouts/partials/posts.html +++ b/layouts/partials/posts.html @@ -1,82 +1,80 @@ {{ define "posts" }} -
-
-
-
- {{ if eq .Type "tags" }} -
-
- {{ len .Pages }} - results - for {{ .Params.title }} -
- +
+
+
+ {{ if eq .Type "tags" }} +
+
+ {{ len .Pages }} + results + for {{ .Params.title }}
- {{ end }} -
    - {{ range .Paginator.Pages }} -
  • - + {{ end }} +
      + {{ range .Paginator.Pages }} +
    • +
      +
      +

      + {{ .Title }} +

      +
      -
      -
      - {{ .Summary | safeHTML }} -
      -
      - - -
      - {{ with .Params.tags }} - {{ range $tag := (first 5 .) }} - - - - - - {{ $tag }} - - {{ end }} - {{ end }} - - Created - - {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" }} - +
      +
      + {{ .Summary | safeHTML }}
      -
    • - {{ end }} -
    -
    -
    - {{ if .Paginator.HasPrev }} - Previous - {{ else }} - - {{ end }} - {{ if .Paginator.HasNext }} - Next - {{ else }} - - {{ end }} + + +
    + {{ with .Params.tags }} + {{ range $tag := (first 5 .) }} + + + + + + {{ $tag }} + + {{ end }} + {{ end }} + + Created + + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" }} + +
    +
  • + {{ end }} +
+
+
+ {{ if .Paginator.HasPrev }} + Previous + {{ else }} + + {{ end }} + {{ if .Paginator.HasNext }} + Next + {{ else }} + + {{ end }}
diff --git a/layouts/partials/user-profile.html b/layouts/partials/user-profile.html index 6296b6b..39c2099 100644 --- a/layouts/partials/user-profile.html +++ b/layouts/partials/user-profile.html @@ -117,11 +117,15 @@
- {{ if .IsHome }} - {{ block "overview" . }}{{ end }} - {{ else }} - {{ block "posts" . }}{{ end }} - {{ end }} + +
+ {{ partial "mobile-menus.html" . }} + {{ if .IsHome }} + {{ block "overview" . }}{{ end }} + {{ else }} + {{ block "posts" . }}{{ end }} + {{ end }} +