Fix absolute and relative without parent dir paths work
This commit is contained in:
@@ -16,7 +16,11 @@ type Path struct {
|
||||
}
|
||||
|
||||
func NewPathFromLocal(p string) Path {
|
||||
splits := strings.SplitN(p, path.Base(config.Root)+"/", 2)
|
||||
root := config.Root + "/"
|
||||
if strings.HasPrefix(root, "./") {
|
||||
root = root[2:]
|
||||
}
|
||||
splits := strings.SplitN(p, root, 2)
|
||||
href := splits[0]
|
||||
if len(splits) > 1 && (splits[0] == "" || splits[0] == "/") {
|
||||
href = splits[1]
|
||||
|
||||
Reference in New Issue
Block a user