Dynamic vs Static Knowledge Bases

Learn how the new Knowledge Base feature works.

  • Admin User
    Author
    by Admin User
    8 months ago
  • Static Knowledge Base

    This /docs knowledge base is "static", meaning there are the following route files:

    • app/routes/docs/($lang).tsx

    • app/routes/docs/($lang).categories.$category.tsx

    • app/routes/docs/($lang).articles.$article.tsx

    And the knowledge base slug is manually set. This means, there needs to be a knowledge base created with the knowlegeBase.slug = "docs" and the knowlegeBase.basePath = "/".

    app/routes/docs/($lang).tsx:

    import type { LoaderArgs, V2_MetaFunction } from "@remix-run/node";
    import KbRoutesIndex from "~/modules/knowledgeBase/routes/views/KbRoutes.Index.View";
    import { KbRoutesIndexApi } from "~/modules/knowledgeBase/routes/api/KbRoutes.Index.Api";
    import ServerError from "~/components/ui/errors/ServerError";
    
    

    export const meta: V2_MetaFunction = ({ data }) => data?.metatags; export let loader = (args: LoaderArgs) => KbRoutesIndexApi.loader(args, { kbSlug: "docs" });

    export default () => <KbRoutesIndex />;

    export function ErrorBoundary() { return <ServerError />; }

    Dynamic Knowledge Bases

    For all other knowledge bases, the basePath needs to be /help. And if you need a Help Center knowledge base, you would set the slug as center. This will result in a /help/center route for the knowledge base.

    You can change the hard-coded docs and help directories to fit your knowledge base needs.