File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def get_name
10
10
def get_type
11
11
breadcrumb_nodes = css ( 'a.tracking-wide' )
12
12
category = breadcrumb_nodes . last . content
13
- is_learn_page = base_url . to_s . end_with ?( 'learn' )
13
+ is_learn_page = path . start_with ?( 'learn/ ' )
14
14
prefix = is_learn_page ? 'Learn: ' : ''
15
15
return prefix + ( category || 'Miscellaneous' )
16
16
end
Original file line number Diff line number Diff line change 1
1
module Docs
2
2
class React < UrlScraper
3
- include MultipleBaseUrls
4
3
5
4
self . name = 'React'
6
5
self . type = 'simple'
@@ -11,15 +10,13 @@ class React < UrlScraper
11
10
12
11
version do
13
12
self . release = '18.3.1'
14
- host = 'https://react.dev'
15
- self . base_urls = [
16
- "#{ host } /reference" ,
17
- "#{ host } /learn" ,
18
- ]
19
- self . initial_paths = %w( /react )
13
+ self . base_url = 'https://react.dev'
14
+ self . initial_paths = %w( /reference/react /learn )
20
15
21
16
html_filters . push 'react/entries_react_dev' , 'react/clean_html_react_dev'
22
17
18
+ options [ :only_patterns ] = [ /\A \/ learn/ , /\A \/ reference/ ]
19
+
23
20
options [ :attribution ] = <<-HTML
24
21
© 2013–present Facebook Inc.< br >
25
22
Licensed under the Creative Commons Attribution 4.0 International Public License.
You can’t perform that action at this time.
0 commit comments