https://blog.vuejs.org/posts/vue-3-as-the-new-default.html
Unified · Split
| @@ -6,7 +6,8 @@ module Docs · 5 unmodified lines | ||
| 6 | 6 | return '<h1>Vite</h1>' if root_page? |
| 7 | 7 | @doc = at_css('.content > div') |
| 8 | 8 | else |
| 9 | − @doc = at_css(version == '3' ? 'main' : '.content') | |
| 9 | + return '<h1>Vue.js</h1>' if root_page? | |
| 10 | + @doc = at_css(version == '3' ? 'main > div > div' : '.content') | |
| 10 | 11 | end |
| 11 | 12 | |
| 12 | 13 | at_css('h1').content = 'Vue.js' if root_page? |
| @@ -14,6 +15,7 @@ module Docs · 1 unmodified line | ||
| 14 | 15 | |
| 15 | 16 | css('.demo', '.guide-links', '.footer', '#ad').remove |
| 16 | 17 | css('.header-anchor', '.page-edit', '.page-nav').remove |
| 18 | + css('.next-steps').remove | |
| 17 | 19 | |
| 18 | 20 | css('.custom-block-title').each do |node| |
| 19 | 21 | node.name = 'strong' |
| @@ -9,9 +9,9 @@ module Docs · 8 unmodified lines | ||
| 9 | 9 | else |
| 10 | 10 | name = at_css('h1').content |
| 11 | 11 | name = _fix_name(name) |
| 12 | − subtype = at_css('.sidebar-heading.open, .sidebar-heading.active, .sidebar-link.active') | |
| 13 | − index = css('.sidebar-link').to_a.index(at_css('.sidebar-link.active')) | |
| 14 | − name.prepend "#{index + 1}. " if index && !slug.start_with?('api') | |
| 12 | + subtype = at_css('.title-text.active') | |
| 13 | + index = css('aside nav .link').to_a.index(at_css('aside nav .link.active')) | |
| 14 | + name.prepend "#{index + 1}. " if index && !slug.start_with?('api') && !slug.start_with?('style-guide') | |
| 15 | 15 | name.concat " (#{subtype.content.strip})" if subtype && slug.start_with?('guide') |
| 16 | 16 | name |
| 17 | 17 | end |
| @@ -26,12 +26,12 @@ module Docs · 8 unmodified lines | ||
| 26 | 26 | def get_type |
| 27 | 27 | if slug.start_with?('guide/migration') |
| 28 | 28 | 'Migration' |
| 29 | − elsif slug.start_with?('guide') | |
| 29 | + elsif slug.start_with?('guide') or root_page? | |
| 30 | 30 | 'Guide' |
| 31 | − elsif slug == 'style-guide/' | |
| 31 | + elsif slug.start_with?('style-guide') | |
| 32 | 32 | 'Style Guide' |
| 33 | 33 | else |
| 34 | − title = at_css('.sidebar-heading.open, .sidebar-heading.active, .sidebar-link.active').content.strip | |
| 34 | + title = at_css('.title-text.active').content.strip | |
| 35 | 35 | title = _fix_name(title) |
| 36 | 36 | "API: #{title}" |
| 37 | 37 | end |
| @@ -41,7 +41,7 @@ module Docs · 3 unmodified lines | ||
| 41 | 41 | return [] if slug.start_with?('guide') |
| 42 | 42 | type = nil |
| 43 | 43 | |
| 44 | − css('h2, h3').each_with_object [] do |node, entries| | |
| 44 | + at_css('main').css('h2, h3').each_with_object [] do |node, entries| | |
| 45 | 45 | if node.name == 'h2' |
| 46 | 46 | type = node.content.strip |
| 47 | 47 | type = _fix_name(type) |
| @@ -5,10 +5,10 @@ module Docs · 4 unmodified lines | ||
| 5 | 5 | self.type = 'vue' |
| 6 | 6 | self.links = { |
| 7 | 7 | home: 'https://vuejs.org/', |
| 8 | − code: 'https://github.com/vuejs/vue' | |
| 8 | + code: 'https://github.com/vuejs/core' | |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | − options[:only_patterns] = [/guide\//, /api\//] | |
| 11 | + options[:only_patterns] = [/^$/ ,/guide\//, /api\//] | |
| 12 | 12 | options[:skip] = %w(guide/team.html) |
| 13 | 13 | options[:skip_patterns] = [/guide\/contributing/] |
| 14 | 14 | options[:replace_paths] = { 'guide/' => 'guide/index.html' } |
| @@ -19,16 +19,15 @@ module Docs · 4 unmodified lines | ||
| 19 | 19 | HTML |
| 20 | 20 | |
| 21 | 21 | version '3' do |
| 22 | − self.release = '3.2.26' | |
| 23 | − self.base_url = 'https://v3.vuejs.org/' | |
| 24 | − self.root_path = 'guide/introduction.html' | |
| 25 | − self.initial_paths = %w(api/) | |
| 22 | + self.release = '3.2.30' | |
| 23 | + self.base_url = 'https://vuejs.org/' | |
| 24 | + self.initial_paths = %w(guide/introduction.html) | |
| 26 | 25 | html_filters.push 'vue/entries_v3', 'vue/clean_html' |
| 27 | 26 | end |
| 28 | 27 | |
| 29 | 28 | version '2' do |
| 30 | 29 | self.release = '2.6.12' |
| 31 | − self.base_url = 'https://vuejs.org/v2/' | |
| 30 | + self.base_url = 'https://v2.vuejs.org/' | |
| 32 | 31 | self.root_path = 'guide/index.html' |
| 33 | 32 | self.initial_paths = %w(api/) |
| 34 | 33 | html_filters.push 'vue/entries', 'vue/clean_html' |
| @@ -43,7 +42,7 @@ module Docs · 8 unmodified lines | ||
| 43 | 42 | end |
| 44 | 43 | |
| 45 | 44 | def get_latest_version(opts) |
| 46 | − get_npm_version('vue', opts, 'next') | |
| 45 | + get_npm_version('vue', opts) | |
| 47 | 46 | end |
| 48 | 47 | end |
| 49 | 48 | end |