@orgajs/next
Use Org mode files in Next.js with Orgajs.
Monorepo
This repository is a pnpm workspace.
- Root package:
@orgajs/next - Example app:
example
Installation
pnpm add @orgajs/next @orgajs/loader @orgajs/react
You can also use npm or yarn.
Usage
Create a next.config.js in your project:
const withOrg = require('@orgajs/next')() module.exports = withOrg({ pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'org'], })
By default, @orgajs/next matches and compiles files with the .org extension.
You can pass Org loader options:
const withOrg = require('@orgajs/next')({ options: { jsxRuntime: 'automatic', }, }) module.exports = withOrg()
Components
Create an org-components.js file at your project root to provide global Org components:
export function useOrgComponents() { return { h1: (props) => <h1 style={{ color: 'tomato' }} {...props} />, } }
Example
Install workspace dependencies from the repository root:
Run the example app:
pnpm --filter orga-next-example dev
License
MIT