Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ A content layer for [Next.js](https://nextjs.org/).

## Usage

### 1. Install the package
## 1. Install the package

```shell
npm install @umami/shiso
```

### 2. Create page
## 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`.

Expand All @@ -26,27 +26,21 @@ src

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

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

export async function generateStaticParams() {
const ids = await getContentIds('./src/content/docs');
const { generateMetadata, generateStaticParams, renderPage } = next(config);

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

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} />;
}
export default renderPage(props => {
return <Shiso {...props} component={<Docs />} />;
});
```

### 3. Write content
## 3. Write content

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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions content/docs/components/callout.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Callouts
description: Adds a note to highlight important information
---

## Usage

```jsx
<Callout>This is a callout</Callout>
```

## Output

<Callout>This is a callout</Callout>

## Variants

### note

<Callout variant="note">This displays a note.</Callout>

### warning

<Callout variant="warning">This shows a warning.</Callout>

### info

<Callout variant="info">This highlights important information.</Callout>

### tip

<Callout variant="tip">This suggests a helpful tip.</Callout>

### check

<Callout variant="check">This shows a checked status.</Callout>

### danger

<Callout variant="danger">This show a message about a dangerous action.</Callout>
63 changes: 63 additions & 0 deletions content/docs/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: Configuration
---

## Config file

The `shiso.config.json` file contains the configuration options for your project.

The file has the following schema:

```typescript
interface ShisoConfig {
contentDir: string;
docs: DocsConfig;
blog: BlogConfig;
}
```

At the root level, the properties represent the different content sections of your project.
Shiso currently supports `docs` and `blog` content.

## Docs configuration

```json
{
"title": "Docs - Shiso",
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Getting started",
"pages": ["docs", "docs/installation", "docs/configuration"]
},
{
"group": "Writing content",
"pages": [
"docs/writing-content",
"docs/text",
"docs/images",
"docs/lists",
"docs/code-blocks"
]
}
]
},
{
"tab": "Components",
"pages": ["docs/components", "docs/components/callout"]
}
]
}
}
```

## Blog configuration

```json
{
"title": "Blog - Shiso"
}
```
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ src
In the `page.jsx` file, add the following code:

```js
import { Shiso } from '@umami/shiso';
import { Shiso, Docs } from '@umami/shiso';
import { next } from '@umami/shiso/server';
import config from 'path/to/shiso.config.json';

const { generateMetadata, generateStaticParams, renderPage } = next('docs', config);
const { generateMetadata, generateStaticParams, renderPage } = next(config, 'docs');

export { generateMetadata, generateStaticParams };

export default renderPage(props => {
return <Shiso {...props} />;
return (
<Shiso {...props}>
<Docs />
</Shiso>
);
});
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
45 changes: 24 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,24 @@
]
},
"dependencies": {
"@fontsource/inter": "^5.2.5",
"@fontsource/jetbrains-mono": "^5.2.5",
"@mdx-js/loader": "^3.0.0",
"@mdx-js/mdx": "^3.1.0",
"@mdx-js/react": "^3.0.0",
"@umami/react-zen": "^0.89.0",
"@fontsource/inter": "^5.2.8",
"@fontsource/jetbrains-mono": "^5.2.8",
"@mdx-js/loader": "^3.1.1",
"@mdx-js/mdx": "^3.1.1",
"@mdx-js/react": "^3.1.1",
"@orama/orama": "^3.1.16",
"@tanstack/react-query": "^5.90.5",
"@umami/react-zen": "^0.203.0",
"classnames": "^2.5.1",
"date-fns": "^4.1.0",
"glob": "^10.3.10",
"gray-matter": "^4.0.3",
"highlight.js": "^11.11.1",
"next": "15.2.1",
"lucide-react": "^0.546.0",
"next": "15.3.6",
"next-mdx-remote": "^5.0.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"recursive-readdir": "^2.2.3",
"rehype-highlight": "^7.0.1",
"rehype-slug": "^6.0.0",
Expand All @@ -70,29 +73,29 @@
"@svgr/cli": "^8.1.0",
"@types/css-modules": "^1.0.5",
"@types/mdx": "^2.0.11",
"@types/node": "^22.15.3",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.3",
"@types/node": "^22.18.11",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@umami/esbuild-plugin-css-modules": "^0.4.0",
"dts-bundle": "^0.7.3",
"esbuild": "^0.25.3",
"esbuild": "^0.25.11",
"esbuild-plugin-css-modules": "^0.3.0",
"eslint": "^9.25.1",
"eslint": "^9.38.0",
"eslint-config-next": "15.1.3",
"eslint-config-prettier": "^9.1.0",
"eslint-config-prettier": "^9.1.2",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.4",
"husky": "^9.1.1",
"lint-staged": "^15.5.1",
"lint-staged": "^15.5.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"prettier": "^3.6.2",
"remark-frontmatter": "^5.0.0",
"remark-mdx-frontmatter": "^5.1.0",
"remark-mdx-frontmatter": "^5.2.0",
"stylelint": "^15.10.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recommended": "^14.0.1",
"typescript": "^5.8.3"
"typescript": "^5.9.3"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
Loading