From 6100912e469261a531ecd271cba5dc47679dbfb5 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Wed, 26 Jul 2023 22:46:27 +0200 Subject: [PATCH] Update Vue documentation Fixes #2004. --- lib/docs/filters/vue/clean_html.rb | 9 ++------- lib/docs/scrapers/vue.rb | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/docs/filters/vue/clean_html.rb b/lib/docs/filters/vue/clean_html.rb index ae12d743..448b9c37 100644 --- a/lib/docs/filters/vue/clean_html.rb +++ b/lib/docs/filters/vue/clean_html.rb @@ -2,13 +2,8 @@ module Docs class Vue class CleanHtmlFilter < Filter def call - if current_url.host == 'vitejs.dev' - return '

Vite

' if root_page? - @doc = at_css('.content > div') - else - return '

Vue.js

' if root_page? - @doc = at_css(version == '3' ? 'main > div > div' : '.content') - end + return '

Vue.js

' if root_page? + @doc = at_css(version == '3' ? 'main > div > div' : '.content') at_css('h1').content = 'Vue.js' if root_page? doc.child.before('

Vue.js API

') if slug == 'api/' || slug == 'api/index' diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index 3b2bde9f..53f0723a 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -29,6 +29,7 @@ module Docs self.release = '2.7.14' self.base_url = 'https://v2.vuejs.org/v2/' self.initial_paths = %w(api/) + self.root_path = 'guide/' html_filters.push 'vue/entries', 'vue/clean_html' end