Create a Blog with Scully
Scully makes it incredibly easy to add a blog to your Angular application. This guide walks you through the entire process from setup to publishing your first post.Prerequisites
- Angular application set up and running
- Scully installed (
ng add @scullyio/init) - Node.js and npm installed
Adding Blog Support
Generate Blog Module
Run the Scully blog schematic to set up everything automatically:This command will:
- Create a blog module with routing
- Set up the blog component
- Create a
./blogfolder for markdown files - Update your Scully configuration
- Generate a sample blog post
Custom Folder Name (Optional)
If you want to use a different folder name or customize settings:You’ll be prompted for:Or use flags to skip prompts:Available Options:
| Option | Description | Default |
|---|---|---|
name | Module name | 'blog' |
slug | URL parameter name | 'id' |
routingScope | Root or Child routing | Child |
sourceDir | Folder for markdown files | Value from name |
route | Route path before :slug | Value from name |
Creating Blog Posts
Generate a New Post
Use the Post Schematic
Create a new blog post with the Angular CLI:You’ll be prompted for the target folder:
Edit the Generated File
Open The frontmatter contains:
blog/my-first-post.md:title: Post titledescription: Post descriptionpublished: Whether post is live (true/false)
Post Options
The@scullyio/init:post schematic supports these options:
| Option | Description | Default |
|---|---|---|
name | Post title/filename | 'blog-X' |
target | Target directory | 'blog' |
metaDataFile | YAML template for frontmatter | undefined |
Building and Previewing
Run Scully
Generate static pages:Scully will:
- Discover your routes
- Process markdown files
- Generate static HTML
- Create unpublished slugs for draft posts
Publishing Posts
Custom URL Slugs
Override the default filename-based slug:/blog/awesome-angular-tutorial
Displaying Blog Posts
List All Posts
Use Scully’sScullyRoutesService to display blog posts:
src/app/home/home.component.ts
src/app/home/home.component.html
Blog Post Component
The generated blog component displays the markdown content:src/app/blog/blog.component.ts
src/app/blog/blog.component.html
Advanced Features
Syntax Highlighting
Enable code syntax highlighting:scully.config.ts
src/styles.css
Custom Metadata
Add any metadata to your frontmatter:Post Renderers
Add custom processing for blog posts:scully.config.ts
Troubleshooting
Blog route not found
Blog route not found
Problem:
/blog/:slug route returns 404Solutions:- Run
npx scully --scanRoutesto discover routes - Check blog module is imported in app routing
- Verify markdown files exist in configured folder
- Check file frontmatter is valid YAML
Markdown not rendering
Markdown not rendering
Problem: Blog post shows raw markdownSolutions:
- Ensure
<scully-content>tag is in blog component template - Import
ScullyLibModulein blog module - Run
npx scullyto generate static pages - Check browser console for errors
Unpublished posts showing
Unpublished posts showing
Problem: Draft posts appear in productionSolutions:
- Filter posts by
publishedproperty:.filter(route => route.published !== false) - Set
published: falsein frontmatter - Check deployment doesn’t include
___UNPUBLISHED___routes
Code highlighting not working
Code highlighting not working
Problem: Code blocks have no syntax highlightingSolutions:
- Enable highlighting:
setPluginConfig('md', { enableSyntaxHighlighting: true }) - Import Prism.js theme in
styles.css - Import language components:
import 'prismjs/components/prism-typescript' - Verify code blocks use proper markdown syntax with language
Next Steps
Working with Markdown
Learn advanced markdown features and frontmatter
Configuration
Customize your Scully configuration
Deployment
Deploy your blog to production
Testing
Test your blog locally before deployment

