| @@ -3,7 +3,8 @@ module Docs · 2 unmodified lines |
| 3 | class EntriesReactDevFilter < Docs::EntriesFilter | 3 | class EntriesReactDevFilter < Docs::EntriesFilter |
| 4 | def get_name | 4 | def get_name |
| 5 | name = at_css('article h1')&.content | 5 | name = at_css('article h1')&.content |
| 6 | return update_canary_copy(name) | 6 | |
| | 7 | update_canary_copy(name) |
| 7 | end | 8 | end |
| 8 | | 9 | |
| 9 | def get_type | 10 | def get_type |
| @@ -17,12 +18,14 @@ module Docs · 7 unmodified lines |
| 17 | &.concat(": ") | 18 | &.concat(": ") |
| 18 | is_learn_page = path.start_with?('learn/') || slug == 'learn' | 19 | is_learn_page = path.start_with?('learn/') || slug == 'learn' |
| 19 | prefix = is_learn_page ? 'Learn: ' : top_category || '' | 20 | prefix = is_learn_page ? 'Learn: ' : top_category || '' |
| 20 | return update_canary_copy(prefix + (category || 'Miscellaneous')) | 21 | |
| | 22 | update_canary_copy(prefix + (category || 'Miscellaneous')) |
| 21 | end | 23 | end |
| 22 | | 24 | |
| 23 | def update_canary_copy(string) | 25 | def update_canary_copy(string) |
| 24 | canary_copy = '- This feature is available in the latest Canary' | 26 | canary_copy = '- This feature is available in the latest Canary' |
| 25 | return string.sub(canary_copy, ' (Canary)') | 27 | |
| | 28 | string.sub(canary_copy, ' (Canary)') |
| 26 | end | 29 | end |
| 27 | | 30 | |
| 28 | def additional_entries | 31 | def additional_entries |
| @@ -34,7 +37,8 @@ module Docs · 5 unmodified lines |
| 34 | next if excluded.include?(name.downcase) | 37 | next if excluded.include?(name.downcase) |
| 35 | entries << [name, node['id'], type] | 38 | entries << [name, node['id'], type] |
| 36 | end | 39 | end |
| 37 | return entries | 40 | |
| | 41 | entries |
| 38 | end | 42 | end |
| 39 | end | 43 | end |
| 40 | end | 44 | end |