Unified · Split
| @@ -3,9 +3,10 @@ module Docs · 2 unmodified lines | |||
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | css('.zola-anchor').remove | 5 | css('.zola-anchor').remove |
| 6 | doc.prepend_child("<h1>NextJS</h1>") if root_page? | 6 | doc.prepend_child("<h1>NextJS2</h1>") if root_page? |
| 7 | css('div:contains("NEWS:")').remove | 7 | css('div:contains("NEWS:")').remove |
| 8 | css('h2:contains("sponsors"), #sponsor-table').remove | 8 | css('h2:contains("sponsors"), #sponsor-table').remove |
| 9 | css('div.sticky').remove #remove the floating menu | ||
| 9 | doc | 10 | doc |
| 10 | end | 11 | end |
| 11 | end | 12 | end |
| @@ -1,13 +1,29 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Nextjs | 2 | class Nextjs |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | def get_name | 4 | def get_name |
| 5 | at_css('h1').content | 5 | name = at_css('h1').content |
| 6 | end | 6 | name.strip! |
| 7 | name | ||
| 8 | end | ||
| 7 | 9 | ||
| 8 | def get_type | 10 | def get_type |
| 9 | get_name | 11 | if subpath.include?('/architecture') |
| 10 | end | 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 | ||
| 11 | end | 25 | end |
| 26 | end | ||
| 12 | end | 27 | end |
| 13 | end | 28 | end |
| 29 | end | ||