File tree Expand file tree Collapse file tree 8 files changed +94
-0
lines changed
Expand file tree Collapse file tree 8 files changed +94
-0
lines changed Original file line number Diff line number Diff line change 11[
2+ [
3+ " 2024-02-20" ,
4+ " New documentation: <a href=\" /nextjs/\" >Nextjs</a>"
5+ ],
26 [
37 " 2024-01-24" ,
48 " New documentation: <a href=\" /playwright/\" >Playwright</a>"
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Nextjs
3+ class CleanHtmlFilter < Filter
4+ def call
5+ css ( '.zola-anchor' ) . remove
6+ doc . prepend_child ( "<h1>NextJS2</h1>" ) if root_page?
7+ css ( 'div:contains("NEWS:")' ) . remove
8+ css ( 'h2:contains("sponsors"), #sponsor-table' ) . remove
9+ css ( 'div.sticky' ) . remove #remove the floating menu
10+ css ( 'div.-mt-4' ) . remove #remove the navigation line
11+ css ( 'footer' ) . remove
12+ css ( 'div.feedback_inlineTriggerWrapper__o7yUx' ) . remove
13+ css ( 'header' ) . remove #remove links from the top of the page
14+ css ( 'nav' ) . remove
15+ doc
16+ end
17+ end
18+ end
19+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Nextjs
3+ class EntriesFilter < Docs ::EntriesFilter
4+ def get_name
5+ name = at_css ( 'h1' ) . content
6+ name . strip!
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
14+ end
15+
16+ def get_type
17+ if subpath . include? ( '/architecture' )
18+ 'Architecture'
19+ elsif subpath . include? ( '/community' )
20+ 'Community'
21+ elsif subpath . include? ( '/getting-started' )
22+ 'Getting Started'
23+ elsif subpath . include? ( '/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'
29+ elsif subpath . include? ( '/app' )
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'
35+ elsif subpath . include? ( '/pages' )
36+ 'Using Pages Router'
37+ else
38+ get_name
39+ end
40+ end
41+ end
42+ end
43+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Nextjs < UrlScraper
3+ self . name = 'NextJS'
4+ self . type = 'simple'
5+ self . release = 'v14.1.0'
6+ self . base_url = 'https://nextjs.org/docs'
7+ self . initial_paths = %w( reference/ )
8+ self . links = {
9+ home : 'https://www.nextjs.org/' ,
10+ code : 'https://github.com/vercel/next.js'
11+ }
12+
13+ html_filters . push 'nextjs/entries' , 'nextjs/clean_html'
14+
15+ options [ :attribution ] = <<-HTML
16+ © 2024 Vercel, Inc.
17+ Licensed under the MIT License.
18+ HTML
19+ end
20+ end
Original file line number Diff line number Diff line change 1+ https://assets.vercel.com/image/upload/v1662130559/nextjs/Icon_dark_background.png
2+ https://github.com/vercel/next.js/blob/canary/examples/cms-enterspeed/public/favicon/favicon.ico
You can’t perform that action at this time.
0 commit comments