From e17bbbf23ce3768cf9eb7991830a8c0bcbc752b3 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 29 Nov 2021 03:43:16 +0000 Subject: [PATCH] Clean more elements --- lib/docs/filters/yarn/clean_html_berry.rb | 41 +++++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/lib/docs/filters/yarn/clean_html_berry.rb b/lib/docs/filters/yarn/clean_html_berry.rb index 00e0316c..5d901150 100644 --- a/lib/docs/filters/yarn/clean_html_berry.rb +++ b/lib/docs/filters/yarn/clean_html_berry.rb @@ -2,21 +2,40 @@ module Docs class Yarn class CleanHtmlBerryFilter < Filter def call - # Version notice - css('#gatsby-focus-wrapper > div').remove + if slug.empty? + @doc = at_css('main') + css( + (['div:first-child'] * 3).join('>'), # Tagline + 'img', + 'hr', # Footer + 'hr + div', # Footer + ).remove - # Logo and menu - css('header > div:first-child').remove + css('a').each do |link| + link.name = 'div' + link.css('h3').each do |node| + node.replace("