fixed stylesheet embedding
This commit is contained in:
parent
c65ebfc809
commit
065c344c03
5 changed files with 192 additions and 14 deletions
|
@ -47,6 +47,7 @@ func FileExists(path string) bool {
|
|||
return !os.IsNotExist(err)
|
||||
}
|
||||
|
||||
// CreateParents creates the parent directories required for a given path
|
||||
func CreateParents(path string) error {
|
||||
dir := filepath.Dir(path)
|
||||
// Check if the parent directory already exists
|
||||
|
@ -59,3 +60,12 @@ func CreateParents(path string) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func StripTopDir(path string) string {
|
||||
cleanedPath := filepath.Clean(path)
|
||||
components := strings.Split(cleanedPath, string(filepath.Separator))
|
||||
if len(components) <= 1 {
|
||||
return path
|
||||
}
|
||||
return filepath.Join(components[1:]...)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue