diff options
author | Alan Pearce | 2025-01-29 23:03:49 +0100 |
---|---|---|
committer | Alan Pearce | 2025-01-30 12:33:36 +0100 |
commit | d2085746f3301d770230e7b52986db6994d5e35c (patch) | |
tree | 66f01fdd9bf3f8a51c33330bf76105ffbbb923fc /internal/storage/sqlite/file.go | |
parent | e7add352f8996658f64b04d040b31cb156ce09e8 (diff) | |
download | website-d2085746f3301d770230e7b52986db6994d5e35c.tar.lz website-d2085746f3301d770230e7b52986db6994d5e35c.tar.zst website-d2085746f3301d770230e7b52986db6994d5e35c.zip |
switch to sqlite
Diffstat (limited to 'internal/storage/sqlite/file.go')
-rw-r--r-- | internal/storage/sqlite/file.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/storage/sqlite/file.go b/internal/storage/sqlite/file.go new file mode 100644 index 0000000..328d538 --- /dev/null +++ b/internal/storage/sqlite/file.go @@ -0,0 +1,20 @@ +package sqlite + +import ( + "strings" +) + +func pathNameToFileName(pathname string) string { + if strings.HasSuffix(pathname, "/") { + pathname = pathname + "index.html" + } + + return pathname +} + +func fileNameToPathName(filename string) string { + pathname := strings.TrimSuffix(filename, "index.html") + pathname = strings.TrimPrefix(pathname, "/") + + return "/" + pathname +} |