all repos — flounder @ e53e5ea968f373f93d404acc0c1c90e1a6f52fd9

A small site builder for the Gemini protocol

bugfix path
alex wennerberg alex@alexwennerberg.com
Wed, 18 Nov 2020 18:53:44 -0800
commit

e53e5ea968f373f93d404acc0c1c90e1a6f52fd9

parent

b74ecaec8871cf7641c243b21a2f006f3c0d1968

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M main.gomain.go

@@ -88,6 +88,11 @@ l := len(strings.Split(c.FilesDirectory, "/"))

return strings.Join(strings.Split(filesPath, "/")[l:], "/") } +func getCreator(filePath string) string { + l := len(strings.Split(c.FilesDirectory, "/")) + return strings.Split(filePath, "/")[l] +} + func getIndexFiles() ([]*File, error) { // cache this function result := []*File{} err := filepath.Walk(c.FilesDirectory, func(thepath string, info os.FileInfo, err error) error {

@@ -97,7 +102,7 @@ return err // think about

} // make this do what it should if !info.IsDir() { - creatorFolder := strings.Split(thepath, "/")[1] + creatorFolder := getCreator(thepath) updatedTime := info.ModTime() result = append(result, &File{ Name: getLocalPath(thepath),