aodhan 1 year ago
parent
commit
10a6334650

+ 4 - 0
assets/javascripts/news.json

@@ -1,4 +1,8 @@
 [
+  [
+    "2024-01-24",
+    "New documentation: <a href=\"/nextjs/\">Nextjs</a>"
+  ],
   [
     "2024-01-12",
     "New documentation: <a href=\"/hammerspoon/\">Hammerspoon</a>"

+ 14 - 0
lib/docs/filters/nextjs/clean_html.rb

@@ -0,0 +1,14 @@
+module Docs
+    class Nextjs
+        class CleanHtmlFilter < Filter
+            def call
+                css('.zola-anchor').remove
+                doc.prepend_child("<h1>htmx</h1>") if root_page?
+                css('div:contains("NEWS:")').remove
+                css('h2:contains("sponsors"), #sponsor-table').remove
+            end
+                doc
+        
+        end
+    end
+end

+ 13 - 0
lib/docs/filters/nextjs/entries.rb

@@ -0,0 +1,13 @@
+module Docs
+    class Nextjs
+        class EntriesFilter < Docs::EntriesFilter
+            def get_name
+              at_css('h1').content
+            end
+
+            def get_type
+                get_name
+            end
+        end
+    end
+end

+ 10 - 0
lib/docs/scrapers/nextjs.rb

@@ -0,0 +1,10 @@
+module Docs
+    class Nextjs < UrlScraper
+        self.name = 'nextjs`'
+        self.type = 'simple'
+        self.release = 'v14.1.0'
+        self.base_url = 'https://nextjs.org/docs'
+            self.initial_paths = %w(reference/)
+            html_filters.push 'nextjs/entries', 'nextjs/clean_html'
+    end
+end

BIN
public/icons/docs/nextjs/16.png


BIN
public/icons/docs/nextjs/16@2x.png


+ 2 - 0
public/icons/docs/nextjs/SOURCE

@@ -0,0 +1,2 @@
+https://assets.vercel.com/image/upload/v1662130559/nextjs/Icon_dark_background.png
+https://github.com/vercel/next.js/blob/canary/examples/cms-enterspeed/public/favicon/favicon.ico