This is a live demo page for the features described in Sample: Shortcode Reference.
Tabs (Tabs / Tab Components)
You can create tabbed content by combining <Tabs> and <Tab label="...">.
Markdown is fully supported inside tabs (including tables, code blocks, and shortcodes).
snsn-codex is a personal Wiki built on top of the Astro static site generator.
Main Features:
- Generate pages just by writing Markdown / MDX
- Link between pages with WikiLinks
- Visualize knowledge connections with Graph View
- Full-text search powered by Pagefind
npm install
npm run dev # Dev server (http://localhost:4321)
npm run build # Production build + Pagefind index generationIt works just by placing Markdown files in src/content/wiki/.
You can change the color scheme by modifying CSS variables in src/styles/theme.css.
:root {
--color-accent: #e11d48; /* Change to rose color */
}For the monochrome theme, refer to src/styles/theme-mono.css.
theme.css.Footnotes
Footnotes are created by placing <Ref id="..." /> in the text and defining the corresponding annotation with <Fn id="..."> at the end of the page [1] .
Hover over the number for a popup, and click to scroll to the end section [2] .
Page Embedding (Transclusion)
You can embed the content of another Wiki page directly with <Include slug="slug" />.
The following embeds the content of the Getting Started page.
Setup
# After cloning, install dependencies
npm install
# Start development server (http://localhost:4321)
npm run dev
# Build for production (also generates Pagefind search index)
npm run build
# Preview build results
npm run preview
Creating Pages
Just place Markdown files in src/content/wiki/ to create pages.
---
title: "Page Title"
description: "Short description (optional)"
tags: ["tag1", "tag2"]
category: "Category Name"
date: 2024-01-01
updated: 2024-06-01
---
Write your content here. You can use [[WikiLink]] to link to other pages.
Common Frontmatter Fields
| Field | Type | Description |
|---|---|---|
title | string | Page title (required) |
description | string | Short description (optional) |
tags | string[] | Array of tags |
category | string | Category name |
date | date | Creation date |
updated | date | last updated date |
draft | bool | true for draft (private) |
Using WikiLink
[[Page Name]] → Link to page
[[Page Name|Display Text]] → Link with custom text
[[Subfolder/Page Name]] → Link to page in subfolder
Backlinks (list of pages linking to the current page) are automatically displayed at the bottom of the page.
Directory Structure
Content is managed as resources under src/content/wiki/[lang]/.
You can further organize them with subdirectories.
src/content/wiki/
├── ja/ → Japanese (Root)
│ ├── index.mdx → /wiki/ja
│ ├──入门.mdx → /wiki/ja/getting-started
│ └── recipes/
│ └── pasta.mdx → /wiki/ja/recipes/pasta
└── en/ → English
└── index.mdx → /wiki/en
Files in src/content/wiki/templates/ are treated as templates and will not be published as normal pages.
Internationalization (i18n)
See Sample: Internationalization (i18n) for details. Automatic fallback feature ensures that the Japanese version is displayed if a translation is missing.
Customizing Sidebar
Edit src/data/sidebar-nav.ts to change the sidebar configuration.
// Manual links
{
title: 'Guide',
icon: 'fa-solid fa-book',
items: [
{ slug: 'getting-started', label: 'Getting Started' },
{ slug: 'shortcode-reference', label: 'Shortcodes' },
],
},
// Auto-collect category
{
title: 'Recipes',
icon: 'fa-solid fa-utensils',
category: 'Recipes',
autoSort: 'title',
},
Publishing to GitHub Pages
- Create a GitHub repository and push your code.
- Select
GitHub Actionsin Settings → Pages → Source. - If using a subpath (
/repo-name), set the following in Settings → Variables:SITE_URL:https://username.github.ioBASE_PATH:/repo-name
- Push to the
mainbranch to trigger auto-deployment.
BASE_PATH is not needed if you use a custom domain or username.github.io at the root.
Next: Sample: Shortcode Reference →
Navbox (Navigation Box)
Define a navigation box in src/data/navboxes.ts and call it by its id.
<Navbox id="example-navbox" />
Related Pages
- Sample: Basic Features — Basic features like WikiLink and Callouts
- Sample: Shortcode Reference — List of all shortcodes
- Sample: Datatable Demo — Datatable component