Unified · Split
| @@ -2,13 +2,16 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Vue |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | def get_name |
| 5 | − if slug == 'api/' | |
| 5 | + if slug == 'api/' || slug == 'api/index' | |
| 6 | 6 | 'API' |
| 7 | 7 | elsif slug == 'style-guide/' |
| 8 | 8 | 'Style Guide' |
| 9 | 9 | else |
| 10 | 10 | name = at_css('.content h1').content |
| 11 | 11 | node = at_css(".sidebar .menu-root a[href='#{File.basename(slug)}']") |
| 12 | + | |
| 13 | + return name if node.nil? | |
| 14 | + | |
| 12 | 15 | index = node.parent.parent.css('> li > a').to_a.index(node) |
| 13 | 16 | name.prepend "#{index + 1}. " if index |
| 14 | 17 | name |