From 4c5be2105c0965f2c5004c9289dc1d64cbf03af9 Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 5 Apr 2024 23:23:23 +0900 Subject: [PATCH] fix --- .../{2024-04-04-blog.md => 2024-03-31-blog.md} | 2 +- content/blog/2024-04-01-layout.md | 7 +++++++ content/blog/2024-04-05-layout.md | 8 -------- layouts/partials/content.html | 14 +++++++++----- layouts/partials/head.html | 1 + scpt/md.zsh | 16 ++++++++++++++++ static/css/style.css | 18 ++++++++++++++++-- static/js/index.js | 11 +++++++++++ 8 files changed, 61 insertions(+), 16 deletions(-) rename content/blog/{2024-04-04-blog.md => 2024-03-31-blog.md} (68%) create mode 100644 content/blog/2024-04-01-layout.md delete mode 100644 content/blog/2024-04-05-layout.md create mode 100755 scpt/md.zsh create mode 100644 static/js/index.js diff --git a/content/blog/2024-04-04-blog.md b/content/blog/2024-03-31-blog.md similarity index 68% rename from content/blog/2024-04-04-blog.md rename to content/blog/2024-03-31-blog.md index 0e2c520f..e05de419 100644 --- a/content/blog/2024-04-04-blog.md +++ b/content/blog/2024-03-31-blog.md @@ -1,5 +1,5 @@ +++ -date = "2024-04-04T16:27:13+09:00" +date = "2024-03-31T16:27:13+09:00" tags = ["blog"] title = "start blog" +++ diff --git a/content/blog/2024-04-01-layout.md b/content/blog/2024-04-01-layout.md new file mode 100644 index 00000000..a1b6376e --- /dev/null +++ b/content/blog/2024-04-01-layout.md @@ -0,0 +1,7 @@ ++++ +date = "2024-04-01T00:00:00+09:00" +tags = ["blog"] +title = "change layout" ++++ + +layoutを変更しました。 diff --git a/content/blog/2024-04-05-layout.md b/content/blog/2024-04-05-layout.md deleted file mode 100644 index 840c2b82..00000000 --- a/content/blog/2024-04-05-layout.md +++ /dev/null @@ -1,8 +0,0 @@ -+++ -date = "2024-04-05T16:27:13+09:00" -tags = ["blog"] -title = "new layout" -+++ - -web pageのlayoutを変更しました。 - diff --git a/layouts/partials/content.html b/layouts/partials/content.html index 8fb42ed4..3e025c74 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -9,12 +9,16 @@
  • blog
  • - {{ range $index,$value := first 5 (where $.Site.RegularPages.ByDate.Reverse "Section" "blog") }} -
  • - {{.Title}} {{ .Date.Local.Format "2006-01-02" }} -
  • + + {{ range $index,$value := (where $.Site.RegularPages.ByDate.Reverse "Section" "blog") }} + {{ if lt $index 5 }} +
  • {{.Title}} {{ .Date.Local.Format "2006-01-02" }}
  • + {{ else }} + {{ end }} -
  • + {{ end }} + +
  • {{ end }} {{ if or (eq $t "chara") (eq $t "story") (eq $t "card") (eq $t "vrm") }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 477bdb3e..e9832a3b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -35,6 +35,7 @@ + {{ range .AlternativeOutputFormats -}} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} diff --git a/scpt/md.zsh b/scpt/md.zsh new file mode 100755 index 00000000..cf0d6d66 --- /dev/null +++ b/scpt/md.zsh @@ -0,0 +1,16 @@ +#!/bin/zsh + +d=${0:a:h:h} +c=$d/content/blog + +for i in $(seq -w 1 20) +do + d=2024-01-$i + f=$c/$d-test.md + echo " ++++ +date = \"${d}T00:00:00+09:00\" +title = \"${RANDOM}\" ++++ +" >! $f +done diff --git a/static/css/style.css b/static/css/style.css index 41d5cb16..13434319 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1048,14 +1048,28 @@ table { table { border-spacing: 2px; } + -li.blog-list { +li.blog-list-first { background-color: #fff; padding:10px 40px;; border: solid 1px #eee; + display: block; } -li.blog-list span.blog-date { +li.blog-list-first span.blog-date { + float:left; + padding: 0 20px; +} + +li.blog-list-all { + background-color: #fff; + padding:10px 40px;; + border: solid 1px #eee; + display: none; +} + +li.blog-list-all span.blog-date { float:left; padding: 0 20px; } diff --git a/static/js/index.js b/static/js/index.js new file mode 100644 index 00000000..e49ac430 --- /dev/null +++ b/static/js/index.js @@ -0,0 +1,11 @@ +function blog_list_open() { + var b = document.querySelectorAll("li.blog-list-all"); + var index = 0, length = b.length; + for ( ; index < length; index++) { + if (b[index].style.display == 'none') { + b[index].style.display = 'block'; + } else { + b[index].style.display = 'none'; + } + } +}