use single base URL for working crosslinks

pull/2375/head
Gergely Gombos 2 months ago
parent fefde4e15b
commit 33aba064c1

@ -10,7 +10,7 @@ module Docs
def get_type
breadcrumb_nodes = css('a.tracking-wide')
category = breadcrumb_nodes.last.content
is_learn_page = base_url.to_s.end_with?('learn')
is_learn_page = path.start_with?('learn/')
prefix = is_learn_page ? 'Learn: ' : ''
return prefix + (category || 'Miscellaneous')
end

@ -1,6 +1,5 @@
module Docs
class React < UrlScraper
include MultipleBaseUrls
self.name = 'React'
self.type = 'simple'
@ -11,15 +10,13 @@ module Docs
version do
self.release = '18.3.1'
host = 'https://react.dev'
self.base_urls = [
"#{host}/reference",
"#{host}/learn",
]
self.initial_paths = %w(/react)
self.base_url = 'https://react.dev'
self.initial_paths = %w(/reference/react /learn)
html_filters.push 'react/entries_react_dev', 'react/clean_html_react_dev'
options[:only_patterns] = [/\A\/learn/, /\A\/reference/]
options[:attribution] = <<-HTML
&copy; 2013&ndash;present Facebook Inc.<br>
Licensed under the Creative Commons Attribution 4.0 International Public License.

Loading…
Cancel
Save