repos / neovimcraft

website that makes it easy to find neovim plugins
git clone https://github.com/neurosnap/neovimcraft.git

commit
06e602c
parent
188cb1b
author
Eric Bower
date
2024-04-02 17:34:44 +0000 UTC
chore: add trailing slash to directories to prevent 301
4 files changed,  +21, -21
M src/scripts/patch.ts
+4, -4
 1@@ -1,9 +1,9 @@
 2-import scrapePluginData from "../../data/scrape.json" assert { type: "json" };
 3-import manualPluginData from "../../data/manual.json" assert { type: "json" };
 4-import scrapeConfigData from "../../data/scrape-config.json" assert {
 5+import scrapePluginData from "../../data/scrape.json" with { type: "json" };
 6+import manualPluginData from "../../data/manual.json" with { type: "json" };
 7+import scrapeConfigData from "../../data/scrape-config.json" with {
 8   type: "json",
 9 };
10-import manualConfigData from "../../data/manual-config.json" assert {
11+import manualConfigData from "../../data/manual-config.json" with {
12   type: "json",
13 };
14 
M src/scripts/process.ts
+4, -4
 1@@ -1,14 +1,14 @@
 2-import resourceFile from "../../data/resources.json" assert { type: "json" };
 3-import resourceConfigFile from "../../data/resources-config.json" assert {
 4+import resourceFile from "../../data/resources.json" with { type: "json" };
 5+import resourceConfigFile from "../../data/resources-config.json" with {
 6   type: "json",
 7 };
 8 
 9 import type { Plugin, Resource } from "../types.ts";
10 import { createPlugin, getResourceId } from "../entities.ts";
11 import { fetchGithubData, ghToken } from "../github.ts";
12-import { fetchSrhtData } from "../stht.ts";
13+// import { fetchSrhtData } from "../stht.ts";
14 
15-const srhtToken = Deno.env.get("SRHT_ACCESS_TOKEN") || "";
16+// const srhtToken = Deno.env.get("SRHT_ACCESS_TOKEN") || "";
17 
18 const option = Deno.args[0];
19 if (option === "missing") {
M src/scripts/resource.ts
+4, -4
 1@@ -1,9 +1,9 @@
 2-import resourceFile from "../../data/resources.json" assert { type: "json" };
 3-import resourceConfigFile from "../../data/resources-config.json" assert {
 4+import resourceFile from "../../data/resources.json" with { type: "json" };
 5+import resourceConfigFile from "../../data/resources-config.json" with {
 6   type: "json",
 7 };
 8-import manualFile from "../../data/manual.json" assert { type: "json" };
 9-import manualConfigFile from "../../data/manual-config.json" assert {
10+import manualFile from "../../data/manual.json" with { type: "json" };
11+import manualConfigFile from "../../data/manual-config.json" with {
12   type: "json",
13 };
14 
M src/scripts/static.ts
+9, -9
 1@@ -1,6 +1,6 @@
 2-import htmlFile from "../../data/html.json" assert { type: "json" };
 3-import dbFile from "../../data/db.json" assert { type: "json" };
 4-import configDbFile from "../../data/db-config.json" assert { type: "json" };
 5+import htmlFile from "../../data/html.json" with { type: "json" };
 6+import dbFile from "../../data/db.json" with { type: "json" };
 7+import configDbFile from "../../data/db-config.json" with { type: "json" };
 8 
 9 import { dirname } from "../deps.ts";
10 import { format, relativeTimeFromDates } from "../date.ts";
11@@ -96,8 +96,8 @@ const createHtmlFile = ({ head, body }: { head: string; body: string }) => {
12 const createNav = () => {
13   const links = [
14     ["/", "plugins"],
15-    ["/c", "configs"],
16-    ["/about", "about"],
17+    ["/c/", "configs"],
18+    ["/about/", "about"],
19   ];
20 
21   const linksStr = links.reduce((acc, link) => {
22@@ -354,13 +354,13 @@ const createSearchPage = (data: PluginData, by: keyof Plugin) => {
23     if (by === "createdAt") {
24       str += "created\n";
25     } else {
26-      str += '<a href="/created">created</a>\n';
27+      str += '<a href="/created/">created</a>\n';
28     }
29 
30     if (by === "updatedAt") {
31       str += "updated\n";
32     } else {
33-      str += '<a href="/updated">updated</a>\n';
34+      str += '<a href="/updated/">updated</a>\n';
35     }
36 
37     return str;
38@@ -438,13 +438,13 @@ const createSearchConfigPage = (data: PluginData, by: keyof Plugin) => {
39     if (by === "createdAt") {
40       str += "created\n";
41     } else {
42-      str += '<a href="/c/created">created</a>\n';
43+      str += '<a href="/c/created/">created</a>\n';
44     }
45 
46     if (by === "updatedAt") {
47       str += "updated\n";
48     } else {
49-      str += '<a href="/c/updated">updated</a>\n';
50+      str += '<a href="/c/updated/">updated</a>\n';
51     }
52 
53     return str;