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