Skip to content

Commit

Permalink
fix breadcrumb when path is /somedir/, got different feeling of /somedir
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Aug 26, 2016
1 parent 31cafdf commit 7a1831c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion httpstaticserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ func (s *HTTPStaticServer) makeIndex() error {
var err = filepath.Walk(s.Root, func(path string, info os.FileInfo, err error) error {
if err != nil {
log.Printf("WARN: Visit path: %s error: %v", strconv.Quote(path), err)
return err
return filepath.SkipDir
// return err
}
if info.IsDir() {
return nil
Expand Down
3 changes: 3 additions & 0 deletions res/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ var vm = new Vue({
var i = 2;
for (; i <= parts.length; i += 1) {
var name = parts[i - 1];
if (!name) {
continue;
}
var path = parts.slice(0, i).join('/');
this.breadcrumb.push({
name: name + (i == parts.length ? ' /' : ''),
Expand Down

0 comments on commit 7a1831c

Please sign in to comment.