diff options
| -rw-r--r-- | content/pages/blog/tech/description.gmi | 1 | ||||
| -rw-r--r-- | route.go | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/content/pages/blog/tech/description.gmi b/content/pages/blog/tech/description.gmi new file mode 100644 index 0000000..af8383b --- /dev/null +++ b/content/pages/blog/tech/description.gmi @@ -0,0 +1 @@ +Currently for testing @@ -78,7 +78,9 @@ func createBlogRoute(baseRoute string, postPath string, name string) { contents, _ := contentFilesystem.ReadDir("content/" + postPath) - files := fmt.Sprintf("# %s (%d)\n\n", strings.ToUpper(name), len(contents)) + files := fmt.Sprintf("# %s (%d)\n\n", strings.ToUpper(name), len(contents)-1) + + var description string // Reverse contents so that the oldest file is at the bottom // @@ -89,6 +91,12 @@ func createBlogRoute(baseRoute string, postPath string, name string) { // Could be useful later: // https://golangcode.com/sorting-an-array-of-numeric-items/ for _, file := range contents { + if file.Name() == "description.gmi" { + description = GetContent("pages" + baseRoute + "/" + file.Name()) + files += description + "\n" + continue + } + // Temporary, until it causes problems... fileNameNoExt := strings.ReplaceAll(file.Name(), ".gmi", "") @@ -102,6 +110,7 @@ func createBlogRoute(baseRoute string, postPath string, name string) { ) createRoute(baseRoute+"/"+fileNameNoExt, "default.gmi", "pages"+baseRoute+"/"+file.Name()) } + files = utilities.TrimLastChar(files) blogs[baseRoute] = name |