From 6a5cbae7e6826b20ed194bbdccc0a53a7d6306d6 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 05:48:39 +0900 Subject: Show sidebar on single page. --- layouts/_default/single.html | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d3c8ad0..a14e892 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,10 +1,22 @@ {{ partial "header.html" . }}
-
-
-

{{ .Title }}

-
- {{ .Content }} -
+
+
+
+

{{ .Title }}

+
+ {{ .Content }} +
+
+
+
    + {{ $recents := .Parent.Pages | first 8 }} + {{ with $recents }} + {{ range . }} +
  • {{ .Title }}
  • + {{ end }} + {{ end }} +
+
{{ partial "footer.html" . }} -- cgit v1.2.3 From 45636fa129977737d119cdeb43bf8a9bd329edd5 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 05:49:13 +0900 Subject: Add pagination. --- layouts/_default/list.html | 6 ++++-- layouts/partials/pagination.html | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/pagination.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 325c335..c16505a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -5,14 +5,16 @@ {{ range $idx, $page := $paginator.Pages }} {{ if lt (add $idx 1) (len $paginator.Pages) }}
{{ end }} {{ end }} +
+ {{ partial "pagination.html" . }}
    diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..d3dc68c --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,18 @@ +{{ $paginator := $.Paginator }} +{{ if gt $paginator.TotalPages 1 }} + +{{ end }} -- cgit v1.2.3 From 23fce7ca19f671059f79a8dcc8fde8e341e60662 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 07:03:23 +0900 Subject: Show tags. --- layouts/_default/single.html | 10 ++++++++++ layouts/_default/terms.html | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 layouts/_default/terms.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a14e892..d414330 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -9,6 +9,16 @@
+

Tags

+ {{ if .Params.Tags }} +
+ {{ range .Params.Tags }} + {{ . }} + {{ end }} +
+ {{ end }} +
+

