From a79c9b869e27146925f87a24b9bf14e8b134d77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Wed, 7 Jun 2023 08:50:02 +0900 Subject: [PATCH] =?UTF-8?q?Github=E3=81=AF=E5=AE=89=E5=AE=9A=E3=81=98?= =?UTF-8?q?=E3=82=83=E3=81=AA=E3=81=84=E3=81=8B=E3=82=89=E3=80=81=E3=82=B3?= =?UTF-8?q?=E3=83=9F=E3=83=A1=E3=82=84=E6=97=A5=E6=99=82=E3=82=92=E5=8F=97?= =?UTF-8?q?=E3=81=91=E5=8F=96=E3=82=8C=E3=81=AA=E3=81=91=E3=82=8C=E3=81=B0?= =?UTF-8?q?=E3=80=81=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/repo.go | 11 +++++++---- views/.prettierignore | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 views/.prettierignore diff --git a/pages/repo.go b/pages/repo.go index 4bc26b1..e79ccb0 100644 --- a/pages/repo.go +++ b/pages/repo.go @@ -122,10 +122,13 @@ func HandleRepo(c *fiber.Ctx) error { } else { FileType = "file" } - tstring := strings.ReplaceAll(el.ChildAttr("relative-time", "datetime"), "T", "、") - tstring = strings.Split(tstring, "+")[0] - tstrings := strings.Split(tstring, "-") - tstring = tstrings[0] + "-" + tstrings[1] + "-" + tstrings[2] + tstring := el.ChildAttr("relative-time", "datetime") + if tstring != "" { + tstring = strings.ReplaceAll(tstring, "T", "、") + tstring = strings.Split(tstring, "+")[0] + tstrings := strings.Split(tstring, "-") + tstring = tstrings[0] + "-" + tstrings[1] + "-" + tstrings[2] + } repoFilesArray = append(repoFilesArray, RepoFiles{ Name: el.ChildText("div.flex-auto span.d-block a.js-navigation-open"), Path: el.ChildText("div.flex-auto span.d-block a.js-navigation-open"), diff --git a/views/.prettierignore b/views/.prettierignore deleted file mode 100644 index d4333f7..0000000 --- a/views/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -header.html -footer.html