History

sorted sub-subsection by subsection

Yen Ton committed 2 years ago

Commit e3aa27c1 parent 54ec89c2 files · +16 −1Browse files

Unified · Split

2 files
  1. lib/docs/filters/nextjs/clean_html.rb +1 −0
  2. lib/docs/filters/nextjs/entries.rb +15 −1
lib/docs/filters/nextjs/clean_html.rb+1−0
@@ -7,6 +7,7 @@ module Docs · 6 unmodified lines
7 css('div:contains("NEWS:")').remove7 css('div:contains("NEWS:")').remove
8 css('h2:contains("sponsors"), #sponsor-table').remove8 css('h2:contains("sponsors"), #sponsor-table').remove
9 css('div.sticky').remove #remove the floating menu9 css('div.sticky').remove #remove the floating menu
10 css('div.-mt-4').remove #remove the navigation line
10 css('footer').remove11 css('footer').remove
11 css('div.feedback_inlineTriggerWrapper__o7yUx').remove12 css('div.feedback_inlineTriggerWrapper__o7yUx').remove
12 css('header').remove #remove links from the top of the page13 css('header').remove #remove links from the top of the page
lib/docs/filters/nextjs/entries.rb+15−1
@@ -4,7 +4,13 @@ module Docs · 3 unmodified lines
4 def get_name4 def get_name
5 name = at_css('h1').content5 name = at_css('h1').content
6 name.strip!6 name.strip!
7 name7 #name
8 subpath_items = subpath.split('/', -1)
9 if subpath_items.length >= 5
10 subpath_items[3].capitalize + ': ' + name # e.g. Routing: Defining Routes
11 else
12 name
13 end
8 end14 end
9 15
10 def get_type16 def get_type
@@ -16,8 +22,16 @@ module Docs · 5 unmodified lines
16 'Getting Started'22 'Getting Started'
17 elsif subpath.include?('/messages')23 elsif subpath.include?('/messages')
18 'Messages'24 'Messages'
25 elsif subpath.include?('/app/building-your-application')
26 'Using App Router: Building your application'
27 elsif subpath.include?('/app/api-reference')
28 'Using App Router: api-reference'
19 elsif subpath.include?('/app')29 elsif subpath.include?('/app')
20 'Using App Router'30 'Using App Router'
31 elsif subpath.include?('/pages/building-your-application')
32 'Using Pages Router: Building your application'
33 elsif subpath.include?('/pages/api-reference')
34 'Using Pages Router: api-reference'
21 elsif subpath.include?('/pages')35 elsif subpath.include?('/pages')
22 'Using Pages Router'36 'Using Pages Router'
23 else37 else