fix warnings

pull/2375/head
Gergely Gombos 1 month ago
parent d6df6b5135
commit d8eb56811e

@ -6,7 +6,7 @@ module Docs
# Remove breadcrumbs before h1 # Remove breadcrumbs before h1
css('h1').each do |node| css('h1').each do |node|
if (node.previous) if node.previous
node.previous.remove node.previous.remove
end end
end end

@ -3,7 +3,8 @@ module Docs
class EntriesReactDevFilter < Docs::EntriesFilter class EntriesReactDevFilter < Docs::EntriesFilter
def get_name def get_name
name = at_css('article h1')&.content name = at_css('article h1')&.content
return update_canary_copy(name)
update_canary_copy(name)
end end
def get_type def get_type
@ -17,12 +18,14 @@ module Docs
&.concat(": ") &.concat(": ")
is_learn_page = path.start_with?('learn/') || slug == 'learn' is_learn_page = path.start_with?('learn/') || slug == 'learn'
prefix = is_learn_page ? 'Learn: ' : top_category || '' prefix = is_learn_page ? 'Learn: ' : top_category || ''
return update_canary_copy(prefix + (category || 'Miscellaneous'))
update_canary_copy(prefix + (category || 'Miscellaneous'))
end end
def update_canary_copy(string) def update_canary_copy(string)
canary_copy = '- This feature is available in the latest Canary' canary_copy = '- This feature is available in the latest Canary'
return string.sub(canary_copy, ' (Canary)')
string.sub(canary_copy, ' (Canary)')
end end
def additional_entries def additional_entries
@ -34,7 +37,8 @@ module Docs
next if excluded.include?(name.downcase) next if excluded.include?(name.downcase)
entries << [name, node['id'], type] entries << [name, node['id'], type]
end end
return entries
entries
end end
end end
end end

Loading…
Cancel
Save