Skip to content

Commit 0ee3c23

Browse files
authored
Merge pull request #3 from snzow/UpdatedSubsection
sorted sub-subsection by subsection
2 parents 54ec89c + e3aa27c commit 0ee3c23

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/docs/filters/nextjs/clean_html.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def call
77
css('div:contains("NEWS:")').remove
88
css('h2:contains("sponsors"), #sponsor-table').remove
99
css('div.sticky').remove #remove the floating menu
10+
css('div.-mt-4').remove #remove the navigation line
1011
css('footer').remove
1112
css('div.feedback_inlineTriggerWrapper__o7yUx').remove
1213
css('header').remove #remove links from the top of the page

lib/docs/filters/nextjs/entries.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ class EntriesFilter < Docs::EntriesFilter
44
def get_name
55
name = at_css('h1').content
66
name.strip!
7-
name
7+
#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
814
end
915

1016
def get_type
@@ -16,8 +22,16 @@ def get_type
1622
'Getting Started'
1723
elsif subpath.include?('/messages')
1824
'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'
1929
elsif subpath.include?('/app')
2030
'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'
2135
elsif subpath.include?('/pages')
2236
'Using Pages Router'
2337
else

0 commit comments

Comments
 (0)