flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit e53e5ea968f373f93d404acc0c1c90e1a6f52fd9
parent b74ecaec8871cf7641c243b21a2f006f3c0d1968
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Wed, 18 Nov 2020 18:53:44 -0800

bugfix path

Diffstat:
Mmain.go | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/main.go b/main.go @@ -88,6 +88,11 @@ func getLocalPath(filesPath string) string { 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 @@ func getIndexFiles() ([]*File, error) { // cache this function } // 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),