2022-06-27 23:36:45 +04:00
|
|
|
package files
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
func CurrentPath(path string) (curPath string) {
|
|
|
|
parts := strings.Split(path, "/")[1:]
|
|
|
|
curPath = "<a href=\"/\">root</a>"
|
|
|
|
for i, part := range parts {
|
|
|
|
var sb strings.Builder
|
|
|
|
sb.WriteString("/<a href=\"/")
|
|
|
|
sb.WriteString(strings.Join(parts[:i+1], "/"))
|
|
|
|
sb.WriteString("/\">")
|
2022-06-28 01:59:22 +04:00
|
|
|
sb.WriteString(part)
|
2022-06-27 23:36:45 +04:00
|
|
|
sb.WriteString("</a>")
|
|
|
|
curPath += sb.String()
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|