diff --git a/package.json b/package.json index 7f349d9b6..d69f86b82 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "copy-to-clipboard": "^3.3.1", "dayjs": "^1.10.4", "fathom-client": "^3.1.0", - "fuse.js": "^6.4.6", "interweave": "^13.1.0", "meilisearch": "^0.32.3", "nanostores": "^0.7.4", diff --git a/src/data/sidebar.ts b/src/data/sidebar.ts index ab47d8a0d..13176efde 100644 --- a/src/data/sidebar.ts +++ b/src/data/sidebar.ts @@ -1,13 +1,7 @@ import { IPage, ISidebarContent } from "../types"; -const makePage = ( - title: string, - category?: string, - tags?: string[], - slug?: string, -): IPage => ({ +const makePage = (title: string, category?: string, slug?: string): IPage => ({ title, - tags, category, slug: slug ?? @@ -21,138 +15,73 @@ export const sidebarContent: ISidebarContent = [ { title: "", pages: [ - makePage("Introduction", undefined, ["home", "railway", "index"], "/"), - makePage("Getting Started", undefined, [ - "introduction", - "tutorial", - "getting started", - ]), + makePage("Introduction", undefined, "/"), + makePage("Getting Started", undefined), ], }, { title: "Develop", pages: [ - makePage("Projects", "develop", [ - "project", - "dashboard", - "canvas", - "invite", - ]), - makePage("Services", "develop", [ - "services", - "monorepo", - "repo", - "domains", - "databases", - ]), - makePage("CLI", "develop", ["CLI", "command", "line"]), - makePage("Variables", "develop", ["railway run", "variables"]), - makePage("Environments", "develop", [ - "staging", - "create env", - "environment", - ]), + makePage("Projects", "develop"), + makePage("Services", "develop"), + makePage("CLI", "develop"), + makePage("Variables", "develop"), + makePage("Environments", "develop"), ], }, { title: "Deploy", pages: [ - makePage("Railway Up", "deploy", [ - "deploying from command line", - "live", - "deploy", - "up", - ]), - makePage("Builds", "deploy", [ - "builds", - "procfile", - "buildpacks", - "heroku", - "paketo", - "nixpacks", - ]), - makePage("Deployments", "deploy", ["logs", "singleton", "rollback"]), - makePage("Healthchecks", "deploy", ["health", "healthcheck"]), - makePage("Dockerfiles", "deploy", ["docker, compose"]), - makePage("Exposing Your App", "deploy", [ - "port", - "bad gateway", - "internet", - "custom domain", - "cloudflare", - ]), - makePage("Networking", "deploy", ["domain", "dns", "cname", "private"]), - makePage("Monorepo", "deploy", ["start command", "yarn workspace"]), - makePage("Integrations", "deploy", [ - "vercel", - "netlify", - "project tokens", - "ci", - "continuous integration", - "aws", - "gcp", - "azure", - "digital ocean", - "doppler", - ]), - makePage("Config as Code", "deploy", ["CaC", "IaC", "service", "config"]), - makePage("Deploy on Railway Button", "deploy", ["button", "badge"]), + makePage("Railway Up", "deploy"), + makePage("Builds", "deploy"), + makePage("Deployments", "deploy"), + makePage("Healthchecks", "deploy"), + makePage("Dockerfiles", "deploy"), + makePage("Exposing Your App", "deploy"), + makePage("Networking", "deploy"), + makePage("Monorepo", "deploy"), + makePage("Integrations", "deploy"), + makePage("Config as Code", "deploy"), + makePage("Deploy on Railway Button", "deploy"), ], }, { title: "Diagnose", pages: [ - makePage("Metrics", "diagnose", ["metrics", "logs"]), - makePage("Webhooks", "diagnose", ["webhooks", "notifcations"]), - makePage("Project Usage", "diagnose", ["usage", "pricing"]), + makePage("Metrics", "diagnose"), + makePage("Webhooks", "diagnose"), + makePage("Project Usage", "diagnose"), ], }, { title: "Databases", pages: [ - makePage("Database View", "databases", [ - "management view", - "plugin view", - "create table", - ]), - makePage("PostgreSQL", "databases", ["database", "sql"]), - makePage("MySQL", "databases", ["database", "sql"]), - makePage("Redis", "databases", ["key", "value", "store", "cache"]), - makePage("MongoDB", "databases", ["database", "nosql"]), + makePage("Database View", "databases"), + makePage("PostgreSQL", "databases"), + makePage("MySQL", "databases"), + makePage("Redis", "databases"), + makePage("MongoDB", "databases"), ], }, { title: "Troubleshoot", - pages: [ - makePage("Fixing Common Errors", "troubleshoot", [ - "error", - "errors", - "railway error", - "railway errors", - "application error", - "failed to respond", - "application failed to respond", - "503", - "service unavailable", - "503 service unavailable", - ]), - ], + pages: [makePage("Fixing Common Errors", "troubleshoot")], }, { title: "Reference", pages: [ - makePage("Pricing", "reference", ["pricing"]), - makePage("Plans", "reference", ["limits", "plans"]), - makePage("Accounts", "reference", ["accounts"]), - makePage("Teams", "reference", ["teams"]), - makePage("CLI API", "reference", ["cli"]), - makePage("Public API", "reference", ["api"]), - makePage("Templates", "reference", ["templates"]), - makePage("Guides", "reference", ["guides"]), - makePage("Usecases", "reference", ["usecases"]), - makePage("Support", "reference", ["support"]), - makePage("Priority Boarding", "reference", ["priority", "boarding"]), - makePage("Compare to Heroku", "reference", ["heroku", "vs"]), + makePage("Pricing", "reference"), + makePage("Plans", "reference"), + makePage("Accounts", "reference"), + makePage("Teams", "reference"), + makePage("CLI API", "reference"), + makePage("Public API", "reference"), + makePage("Templates", "reference"), + makePage("Guides", "reference"), + makePage("Usecases", "reference"), + makePage("Support", "reference"), + makePage("Priority Boarding", "reference"), + makePage("Compare to Heroku", "reference"), ], }, ]; diff --git a/src/layouts/Page.tsx b/src/layouts/Page.tsx index 8e78532ee..3eae14dd1 100644 --- a/src/layouts/Page.tsx +++ b/src/layouts/Page.tsx @@ -1,16 +1,14 @@ +import { Modal } from "@/components/Modal"; +import { SearchModal } from "@/components/Search"; +import { searchStore } from "@/store"; import { useStore } from "@nanostores/react"; -import Fuse from "fuse.js"; -import React, { PropsWithChildren, useEffect, useMemo } from "react"; +import React, { PropsWithChildren, useEffect } from "react"; import tinykeys from "tinykeys"; import "twin.macro"; -import { Modal } from "@/components/Modal"; import { MobileNav, Nav } from "../components/Nav"; -import { SearchModal } from "@/components/Search"; import { Props as SEOProps, SEO } from "../components/SEO"; import { Sidebar } from "../components/Sidebar"; -import { sidebarContent } from "../data/sidebar"; import { Background } from "../pages"; -import { searchStore } from "@/store"; export interface Props { seo?: SEOProps; @@ -30,16 +28,6 @@ export const Page: React.FC> = props => { return () => unsubscribe(); }, [isSearchOpen]); - const fuse = useMemo(() => { - const pages = sidebarContent.map(section => section.pages).flat(); - const fuse = new Fuse(pages, { - keys: ["title", "tags", "category"], - includeScore: true, - }); - - return fuse; - }, [sidebarContent]); - return ( <> diff --git a/src/types.ts b/src/types.ts index 7b3ea0486..a6cdd31d7 100644 --- a/src/types.ts +++ b/src/types.ts @@ -8,7 +8,6 @@ export interface IPage { title: string; slug: string; category?: string; - tags?: string[]; } export interface ISidebarSection { diff --git a/yarn.lock b/yarn.lock index f1ca2865b..66f09c1ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2884,11 +2884,6 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -fuse.js@^6.4.6: - version "6.6.2" - resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-6.6.2.tgz#fe463fed4b98c0226ac3da2856a415576dc9a111" - integrity sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA== - get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"