瀏覽代碼

Update Astro documentation (1.6.3)

Simon Legner 3 年之前
父節點
當前提交
aedb9c3b31
共有 3 個文件被更改,包括 10 次插入1 次删除
  1. 5 0
      lib/docs/filters/astro/clean_html.rb
  2. 2 0
      lib/docs/filters/astro/entries.rb
  3. 3 1
      lib/docs/scrapers/astro.rb

+ 5 - 0
lib/docs/filters/astro/clean_html.rb

@@ -5,6 +5,11 @@ module Docs
         @doc = at_css('article > section')
 
         css('.anchor-link').remove
+        css('.avatar-list').remove
+
+        css('header > h1').each do |node|
+          node.parent.before(node).remove
+        end
 
         css('pre').each do |node|
           node.content = node.css('.line').map(&:content).join("\n")

+ 2 - 0
lib/docs/filters/astro/entries.rb

@@ -14,6 +14,8 @@ module Docs
       end
 
       def additional_entries
+        return if slug.start_with?('guides/deploy')
+        return if slug.start_with?('guides/integrations-guide')
         at_css('article').css('h2, h3').each_with_object [] do |node, entries|
           type = node.content.strip
           type.sub! %r{\s*#\s*}, ''

+ 3 - 1
lib/docs/scrapers/astro.rb

@@ -14,7 +14,9 @@ module Docs
       Licensed under the MIT License.
     HTML
 
-    self.release = '1.4.7'
+    options[:skip_patterns] = [/tutorial/]
+
+    self.release = '1.6.3'
     self.base_url = 'https://docs.astro.build/en/'
     self.initial_paths = %w(getting-started/)