Skip to content

Commit ccba127

Browse files
authored
Merge pull request #1 from snzow/code-working
Code working
2 parents 903fac5 + deb5f81 commit ccba127

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

lib/docs/filters/nextjs/clean_html.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Nextjs
33
class CleanHtmlFilter < Filter
44
def call
55
css('.zola-anchor').remove
6-
doc.prepend_child("<h1>htmx</h1>") if root_page?
6+
doc.prepend_child("<h1>NextJS</h1>") if root_page?
77
css('div:contains("NEWS:")').remove
88
css('h2:contains("sponsors"), #sponsor-table').remove
99
doc

lib/docs/scrapers/nextjs.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
module Docs
22
class Nextjs < UrlScraper
3-
self.name = 'nextjs`'
3+
self.name = 'NextJS'
44
self.type = 'simple'
55
self.release = 'v14.1.0'
66
self.base_url = 'https://nextjs.org/docs'
7-
self.initial_paths = %w(reference/)
8-
html_filters.push 'nextjs/entries', 'nextjs/clean_html'
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+
&copy; 2024 Vercel, Inc.
17+
Licensed under the MIT License.
18+
HTML
919
end
10-
end
20+
end

0 commit comments

Comments
 (0)