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)