add local TailwindCSS, fix side bar folder view, add more function to Markdown editor and allow .markdown files
This commit is contained in:
@@ -136,7 +136,15 @@ func GetFolderContents(folderPath string, cfg *config.Config) ([]models.FileInfo
|
||||
|
||||
// Set display name based on file type
|
||||
if fileInfo.Type == models.FileTypeMarkdown {
|
||||
fileInfo.DisplayName = strings.TrimSuffix(entry.Name(), ".md")
|
||||
name := entry.Name()
|
||||
lower := strings.ToLower(name)
|
||||
if strings.HasSuffix(lower, ".markdown") {
|
||||
fileInfo.DisplayName = name[:len(name)-len(".markdown")]
|
||||
} else if strings.HasSuffix(lower, ".md") {
|
||||
fileInfo.DisplayName = name[:len(name)-len(".md")]
|
||||
} else {
|
||||
fileInfo.DisplayName = strings.TrimSuffix(name, filepath.Ext(name))
|
||||
}
|
||||
} else {
|
||||
fileInfo.DisplayName = entry.Name()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user