Skip to content

Commit 10a6334

Browse files
committed
files
1 parent 33fc830 commit 10a6334

File tree

7 files changed

+43
-0
lines changed

7 files changed

+43
-0
lines changed

assets/javascripts/news.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[
2+
[
3+
"2024-01-24",
4+
"New documentation: <a href=\"/nextjs/\">Nextjs</a>"
5+
],
26
[
37
"2024-01-12",
48
"New documentation: <a href=\"/hammerspoon/\">Hammerspoon</a>"

lib/docs/filters/nextjs/clean_html.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Docs
2+
class Nextjs
3+
class CleanHtmlFilter < Filter
4+
def call
5+
css('.zola-anchor').remove
6+
doc.prepend_child("<h1>htmx</h1>") if root_page?
7+
css('div:contains("NEWS:")').remove
8+
css('h2:contains("sponsors"), #sponsor-table').remove
9+
end
10+
doc
11+
12+
end
13+
end
14+
end

lib/docs/filters/nextjs/entries.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module Docs
2+
class Nextjs
3+
class EntriesFilter < Docs::EntriesFilter
4+
def get_name
5+
at_css('h1').content
6+
end
7+
8+
def get_type
9+
get_name
10+
end
11+
end
12+
end
13+
end

lib/docs/scrapers/nextjs.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
html_filters.push 'nextjs/entries', 'nextjs/clean_html'
9+
end
10+
end

public/icons/docs/nextjs/16.png

537 Bytes
Loading
1.33 KB
Loading

public/icons/docs/nextjs/SOURCE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
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

0 commit comments

Comments
 (0)