Browse Source

fastapi: add news entry

Simon Legner 3 years ago
parent
commit
add806dd0f
2 changed files with 6 additions and 17 deletions
  1. 4 0
      assets/javascripts/news.json
  2. 2 17
      lib/docs/filters/fastapi/entries.rb

+ 4 - 0
assets/javascripts/news.json

@@ -1,4 +1,8 @@
 [
+  [
+    "2022-10-09",
+    "New documentation: <a href=\"/fastapi/\">FastAPI</a>"
+  ],
   [
     "2022-10-02",
     "New documentation: <a href=\"/svelte/\">Svelte</a>"

+ 2 - 17
lib/docs/filters/fastapi/entries.rb

@@ -14,27 +14,12 @@ module Docs
         at_css('h1').content
       end
 
-      def get_name_other
-        header = at_css('h1')
-        if header
-          header.content
-        else
-          path_parts.last.titleize
-        end
-      end
-
       def get_type
         if path_parts.length <= 1
-          data = at_css('h1').content
+          at_css('h1').content
         else
-          data = path_parts[0...path_parts.length-1].join(": ").titleize + ": " + at_css('h1').content
+          path_parts[0...-1].join(": ").titleize + ": " + at_css('h1').content
         end
-
-        data
-      end
-
-      def path_count
-        path_parts.length
       end
 
       def additional_entries