### Start Noxion Blog Development Server Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/quick-start.md This snippet shows the commands to install dependencies and start the development server for a Noxion blog. Once running, the blog can be accessed locally, and Notion posts will appear automatically. ```bash bun install bun run dev ``` -------------------------------- ### Deploy Noxion Blog with Docker Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/quick-start.md This snippet shows the command to start a Noxion blog using Docker Compose. This is an alternative deployment method for running the blog locally or on a server with Docker installed. ```bash docker compose up ``` -------------------------------- ### Start Demo App with Bun Source: https://github.com/jiwonme/noxion/blob/main/README.md Navigates to the 'apps/web' directory and starts the development server for the demo application using Bun. This is useful for local development and previewing changes. ```shell cd apps/web && bun run dev ``` -------------------------------- ### Start Local Development Server with Yarn Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/README.md Starts a local development server for the Docusaurus website. Changes are reflected live without requiring a server restart. Opens the site in a browser window. ```bash yarn start ``` -------------------------------- ### Configure Noxion Blog Environment Variables Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/quick-start.md This snippet demonstrates how to set up the environment variables for a Noxion blog after scaffolding. It involves copying an example environment file and editing it with specific site details. ```bash cd my-blog cp .env.example .env ``` ```bash NOTION_PAGE_ID=abc123def456... SITE_DOMAIN=myblog.com SITE_NAME=My Blog SITE_AUTHOR=Your Name SITE_DESCRIPTION=A blog about things I find interesting ``` -------------------------------- ### Install Dependencies with Yarn Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/README.md Installs project dependencies using the Yarn package manager. This is typically the first step before running other commands. ```bash yarn ``` -------------------------------- ### Configure Notion Integration Token Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/notion-setup.md Shows how to set the NOTION_TOKEN environment variable for accessing private Notion pages. This requires creating an integration in Notion and adding its token to your .env file. ```bash NOTION_TOKEN=secret_xxx... ``` -------------------------------- ### Scaffold Noxion Blog with Bun CLI Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/quick-start.md This snippet shows how to create a new Noxion blog project using the Bun CLI. It covers both interactive and non-interactive modes for setting up project details like Notion page ID, site name, and domain. ```bash bun create noxion my-blog ``` ```bash bun create noxion my-blog \ --yes \ --notion-id=abc123def456 \ --name="My Blog" \ --domain=myblog.com \ --author="Your Name" ``` -------------------------------- ### Install Dependencies with Bun Source: https://github.com/jiwonme/noxion/blob/main/README.md This command installs all project dependencies for the Noxion monorepo using the Bun package manager. It's a standard step for local development. ```bash # Install dependencies bun install ``` -------------------------------- ### Deploy Noxion Blog with Vercel CLI Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/quick-start.md This snippet shows the command to deploy a Noxion blog using the Vercel CLI. It's recommended to add the same environment variables configured locally to the Vercel dashboard for a successful deployment. ```bash vercel ``` -------------------------------- ### Build Static Website Content with Yarn Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/README.md Generates the static content for the website into the 'build' directory. This output can be hosted on any static content hosting service. ```bash yarn build ``` -------------------------------- ### Scaffold a New Noxion Blog with Bun Source: https://github.com/jiwonme/noxion/blob/main/README.md This command uses the Bun package manager to create a new Next.js blog project scaffolded by Noxion. It's the quickest way to start a new blog with Noxion. ```bash bun create noxion my-blog cd my-blog # Edit .env with your Notion page ID bun run dev ``` -------------------------------- ### Frontmatter Overrides in Notion Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/notion-setup.md Illustrates how to use a code block at the beginning of a Notion page to override metadata like URL slug, title, and description. Comments starting with '#' are ignored. ```yaml cleanUrl: /my-custom-slug title: Custom SEO Title | Site Name description: Custom meta description for search engines floatFirstTOC: right ``` ```yaml cleanUrl: /my-post # title: Draft title (commented out) description: My description ``` -------------------------------- ### Scaffold a New Noxion Blog Project with create-noxion Source: https://context7.com/jiwonme/noxion/llms.txt The `create-noxion` CLI tool scaffolds a new Next.js blog project with Noxion packages pre-configured. It sets up environment templates and a demo structure, simplifying project initialization. After creation, you need to configure your Notion page ID in the `.env` file and start the development server. ```bash # Create a new Noxion blog project bun create noxion my-blog # Navigate to the project directory cd my-blog # Configure your Notion page ID in .env echo "NOTION_PAGE_ID=your-notion-database-page-id" > .env # Start the development server bun run dev # Open http://localhost:3000 to see your blog ``` -------------------------------- ### Quick Deploy with Docker Compose Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/deployment/docker.md This snippet demonstrates the quickest way to deploy the Noxion web application using Docker Compose. It involves navigating to the application directory, copying and filling in environment variables, and then starting the services in detached mode. Access the application at http://localhost:3000. ```bash cd apps/web cp .env.example .env # fill in your values docker compose up -d ``` -------------------------------- ### Deploy Website with Yarn (SSH) Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/README.md Deploys the Docusaurus website using SSH. This command builds the site and pushes it to the 'gh-pages' branch, suitable for GitHub Pages. ```bash USE_SSH=true yarn deploy ``` -------------------------------- ### Extract Notion Page ID from URL Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/learn/notion-setup.md Demonstrates how to extract the unique 32-character page ID from a Notion database URL. This ID is crucial for Noxion to access your Notion content. ```text https://notion.so/your-workspace/My-Database-abc123def456... ^^^^^^^^^^^^^^^^ This is your page ID ``` -------------------------------- ### Usage Example: Rendering PostList in a Server Component Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/reference/renderer/post-list.md Demonstrates how to fetch post data using an async function (e.g., getAllPosts) and then render the PostList component in a React Server Component. It shows mapping fetched posts to the expected PostCardProps format. ```tsx // app/page.tsx (Server Component) import { PostList } from "@noxion/renderer"; import { getAllPosts } from "@/lib/notion"; export default async function HomePage() { const posts = await getAllPosts(); return (

