Skip to content

Commit

Permalink
basepath
Browse files Browse the repository at this point in the history
  • Loading branch information
ntotten committed Oct 9, 2023
1 parent e5c8c80 commit 6cc09ad
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 100 deletions.
8 changes: 1 addition & 7 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import withSearch from "./src/markdoc/search.mjs";
const nextConfig = {
swcMinify: true,
reactStrictMode: true,
basePath: "/docs",
images: {
deviceSizes: [576, 640, 760, 828, 992, 1180, 1440],
imageSizes: [96, 128, 256, 384],
Expand All @@ -15,13 +16,6 @@ const nextConfig = {
},
],
},
redirects: async () => [
{
source: "/",
destination: "/docs",
statusCode: 308,
},
],
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function NotFound() {
Sorry, we couldn’t find the page you’re looking for.
</p>
<Link
href="/docs"
href="/"
className="mt-8 text-sm font-medium text-slate-900 dark:text-white"
>
Go back to docs
Expand Down
File renamed without changes.
15 changes: 7 additions & 8 deletions src/app/docs/policies/page.tsx → src/app/policies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Metadata } from "next";
import Link from "next/link";
import { DocsHeader } from "../../../components/DocsHeader";
import { getAllPolicies } from "../../../lib/policies";
import { DocsHeader } from "../../components/DocsHeader";
import { getAllPolicies } from "../../lib/policies";

export const metadata: Metadata = {
title: "Policies",
Expand All @@ -16,15 +16,14 @@ export default async function Page() {
<p>
Zuplo includes policies for any solution you need for securing and
sharing your API. See the{" "}
<Link href="/docs/policies">policy introduction</Link> to learn about
using policies.
<Link href="/policies">policy introduction</Link> to learn about using
policies.
</p>

<p>
The <Link href="/docs/articles/custom-cors-policy">CORS policy</Link> is
a special type of policy that is configured separately. Check out
details
<Link href="/docs/articles/custom-cors-policy">here</Link>.
The <Link href="/articles/custom-cors-policy">CORS policy</Link> is a
special type of policy that is configured separately. Check out details
<Link href="/articles/custom-cors-policy">here</Link>.
</p>

<ul
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function useAutocomplete({
return search(query, { limit: 5 });
},
getItemUrl({ item }) {
return `/docs/${item.url.replace(".md", "")}`;
return `/${item.url.replace(".md", "")}`;
},
onSelect: navigate,
},
Expand Down
4 changes: 2 additions & 2 deletions src/lib/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function getContentBySlug<Data = Record<string, any>>({
const result: Content<Data> = {
source: vfile,
data: data as Data,
href: `/docs/${slug}`,
href: `/${slug}`,
slug,
};
return result;
Expand All @@ -63,7 +63,7 @@ export async function getAllContent<Data = Record<string, any>>(options?: {
const result: Content<Data> = {
source: content,
data: data as Data,
href: file.replace(".md", ""),
href: file.substring(5).replace(".md", ""),
// Remove the /docs
slug: file.substring(5).replace(".md", "").split("/"),
};
Expand Down
Loading

0 comments on commit 6cc09ad

Please sign in to comment.