blog
Theblog schematic (also available as add-blog) creates a complete blog setup in your Angular application with routing, components, and markdown support.
Usage
Basic Usage
Short Form
Using Alias
With Options
Options
--routingScope
- Type:
string - Default:
"Child" - Options:
"Child","Root" - Description: Determines whether to create a child routing module or add routes to the root module
--project
- Type:
string - Default:
"defaultProject" - Description: Specifies the project to add the blog to in a multi-project workspace
What Gets Created/Modified
The blog schematic internally calls thecreate-markdown schematic with blog-specific configuration. Here’s what gets created:
1. Blog Module
File:src/app/blog/blog.module.ts
Creates a dedicated Angular module for the blog:
2. Blog Component
Files:src/app/blog/blog.component.tssrc/app/blog/blog.component.htmlsrc/app/blog/blog.component.csssrc/app/blog/blog.component.spec.ts
3. Blog Routing Module
File:src/app/blog/blog-routing.module.ts
Configures routing for blog posts with a dynamic slug parameter:
4. App Routing Updates
File:src/app/app-routing.module.ts
Adds blog route to the main routing configuration:
5. Sample Markdown File
File:blog/[date]-blog.md (e.g., blog/2020-09-17-blog.md)
Creates a sample blog post:
6. Scully Configuration Updates
File:scully.config.ts (or scully.[project].config.ts)
Adds content folder configuration:
Configuration Details
The blog schematic automatically configures:- Module name:
blog - Route parameter:
slug - Content folder:
./blog - Route path:
/blog
create-markdown schematic internally:
Examples
Default Blog Setup
/blog/:slug.
Blog with Root Routing
Multi-Project Workspace
Output Example
When you run the schematic, you’ll see output similar to:Customizing the Blog Folder
After running the schematic, you can customize the blog folder location by editing the Scully configuration:Next Steps
After creating your blog:-
Create new posts:
-
Build your application:
-
Run Scully:
-
Serve the static site:
See Also
- post schematic - Create individual blog posts
- ng-add schematic - Initial Scully installation
- Content Folder Plugin - Learn more about the contentFolder type