Recents

    {{ $recents := .Parent.Pages | first 8 }} {{ with $recents }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..0c2a56c --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,15 @@ +{{ partial "header.html" . }} +
    +
    + {{ $plural := .Data.Plural }} + {{ range $key, $value := .Data.Terms }} + + {{ $key }} + {{ len $value }} + + {{ end }} +
    +
    +
    +
    +{{ partial "footer.html" . }} -- cgit v1.2.3 From 7cabcdaa7d81bb37c5808ddb25a5399c5156a95b Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 07:21:30 +0900 Subject: Create 404 template. --- layouts/404.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/layouts/404.html b/layouts/404.html index e69de29..4436a15 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -0,0 +1,18 @@ +{{ partial "header.html" . }} +
    +
    +

    404

    +
    +
    +

    Recents

    +
      + {{ $recents := .Site.Pages | first 8 }} + {{ with $recents }} + {{ range . }} +
    • {{ .Title }}
    • + {{ end }} + {{ end }} +
    +
    +
    +{{ partial "footer.html" . }} -- cgit v1.2.3 From 916d13038567c788d6915400bc17eb644a59ee28 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 09:23:55 +0900 Subject: Refactor sidebar. --- layouts/_default/list.html | 16 +++++++++------- layouts/_default/single.html | 19 +------------------ layouts/partials/sidebar.html | 29 +++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 25 deletions(-) create mode 100644 layouts/partials/sidebar.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c16505a..0c89331 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,25 +3,27 @@
    {{ $paginator := .Paginate ( .Data.Pages ) }} {{ range $idx, $page := $paginator.Pages }} + {{ if $page.Section }}
    + {{ with .Params.Tags }} +
    + {{ range . }} + {{ . }} + {{ end }} +
    + {{ end }} {{ .Summary }}
    - {{ if lt (add $idx 1) (len $paginator.Pages) }}
    {{ end }} {{ end }} -
    {{ partial "pagination.html" . }}
    - + {{ partial "sidebar.html" . }}
{{ partial "footer.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d414330..1b01b45 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -9,24 +9,7 @@
-

Tags

- {{ if .Params.Tags }} -
- {{ range .Params.Tags }} - {{ . }} - {{ end }} -
- {{ end }} -
-

Recents

-
    - {{ $recents := .Parent.Pages | first 8 }} - {{ with $recents }} - {{ range . }} -
  • {{ .Title }}
  • - {{ end }} - {{ end }} -
+ {{ partial "sidebar.html" . }}
{{ partial "footer.html" . }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..1668bc3 --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,29 @@ +{{ with ( .Site.GetPage "page" "about" ) }} +

About

+{{ .Content }} +
+{{ end }} +

Tags

+{{ with .Params.Tags }} +
+ {{ range . }} + {{ . }} + {{ end }} +
+{{ end }} +
+

Categories

+{{ with .Site.Taxonomies.categories }} +
+ +
+{{ end }} -- cgit v1.2.3 From 75d4ea8c840beddce6fa93af51bcf6f1cec44372 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 09:30:36 +0900 Subject: Show tags on sidebar only single pages. --- layouts/partials/sidebar.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 1668bc3..c1fb6ab 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -3,6 +3,7 @@ {{ .Content }}
{{ end }} +{{ if not .IsNode }}

Tags

{{ with .Params.Tags }}
@@ -12,6 +13,7 @@
{{ end }}
+{{ end }}

Categories

{{ with .Site.Taxonomies.categories }}
-- cgit v1.2.3 From 0322463fc4a2a5fa418a2b298ccdf316f294aefb Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 09:31:28 +0900 Subject: Show sidebar on terms. --- layouts/_default/terms.html | 1 + 1 file changed, 1 insertion(+) diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 0c2a56c..e4580ed 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -10,6 +10,7 @@ {{ end }}
+ {{ partial "sidebar.html" . }}
{{ partial "footer.html" . }} -- cgit v1.2.3 From e8f2f009f214bc751e8d002a5a840045968227c3 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 09:38:04 +0900 Subject: Use Lastmod instead of Date. --- layouts/partials/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 0566ae6..a8da0e9 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -69,7 +69,7 @@ {{ end }} {{ if not .IsHome }} {{ end }} -- cgit v1.2.3 From 5102a5ca39a911550b3531e13ea793a0e5a36800 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 10:03:00 +0900 Subject: Add robots.txt --- layouts/robots.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 layouts/robots.txt diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 0000000..7d329b1 --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1 @@ +User-agent: * -- cgit v1.2.3 From e9c3f981a4b8872ebf264169eeafe5c7ca604183 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 10:21:05 +0900 Subject: Load site global custom css. --- layouts/partials/header.html | 1 + static/common/site.css | 0 2 files changed, 1 insertion(+) create mode 100644 static/common/site.css diff --git a/layouts/partials/header.html b/layouts/partials/header.html index a8da0e9..e2b80e6 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -8,6 +8,7 @@ + {{ if .Page.IsHome }} {{ .Site.Title }} diff --git a/static/common/site.css b/static/common/site.css new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From 6746ff23585f5a7f8cc41881fd8fc1732e9e3316 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 10:21:47 +0900 Subject: Wrap sidebar with div. --- layouts/partials/sidebar.html | 58 ++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index c1fb6ab..d8f3b31 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,31 +1,33 @@ -{{ with ( .Site.GetPage "page" "about" ) }} -

About

-{{ .Content }} -
-{{ end }} -{{ if not .IsNode }} -

Tags

-{{ with .Params.Tags }} -
- {{ range . }} - {{ . }} + -{{ end }} -
-{{ end }} -

Categories

-{{ with .Site.Taxonomies.categories }} -
- +
+ {{ end }} +
+ {{ end }} +

Categories

+ {{ with .Site.Taxonomies.categories }} +
+ +
+ {{ end }}
-{{ end }} -- cgit v1.2.3 From ba6da0e32bd0e883419661a85c5265e043defe77 Mon Sep 17 00:00:00 2001 From: Hidenori MATSUKI Date: Thu, 3 May 2018 11:49:46 +0900 Subject: Add links for SNS accounts on header. --- layouts/partials/header.html | 63 +++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index e2b80e6..c06e0d9 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -30,17 +30,35 @@ {{ end }} {{ end }} - {{ if .Site.Params.SNS.Twitter }} - + {{ with $.Site.Params.Twitter }} + {{ end }}