Closes #612.
Unified · Split
| @@ -5,7 +5,11 @@ module Docs · 4 unmodified lines | |||
| 5 | if slug == 'api/' | 5 | if slug == 'api/' |
| 6 | 'API' | 6 | 'API' |
| 7 | else | 7 | else |
| 8 | at_css('h1').content | 8 | name = at_css('.content h1').content |
| 9 | node = at_css(".sidebar .menu-root a[href='#{File.basename(slug)}']") | ||
| 10 | index = node.parent.parent.css('> li > a').to_a.index(node) | ||
| 11 | name.prepend "#{index + 1}. " if index | ||
| 12 | name | ||
| 9 | end | 13 | end |
| 10 | end | 14 | end |
| 11 | 15 | ||
| @@ -21,7 +25,7 @@ module Docs · 9 unmodified lines | |||
| 21 | return [] if slug.start_with?('guide') | 25 | return [] if slug.start_with?('guide') |
| 22 | type = nil | 26 | type = nil |
| 23 | 27 | ||
| 24 | css('h2, h3').each_with_object [] do |node, entries| | 28 | css('.content h2, .content h3').each_with_object [] do |node, entries| |
| 25 | if node.name == 'h2' | 29 | if node.name == 'h2' |
| 26 | type = node.content.strip | 30 | type = node.content.strip |
| 27 | else | 31 | else |
| @@ -8,9 +8,10 @@ module Docs · 7 unmodified lines | |||
| 8 | code: 'https://github.com/vuejs/vue' | 8 | code: 'https://github.com/vuejs/vue' |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | html_filters.push 'vue/clean_html', 'vue/entries' | 11 | html_filters.push 'vue/entries', 'vue/clean_html' |
| 12 | 12 | ||
| 13 | options[:only_patterns] = [/guide\//, /api\//] | 13 | options[:only_patterns] = [/guide\//, /api\//] |
| 14 | options[:replace_paths] = { 'guide/' => 'guide/index.html' } | ||
| 14 | 15 | ||
| 15 | options[:attribution] = <<-HTML | 16 | options[:attribution] = <<-HTML |
| 16 | © 2013–2017 Evan You, Vue.js contributors<br> | 17 | © 2013–2017 Evan You, Vue.js contributors<br> |
| @@ -18,7 +19,7 @@ module Docs · 1 unmodified line | |||
| 18 | HTML | 19 | HTML |
| 19 | 20 | ||
| 20 | version '2' do | 21 | version '2' do |
| 21 | self.release = '2.2.6' | 22 | self.release = '2.3.2' |
| 22 | self.base_url = 'https://vuejs.org/v2/' | 23 | self.base_url = 'https://vuejs.org/v2/' |
| 23 | self.root_path = 'guide/index.html' | 24 | self.root_path = 'guide/index.html' |
| 24 | self.initial_paths = %w(api/) | 25 | self.initial_paths = %w(api/) |