My Blog

({ id: p.id, title: p.title, slug: p.slug, date: p.date, tags: p.tags, coverImage: p.coverImage, category: p.category, description: p.description, author: p.author, }))} />
); } ``` -------------------------------- ### Deploy Website with Yarn (No SSH) Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/README.md Deploys the Docusaurus website without using SSH. Requires specifying the GitHub username. This command builds the site and pushes it to the 'gh-pages' branch. ```bash GIT_USER= yarn deploy ``` -------------------------------- ### Enable Image Optimization with Next.js Image Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/reference/renderer/notion-page.md This example shows how to integrate `next/image` with the NotionPage component for optimized image loading. By passing the `Image` component from 'next/image' to the `nextImage` prop, the component will automatically handle AVIF/WebP conversion and other optimizations provided by Next.js. ```tsx import Image from "next/image"; import { NotionPage } from "@noxion/renderer"; ; ``` -------------------------------- ### NoxionThemeProvider Component Setup Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/reference/renderer/theme-provider.md The NoxionThemeProvider component is essential for providing theme context to all Noxion components. It should wrap your entire application or at least all components that utilize Noxion's theming features. It accepts a theme configuration and an initial color mode. ```tsx import { NoxionThemeProvider } from "@noxion/renderer"; // Wrap your app with NoxionThemeProvider {/* Your app components */} ``` -------------------------------- ### Deploy Noxion Blog with Docker Source: https://github.com/jiwonme/noxion/blob/main/README.md These Docker commands show how to build and run a Noxion blog application. It covers building the Docker image and running it as a container, including how to set environment variables for configuration. ```bash # Build docker build -t noxion ./apps/web # Run docker run -p 3000:3000 \ -e NOTION_PAGE_ID=abc123 \ -e SITE_DOMAIN=myblog.com \ noxion ``` -------------------------------- ### Parse Key-Value Pairs from String Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/reference/core/frontmatter.md Parses a multi-line string containing key: value pairs into a JavaScript object. Lines starting with '#' are ignored as comments. Useful for processing frontmatter content. ```typescript import { parseKeyValuePairs } from "@noxion/core"; const text = ` cleanUrl: /my-post title: My Post # description: (draft) floatFirstTOC: right `; const parsed = parseKeyValuePairs(text); // Example output: { cleanUrl: "/my-post", title: "My Post", floatFirstTOC: "right" } ``` -------------------------------- ### CLI Tool: create-noxion Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/reference/overview.md CLI scaffolding tool for creating Noxion projects. ```APIDOC ## CLI Tool ### `create-noxion` #### Description Command-line interface tool for scaffolding new Noxion projects. #### Method `CLI Command` #### Endpoint N/A (Command-line execution) ``` -------------------------------- ### Usage Example: Adding JSON-LD to a Next.js Page Source: https://github.com/jiwonme/noxion/blob/main/apps/docs/docs/reference/adapter-nextjs/structured-data.md Demonstrates how to use the generated JSON-LD objects within a Next.js page component. It shows how to embed the structured data using a script tag with `dangerouslySetInnerHTML`. ```tsx // app/[slug]/page.tsx const blogPostingLd = generateBlogPostingLD(post, siteConfig); const breadcrumbLd = generateBreadcrumbLD(post, siteConfig); return (