mirror of
https://github.com/cupcakearmy/memoir.git
synced 2025-09-07 08:20:40 +00:00
Compare commits
7 Commits
d7eaf2a06a
...
main
Author | SHA1 | Date | |
---|---|---|---|
c0f8de1f86 | |||
7864c38371 | |||
d17a565130 | |||
12f5d932b1 | |||
|
306eddf4bf | ||
ae86edf961 | |||
|
91d15569a6 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
.next
|
.next
|
||||||
out
|
public
|
27
app/[[...mdxPath]]/page.tsx
Normal file
27
app/[[...mdxPath]]/page.tsx
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { generateStaticParamsFor, importPage } from "nextra/pages";
|
||||||
|
import { useMDXComponents as getMDXComponents } from "../../mdx-components";
|
||||||
|
|
||||||
|
export const generateStaticParams = generateStaticParamsFor("mdxPath");
|
||||||
|
|
||||||
|
export async function generateMetadata(props) {
|
||||||
|
const params = await props.params;
|
||||||
|
const { metadata } = await importPage(params.mdxPath);
|
||||||
|
return metadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Wrapper = getMDXComponents().wrapper;
|
||||||
|
|
||||||
|
export default async function Page(props) {
|
||||||
|
const params = await props.params;
|
||||||
|
const {
|
||||||
|
default: MDXContent,
|
||||||
|
toc,
|
||||||
|
metadata,
|
||||||
|
sourceCode,
|
||||||
|
} = await importPage(params.mdxPath);
|
||||||
|
return (
|
||||||
|
<Wrapper toc={toc} metadata={metadata} sourceCode={sourceCode}>
|
||||||
|
<MDXContent {...props} params={params} />
|
||||||
|
</Wrapper>
|
||||||
|
);
|
||||||
|
}
|
57
app/layout.tsx
Normal file
57
app/layout.tsx
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import { Footer, Layout, Navbar } from "nextra-theme-docs";
|
||||||
|
import { Banner, Head } from "nextra/components";
|
||||||
|
import { getPageMap } from "nextra/page-map";
|
||||||
|
import "nextra-theme-docs/style.css";
|
||||||
|
|
||||||
|
export const metadata = {
|
||||||
|
// Define your metadata here
|
||||||
|
// For more information on metadata API, see: https://nextjs.org/docs/app/building-your-application/optimizing/metadata
|
||||||
|
};
|
||||||
|
|
||||||
|
const navbar = (
|
||||||
|
<Navbar
|
||||||
|
projectLink="https://github.com/cupcakearmy/memoir"
|
||||||
|
logo={<b>Memoir</b>}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const footer = (
|
||||||
|
<Footer>
|
||||||
|
<span>
|
||||||
|
MIT {new Date().getFullYear()} ©{" "}
|
||||||
|
<a href="https://github.com/cupcakearmy" target="_blank">
|
||||||
|
cupcakearmy
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</span>
|
||||||
|
</Footer>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default async function RootLayout({ children }) {
|
||||||
|
return (
|
||||||
|
<html lang="en" dir="ltr" suppressHydrationWarning>
|
||||||
|
<Head>
|
||||||
|
<script
|
||||||
|
defer
|
||||||
|
src="https://spectare.nicco.io//unicorn.js"
|
||||||
|
data-website-id="4aecaa6f-1e68-4a21-960a-8ff5aaa6599a"
|
||||||
|
></script>
|
||||||
|
</Head>
|
||||||
|
<body>
|
||||||
|
<Layout
|
||||||
|
sidebar={{
|
||||||
|
defaultMenuCollapseLevel: 1,
|
||||||
|
}}
|
||||||
|
feedback={{
|
||||||
|
content: "Question? An error? Give feedback →",
|
||||||
|
}}
|
||||||
|
navbar={navbar}
|
||||||
|
pageMap={await getPageMap()}
|
||||||
|
docsRepositoryBase="https://github.com/cupcakearmy/memoir/blob/main"
|
||||||
|
footer={footer}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Layout>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
12
mdx-components.ts
Normal file
12
mdx-components.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { useMDXComponents as getThemeComponents } from "nextra-theme-docs"; // nextra-theme-blog or your custom theme
|
||||||
|
|
||||||
|
// Get the default MDX components
|
||||||
|
const themeComponents = getThemeComponents();
|
||||||
|
|
||||||
|
// Merge components
|
||||||
|
export function useMDXComponents(components = {}) {
|
||||||
|
return {
|
||||||
|
...themeComponents,
|
||||||
|
...components,
|
||||||
|
};
|
||||||
|
}
|
3
next-env.d.ts
vendored
3
next-env.d.ts
vendored
@@ -1,5 +1,6 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
/// <reference path="./.next/types/routes.d.ts" />
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
import nextra from 'nextra'
|
|
||||||
|
|
||||||
const withNextra = nextra({
|
|
||||||
theme: 'nextra-theme-docs',
|
|
||||||
themeConfig: './theme.config.jsx',
|
|
||||||
})
|
|
||||||
|
|
||||||
export default withNextra({
|
|
||||||
output: 'export',
|
|
||||||
images: {
|
|
||||||
unoptimized: true,
|
|
||||||
},
|
|
||||||
})
|
|
5
next.config.mjs
Normal file
5
next.config.mjs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import nextra from "nextra";
|
||||||
|
|
||||||
|
const withNextra = nextra({});
|
||||||
|
|
||||||
|
export default withNextra({});
|
28
package.json
28
package.json
@@ -1,21 +1,21 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "NEXT_TELEMETRY_DISABLED=1 next build",
|
"dev": "next",
|
||||||
"dev": "NEXT_TELEMETRY_DISABLED=1 next dev",
|
"build": "next build",
|
||||||
"start": "pnpm dlx serve out"
|
"start": "next start",
|
||||||
|
"postbuild": "pagefind --site .next/server/app --output-path public/_pagefind"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "^14.2.21",
|
"next": "^15.5.2",
|
||||||
"nextra": "^3.0.15",
|
"nextra": "^4.4.0",
|
||||||
"nextra-theme-docs": "^3.0.15",
|
"nextra-theme-docs": "^4.4.0",
|
||||||
"react": "^18.3.1",
|
"react": "^19.1.1",
|
||||||
"react-dom": "^18.3.1"
|
"react-dom": "^19.1.1"
|
||||||
},
|
},
|
||||||
|
"packageManager": "pnpm@10.15.1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "22.7.7"
|
"@types/node": "24.3.1",
|
||||||
},
|
"@types/react": "19.1.12",
|
||||||
"packageManager": "pnpm@9.12.2"
|
"pagefind": "^1.4.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
3390
pnpm-lock.yaml
generated
3390
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
2
pnpm-workspace.yaml
Normal file
2
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
onlyBuiltDependencies:
|
||||||
|
- sharp
|
@@ -1,27 +0,0 @@
|
|||||||
export default {
|
|
||||||
logo: <span>Memoir</span>,
|
|
||||||
docsRepositoryBase: 'https://github.com/cupcakearmy/memoir/blob/main',
|
|
||||||
project: {
|
|
||||||
link: 'https://github.com/cupcakearmy/memoir',
|
|
||||||
},
|
|
||||||
sidebar: {
|
|
||||||
defaultMenuCollapseLevel: 1,
|
|
||||||
},
|
|
||||||
feedback: {
|
|
||||||
content: 'Question? An error? Give feedback →',
|
|
||||||
},
|
|
||||||
head: (
|
|
||||||
<script defer src="https://spectare.nicco.io//unicorn.js" data-website-id="4aecaa6f-1e68-4a21-960a-8ff5aaa6599a"></script>
|
|
||||||
),
|
|
||||||
footer: {
|
|
||||||
text: (
|
|
||||||
<span>
|
|
||||||
MIT {new Date().getFullYear()} ©{' '}
|
|
||||||
<a href="https://github.com/cupcakearmy" target="_blank">
|
|
||||||
cupcakearmy
|
|
||||||
</a>
|
|
||||||
.
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
}
|
|
@@ -1,10 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": [
|
"target": "ES2017",
|
||||||
"dom",
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"dom.iterable",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": false,
|
"strict": false,
|
||||||
@@ -12,17 +9,16 @@
|
|||||||
"incremental": true,
|
"incremental": true,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"jsx": "preserve"
|
"jsx": "preserve",
|
||||||
},
|
"plugins": [
|
||||||
"include": [
|
{
|
||||||
"next-env.d.ts",
|
"name": "next"
|
||||||
"**/*.ts",
|
}
|
||||||
"**/*.tsx"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user