Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-10-10 11:52:23 +08:00
parent 6acd0d3f27
commit b3a4068cea
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -114,11 +114,11 @@ func listDocTree(c *gin.Context) {
ids := map[string]bool{}
for _, entry := range dir {
if entry.IsDir() {
if strings.HasPrefix(entry.Name(), ".") {
continue
}
if strings.HasPrefix(entry.Name(), ".") {
continue
}
if entry.IsDir() {
if !ast.IsNodeIDPattern(entry.Name()) {
continue
}
@ -134,7 +134,12 @@ func listDocTree(c *gin.Context) {
return
}
} else {
doc := &DocFile{ID: strings.TrimSuffix(entry.Name(), ".sy")}
id := strings.TrimSuffix(entry.Name(), ".sy")
if !ast.IsNodeIDPattern(id) {
continue
}
doc := &DocFile{ID: id}
if !ids[doc.ID] {
doctree = append(doctree, doc)
}