| name | analogjs-development |
| description | Develop with Analogjs 2.x file-based routing, markdown content management, and SSR/SSG configuration. Use when creating *.page.ts files, contentFilesResource, routeMeta, and prerender settings. |
Analogjs Development
Development guide for Analogjs 2.x framework with file-based routing and content management.
When to Use This Skill
- Creating new pages (*.page.ts)
- Setting up dynamic routes ([param].page.ts)
- Loading and displaying markdown content
- Configuring SSR/SSG (prerender)
- Creating API routes (server/routes/)
When NOT to use:
- Creating non-page Angular components →
angular-v21-development
- Styling only →
tailwindcss-v4-styling
- UI/UX design application →
material-design-3-expressive
Core Principles
Implementation Guidelines
Page Component
Key patterns for page components:
- File must end with
.page.ts suffix
- Component must be default exported
- Can have accompanying
.page.html and .page.css files
→ Details: Routing Patterns
Dynamic Routes
Dynamic route patterns:
- Use bracket syntax for parameter:
[slug].page.ts
- Access parameter via
injectContent() or ActivatedRoute
- Prefer
withComponentInputBinding() for route params as inputs
→ Details: Routing Patterns
Content Management
Markdown content handling patterns:
- Use
injectContentFiles<T>() for content list
- Use
injectContent<T>() for single content by route param
- Define
PostAttributes interface for content metadata
- Configure
provideContent() with markdown renderer
→ Details: Content Handling
Route Metadata
Route-level configuration patterns:
- Export
routeMeta for route configuration
- Set page title, meta tags, guards
- Configure SSR/SSG options per route
→ Details: Routing Patterns
SSR/SSG Configuration
Server-side rendering and static generation patterns:
- Configure
prerender.routes in vite.config.ts
- Use
contentDir with transform for dynamic content routes
- Set up
provideServerContext() in main.server.ts
→ Details: Content Handling
API Routes
Server API route patterns:
- Create files in
src/server/routes/
- Use
defineEventHandler() from h3
- File path becomes API endpoint
→ Details: Routing Patterns
Workflow
- Route Planning: Determine route type (static/dynamic/group)
- Create Page File: Create
*.page.ts with correct naming
- Template Setup: Create template/style files if needed
- Content Connection: Set up markdown content loading if applicable
- Route Metadata: Configure
routeMeta export
- Prerender Setup: Add route to prerender configuration for SSG
Related Skills
- angular-v21-development: For component internal implementation
- tailwindcss-v4-styling: For page styling
- material-design-3-expressive: For UI component application
Reference Documentation
For detailed patterns and code examples, see: