From b33bbad5f3891be8ee6f4c507f5a377be7b3b2e1 Mon Sep 17 00:00:00 2001 From: woon Date: Thu, 9 Mar 2023 09:26:39 +0800 Subject: [PATCH] update --- .env_copy | 2 +- handler/index.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.env_copy b/.env_copy index 8ef3a90..a54fe8c 100644 --- a/.env_copy +++ b/.env_copy @@ -1 +1 @@ -ARTICLE_PATH=./article \ No newline at end of file +ARTICLE_PATH=./article/ \ No newline at end of file diff --git a/handler/index.go b/handler/index.go index d4e208d..ced07c7 100644 --- a/handler/index.go +++ b/handler/index.go @@ -27,9 +27,7 @@ func Index(c *gin.Context) { filePath := path uri := filePath[:len(filePath)-len(filepath.Ext(filePath))] - uri = strings.Replace(uri, "article\\", "", -1) - uri = strings.Replace(uri, "article/", "", -1) - uri = strings.Replace(uri, "\\", "-", -1) + uri = strings.Replace(uri, articleBasePath, "", -1) uri = strings.Replace(uri, "/", "-", -1) list = append(list, uri)