Update Vue.js documentation (3.2.30)

https://blog.vuejs.org/posts/vue-3-as-the-new-default.html
pull/1704/head
Simon Legner 3 years ago
parent bb78302881
commit 6faab8bcc8

@ -6,7 +6,8 @@ module Docs
return '<h1>Vite</h1>' if root_page? return '<h1>Vite</h1>' if root_page?
@doc = at_css('.content > div') @doc = at_css('.content > div')
else else
@doc = at_css(version == '3' ? 'main' : '.content') return '<h1>Vue.js</h1>' if root_page?
@doc = at_css(version == '3' ? 'main > div > div' : '.content')
end end
at_css('h1').content = 'Vue.js' if root_page? at_css('h1').content = 'Vue.js' if root_page?
@ -14,6 +15,7 @@ module Docs
css('.demo', '.guide-links', '.footer', '#ad').remove css('.demo', '.guide-links', '.footer', '#ad').remove
css('.header-anchor', '.page-edit', '.page-nav').remove css('.header-anchor', '.page-edit', '.page-nav').remove
css('.next-steps').remove
css('.custom-block-title').each do |node| css('.custom-block-title').each do |node|
node.name = 'strong' node.name = 'strong'

@ -9,9 +9,9 @@ module Docs
else else
name = at_css('h1').content name = at_css('h1').content
name = _fix_name(name) name = _fix_name(name)
subtype = at_css('.sidebar-heading.open, .sidebar-heading.active, .sidebar-link.active') subtype = at_css('.title-text.active')
index = css('.sidebar-link').to_a.index(at_css('.sidebar-link.active')) index = css('aside nav .link').to_a.index(at_css('aside nav .link.active'))
name.prepend "#{index + 1}. " if index && !slug.start_with?('api') name.prepend "#{index + 1}. " if index && !slug.start_with?('api') && !slug.start_with?('style-guide')
name.concat " (#{subtype.content.strip})" if subtype && slug.start_with?('guide') name.concat " (#{subtype.content.strip})" if subtype && slug.start_with?('guide')
name name
end end
@ -26,12 +26,12 @@ module Docs
def get_type def get_type
if slug.start_with?('guide/migration') if slug.start_with?('guide/migration')
'Migration' 'Migration'
elsif slug.start_with?('guide') elsif slug.start_with?('guide') or root_page?
'Guide' 'Guide'
elsif slug == 'style-guide/' elsif slug.start_with?('style-guide')
'Style Guide' 'Style Guide'
else else
title = at_css('.sidebar-heading.open, .sidebar-heading.active, .sidebar-link.active').content.strip title = at_css('.title-text.active').content.strip
title = _fix_name(title) title = _fix_name(title)
"API: #{title}" "API: #{title}"
end end
@ -41,7 +41,7 @@ module Docs
return [] if slug.start_with?('guide') return [] if slug.start_with?('guide')
type = nil type = nil
css('h2, h3').each_with_object [] do |node, entries| at_css('main').css('h2, h3').each_with_object [] do |node, entries|
if node.name == 'h2' if node.name == 'h2'
type = node.content.strip type = node.content.strip
type = _fix_name(type) type = _fix_name(type)

@ -5,10 +5,10 @@ module Docs
self.type = 'vue' self.type = 'vue'
self.links = { self.links = {
home: 'https://vuejs.org/', home: 'https://vuejs.org/',
code: 'https://github.com/vuejs/vue' code: 'https://github.com/vuejs/core'
} }
options[:only_patterns] = [/guide\//, /api\//] options[:only_patterns] = [/^$/ ,/guide\//, /api\//]
options[:skip] = %w(guide/team.html) options[:skip] = %w(guide/team.html)
options[:skip_patterns] = [/guide\/contributing/] options[:skip_patterns] = [/guide\/contributing/]
options[:replace_paths] = { 'guide/' => 'guide/index.html' } options[:replace_paths] = { 'guide/' => 'guide/index.html' }
@ -19,16 +19,15 @@ module Docs
HTML HTML
version '3' do version '3' do
self.release = '3.2.26' self.release = '3.2.30'
self.base_url = 'https://v3.vuejs.org/' self.base_url = 'https://vuejs.org/'
self.root_path = 'guide/introduction.html' self.initial_paths = %w(guide/introduction.html)
self.initial_paths = %w(api/)
html_filters.push 'vue/entries_v3', 'vue/clean_html' html_filters.push 'vue/entries_v3', 'vue/clean_html'
end end
version '2' do version '2' do
self.release = '2.6.12' self.release = '2.6.12'
self.base_url = 'https://vuejs.org/v2/' self.base_url = 'https://v2.vuejs.org/'
self.root_path = 'guide/index.html' self.root_path = 'guide/index.html'
self.initial_paths = %w(api/) self.initial_paths = %w(api/)
html_filters.push 'vue/entries', 'vue/clean_html' html_filters.push 'vue/entries', 'vue/clean_html'
@ -43,7 +42,7 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
get_npm_version('vue', opts, 'next') get_npm_version('vue', opts)
end end
end end
end end

Loading…
Cancel
Save