diff --git a/kew.go b/kew.go index f7f5fa1..2f1a850 100644 --- a/kew.go +++ b/kew.go @@ -46,6 +46,11 @@ func build_nav(dir string, root string) (NavNode, bool) { if e.IsDir() { child, ok := build_nav(full, root) if ok { + _, err := os.Stat(filepath.Join(full, "index.md")) + if err == nil { + rel_dir, _ := filepath.Rel(root, full) + child.Path = rel_dir + "/index.html" + } node.Children = append(node.Children, child) } continue @@ -77,6 +82,7 @@ func render_nav(n NavNode, b *strings.Builder, cur string) { if !strings.HasPrefix(p, "/") { p = "/" + p } + sym := NavFileSymbol if p == cur { sym = NavCurrentSymbol @@ -85,8 +91,21 @@ func render_nav(n NavNode, b *strings.Builder, cur string) { } for _, c := range n.Children { - /* directory label with symbol */ - b.WriteString("