On this page ▾
Installation
Path A · Scaffold a fresh project Recommended
The published create-ngmd package copies a ready AnalogJS project with the NgMd site frame, authoring components and build pipeline. It does not install dependencies or run git init; the next step does the install.
pnpm create ngmd@latest my-docsnpm create ngmd@latest my-docsyarn create ngmd my-docsbun create ngmd my-docscd my-docs
pnpm install
pnpm run dev
Open http://localhost:5173. Done.
apps/my-docs. See Nx Monorepos.
create-ngmd after install. It never appears in your package.json.
After install: first steps
src/ngmd.config.ts. Change brand name, description, public URL, GitHub URL, sidebar nav, and the keywords auto-link map. The page title, description and social tags in index.html read from site, and public/og.png is the social card image.
.md file under src/content/. The path becomes the URL. No wrapper needed.
src/styles.css. Swap one token, the whole site follows.
Path B · Manual integration
For when you already have an AnalogJS app and want to pull NgMd in piece by piece. The scaffolder is what gets tested on every release; the manual path is documented for completeness but goes stale faster.
Prerequisites
pnpm create analog@latest if you don't have one yet.
1. Install content dependencies
The runtime libraries NgMd composes:
pnpm add @analogjs/content marked-shiki shiki@^1.29.2 @angular/elements @lucide/angular @orama/orama ts-morph
pnpm add -D @tailwindcss/typography
2. Enable content in vite.config.ts
Wire Shiki into the AnalogJS content pipeline:
import analog from '@analogjs/platform';
export default defineConfig({
plugins: [
analog({
content: {
highlighter: 'shiki',
shikiOptions: {
highlight: { themes: { light: 'github-light-default', dark: 'github-dark-default' }, defaultColor: false },
},
},
}),
],
});
3. Provide content renderer in src/app/app.config.ts
Standalone renderer plus Shiki highlighter:
import { provideContent, withMarkdownRenderer } from '@analogjs/content';
import { withShikiHighlighter } from '@analogjs/content/shiki-highlighter';
export const appConfig: ApplicationConfig = {
providers: [
provideFileRouter(),
provideContent(withMarkdownRenderer(), withShikiHighlighter()),
],
};
4. Copy the NgMd source
From a scaffolded NgMd project, copy these into yours, along with src/app/services/, src/app/utils/, src/types/ and src/app/register-elements.ts:
plugin-utils.ts. Plus the externalLinkGuard inline in vite.config.ts.
5. Wire the plugins in vite.config.ts
Import and register the NgMd plugins next to the analog plugin: siteHtmlPlugin, varsPlugin, externalLinkGuard, internalLinkGuard, mdLinksPlugin, pageMetaPlugin, sitemapPlugin, rawMdPlugin, searchIndexPlugin, apiGenPlugin. Pass prerender: {routes: async () => prerenderRoutes(import.meta.dirname)} to analog() so the build writes an HTML file for every page and a 404.html. Copy index.html too: its %SITE_NAME%, %SITE_DESCRIPTION% and %SITE_URL% tokens are filled from ngmd.config.ts by siteHtmlPlugin.
6. Deploy
Drop a netlify.toml at the repo root with publish = "dist/analog/public" and a /* to /404.html rule with status 404, so unknown paths show the not-found page. Connect the repo to Netlify, Vercel, or any Node-friendly host. Done.
github.com/erkamyaman/ngmd is the source of truth.