0.50.0 • Published 4 months ago

@umami/shiso v0.50.0

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

Shiso

A content layer for Next.js.

Learn more

Usage

1. Install the package

npm install @umami/shiso

2. Create page

In your app folder, create a folder for the content section you wish to add. In this case we are creating a section for docs.

src
├── app
│   └── docs
│       └── [[...slug]]
│           └── page.jsx

In the page.jsx file, add the following code:

import { Shiso } from '@umami/shiso';
import { getContent, getContentIds } from '@@umami/shiso/server';
import config from 'path/to/shiso.config.json';

export async function generateStaticParams() {
  const ids = await getContentIds('./src/content/docs');

  return ids.map((id: string) => ({
    id: id.split('/')
  }));
}

export default async function Page({ params }: { params: Promise<{ id: string[] }> }) {
  const content = await getContent(await params, './src/content/docs');

  return <Shiso type="docs" content={content} config={config} />;
}

3. Write content

In the folder you specified, start adding .mdx files.

License

MIT

0.43.0

4 months ago

0.48.0

4 months ago

0.46.0

4 months ago

0.44.0

4 months ago

0.50.0

4 months ago

0.49.0

4 months ago

0.47.0

4 months ago

0.45.0

4 months ago

0.42.0

5 months ago

0.41.0

5 months ago

0.40.0

6 months ago

0.39.0

6 months ago

0.38.0

6 months ago

0.37.0

6 months ago

0.36.0

6 months ago

0.35.0

6 months ago

0.34.0

6 months ago

0.33.0

6 months ago

0.32.0

6 months ago

0.31.0

6 months ago

0.30.0

6 months ago

0.21.0

7 months ago

0.20.0

7 months ago

0.19.0

7 months ago

0.18.0

7 months ago

0.29.0

6 months ago

0.28.0

6 months ago

0.27.0

6 months ago

0.26.0

6 months ago

0.25.0

6 months ago

0.24.0

6 months ago

0.22.0

7 months ago

0.10.0

7 months ago

0.11.0

7 months ago

0.9.0

7 months ago

0.12.0

7 months ago

0.8.0

7 months ago

0.13.0

7 months ago

0.14.0

7 months ago

0.15.0

7 months ago

0.16.0

7 months ago

0.17.0

7 months ago

0.7.0

7 months ago

0.6.0

7 months ago

0.5.0

7 months ago

0.4.0

7 months ago

0.3.0

7 months ago

0.2.0

7 months ago

0.1.0

7 months ago