post
Thepost schematic (also available as add-post) creates a new markdown file for blog posts or other content with frontmatter metadata.
Usage
Basic Usage
Short Form
Using Alias
Interactive Mode
If you don’t provide the name option, you’ll be prompted:Options
--name (required)
- Type:
string - Default:
"blog-X" - Description: The title of the blog post
- Prompt: “What title do you want to use for the post?”
blog/getting-started-with-scully.md
--target
- Type:
string - Default:
"blog" - Description: The target directory where the post file will be created
- Prompt: “What’s the target folder for this post?”
articles/my-post.md
--extension
- Type:
string - Default:
"md" - Description: The file extension for the post file
blog/my-post.mdx
Supported extensions:
md- Standard Markdownmdx- MDX (Markdown with JSX)- Any alphanumeric extension
--metaDataFile
- Type:
string - Default:
""(empty) - Description: Path to a YAML or JSON file with metadata template to include in the post frontmatter
What Gets Created
The post schematic creates a single markdown file with YAML frontmatter.Default Post Structure
File:blog/[dasherized-title].md
For example, running:
blog/my-first-post.md
Content:
Frontmatter Fields
The default frontmatter includes:title- The post title (from--nameoption)description- Default placeholder descriptionpublished- Boolean flag set tofalseby default
published: true, so remember to update this before building.
Using Custom Metadata Template
Create a template file with additional metadata: File:templates/post-meta.yml
blog/advanced-routing.md
title field from --name will override any title in the metadata file.
Filename Generation
The schematic generates filenames by:- Dasherizing the post name (converting to kebab-case)
- Removing invalid characters
- Adding the specified extension
| Name | Target | Extension | Filename |
|---|---|---|---|
| ”My First Post” | blog | md | blog/my-first-post.md |
| ”Getting Started!“ | articles | md | articles/getting-started.md |
| ”Angular & Scully” | blog | mdx | blog/angular-scully.mdx |
| ”Post #1” | tutorials | md | tutorials/post-1.md |
Validation
File Extension Validation
The schematic validates that the extension contains only alphanumeric characters:Duplicate Post Check
If a file with the same name already exists, the schematic will throw an error:Examples
Simple Blog Post
Post in Custom Folder
MDX Post with Custom Metadata
Multiple Posts
Create multiple posts quickly:Writing Your Post
After creating a post, edit the markdown file:-
Update the frontmatter:
-
Write your content:
-
Build and preview:
Frontmatter Best Practices
Required Fields
While Scully is flexible, consider these essential fields:Optional Fields
Extend your posts with additional metadata:Accessing Metadata in Components
Access post metadata in your Angular components:Target Directory Structure
The target directory must exist or be configured in your Scully config: Scully config:See Also
- blog schematic - Create a complete blog setup
- ng-add schematic - Initial Scully installation
- Content Folder Plugin - Learn about markdown processing

