From 2781d8f60d7eb914f1b18e0211a3fe7243a676e4 Mon Sep 17 00:00:00 2001 From: MeiK Date: Tue, 22 Oct 2019 10:22:30 +0800 Subject: [PATCH] Update posts --- layouts/_default/list.html | 21 ++++----- layouts/index.html | 4 -- layouts/partials/footer.html | 4 +- layouts/partials/home.html | 78 +--------------------------------- layouts/partials/overview.html | 70 ++++++++++++++++++++++++++++++ layouts/partials/posts.html | 78 ++++++++++++++++++++++++++++++++++ layouts/partials/script.html | 9 +++- 7 files changed, 169 insertions(+), 95 deletions(-) create mode 100644 layouts/partials/overview.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 92090ef..51b1fb9 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,15 +1,12 @@ {{ define "content" }} -{{ $data := .Data }} -
-

- {{ $data.Plural | humanize }} ยท {{ .Title }} -

- {{ range (.Paginate .Pages).Pages }} -
- {{ .Title }} - - {{ .Date.Format "January 2, 2006" }} - -
- {{ end }} - {{ partial "paginator.html" . }} +
+
+
+ + {{ partial "user-profile.html" . }} + + {{ partial "posts.html" .}} + +
{{end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 38ada32..1ea97f7 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,7 +1,3 @@ {{ define "content" }} -{{ if eq .Site.Params.home_mode "post" }} -{{ partial "post.html" . }} -{{ else }} {{ partial "home.html" . }} -{{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 0a96116..97ffdde 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -22,4 +22,6 @@
-
\ No newline at end of file + + +{{ partial "script.html" }} \ No newline at end of file diff --git a/layouts/partials/home.html b/layouts/partials/home.html index cb52580..b1f3ad9 100644 --- a/layouts/partials/home.html +++ b/layouts/partials/home.html @@ -1,86 +1,10 @@ -{{ $mainSections := .Site.Params.mainSections | default (slice "post") }} -{{ $section := where .Site.RegularPages "Section" "in" $mainSections }} -{{ $section_count := len $section }} -{{ $n_posts := $.Param "recent_posts_number" | default 6 }}
{{ partial "user-profile.html" . }} -
- - -
-
-
-

- Pinned -

- -
    - {{ range (first $n_posts $section) }} -
  1. -
    -
    - - {{ .Summary | safeHTML }} -
    - - MIT License - - - Updated - {{ .PublishDate.Format "January 2, 2006" }} -
    -
    -
    -
  2. - {{ end }} -
-
-
-
-
-
-
+ {{ partial "overview.html" .}}
- -{{ partial "script.html" }} \ No newline at end of file diff --git a/layouts/partials/overview.html b/layouts/partials/overview.html new file mode 100644 index 0000000..1dde89f --- /dev/null +++ b/layouts/partials/overview.html @@ -0,0 +1,70 @@ +{{ $mainSections := .Site.Params.mainSections | default (slice "post") }} +{{ $section := where .Site.RegularPages "Section" "in" $mainSections }} +{{ $section_count := len $section }} +{{ $n_posts := $.Param "recent_posts_number" | default 6 }} +
+ +
+
+
+

+ Pinned +

+ +
    + {{ range (first $n_posts $section) }} +
  1. +
    +
    + + {{ .Summary | safeHTML }} +
    + + MIT License + + + Updated + {{ .PublishDate.Format "January 2, 2006" }} +
    +
    +
    +
  2. + {{ end }} +
+
+
+
+
+
+ \ No newline at end of file diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html index e69de29..0c06414 100644 --- a/layouts/partials/posts.html +++ b/layouts/partials/posts.html @@ -0,0 +1,78 @@ +{{ $mainSections := .Site.Params.mainSections | default (slice "post") }} +{{ $section := where .Site.RegularPages "Section" "in" $mainSections }} +{{ $section_count := len $section }} +{{ $n_posts := $.Param "recent_posts_number" | default 6 }} +
+ + + +
+
+
    + {{ range .Paginator.Pages }} +
  • +
    +
    +

    + {{ .Title }} +

    +
    + +
    + {{ .Summary | safeHTML }} +
    + +
    + + MIT License + + Updated + {{ .PublishDate.Format "January 2, 2006" }} +
    +
    +
  • + {{ end }} +
+ {{ if gt .Paginator.TotalPages 1}} +
+
+ {{ if .Paginator.HasPrev }} + Previous + {{ else }} + + {{ end }} + {{ if .Paginator.HasNext }} + Next + {{ else }} + + {{ end }} +
+
+ {{ end }} +
+
+
\ No newline at end of file diff --git a/layouts/partials/script.html b/layouts/partials/script.html index 480bb09..8b20748 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -6,11 +6,18 @@ integrity="sha512-UjV5G8yJkGcA9OW3TPPQx+Rk3uyOfOVmYEWLj7ADv81bEy8Jp9oDULYFdQxOxJq518DFlt0+dBqobwvarLrNgA==" type="application/javascript" src="https://github.githubassets.com/assets/github-bootstrap-35e32afb.js"> \ No newline at end of file