Skip to content

Commit a1d4f87

Browse files
author
Yen Ton
committed
get nextjs types by subpath, removed the sticky menu
1 parent deb5f81 commit a1d4f87

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

lib/docs/filters/nextjs/clean_html.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ class Nextjs
33
class CleanHtmlFilter < Filter
44
def call
55
css('.zola-anchor').remove
6-
doc.prepend_child("<h1>NextJS</h1>") if root_page?
6+
doc.prepend_child("<h1>NextJS2</h1>") if root_page?
77
css('div:contains("NEWS:")').remove
88
css('h2:contains("sponsors"), #sponsor-table').remove
9+
css('div.sticky').remove #remove the floating menu
910
doc
1011
end
1112
end

lib/docs/filters/nextjs/entries.rb

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
module Docs
2-
class Nextjs
3-
class EntriesFilter < Docs::EntriesFilter
4-
def get_name
5-
at_css('h1').content
6-
end
2+
class Nextjs
3+
class EntriesFilter < Docs::EntriesFilter
4+
def get_name
5+
name = at_css('h1').content
6+
name.strip!
7+
name
8+
end
79

8-
def get_type
9-
get_name
10-
end
10+
def get_type
11+
if subpath.include?('/architecture')
12+
'Architecture'
13+
elsif subpath.include?('/community')
14+
'Community'
15+
elsif subpath.include?('/getting-started')
16+
'Getting Started'
17+
elsif subpath.include?('/messages')
18+
'Messages'
19+
elsif subpath.include?('/app')
20+
'Using App Router'
21+
elsif subpath.include?('/pages')
22+
'Using Pages Router'
23+
else
24+
get_name
1125
end
26+
end
1227
end
13-
end
28+
end
29+
end

0 commit comments

Comments
 (0)