Working with Markdown
Scully uses markdown files to generate static content pages. This guide covers everything you need to know about working with markdown in Scully.Markdown Basics
File Structure
Every markdown file has two parts:- Frontmatter (YAML metadata at the top)
- Content (Markdown body)
Frontmatter
Frontmatter is YAML metadata between--- delimiters. Scully uses this data for routing and metadata.
Required Properties
Optional Properties
Add any custom properties you need:Accessing Frontmatter Data
All frontmatter properties are available in your Angular components:ScullyRoute Interface
TheScullyRoute interface includes all frontmatter plus Scully properties:
Markdown Syntax
Headers
Text Formatting
Links
Images
Lists
Code Blocks
With syntax highlighting:Blockquotes
Tables
Horizontal Rules
Syntax Highlighting
Configuration
Supported Languages
Prism.js supports many languages. Common ones include:typescript,javascript,jsx,tsxhtml,css,scss,lessbash,shell,powershelljson,yaml,xmlmarkdown,sql,graphqlpython,java,c,cpp,csharpdocker,nginx,git
Usage in Markdown
Specify the language after the opening backticks:Custom Language Support
If a language isn’t available, Scully will warn you:Markdown Plugin Configuration
The markdown plugin uses marked.js with these settings:File Organization
Recommended Structure
Date-Prefixed Files
Prefix files with dates for chronological ordering:Custom Slugs
Override the default filename-based slug:/blog/angular-scully-guide instead of /blog/how-to-use-angular-with-scully.
Draft Posts
Unpublished Posts
Setpublished: false to create a draft:
Publishing
To publish:- Set
published: true - Remove
slugsarray - Rebuild:
npx scully
Filtering Unpublished Posts
Filter out drafts in your listing:Advanced Techniques
Table of Contents
Generate TOC from headers:Reading Time
Calculate estimated reading time:Custom Frontmatter Validation
Validate required frontmatter fields:Troubleshooting
Frontmatter not parsing
Frontmatter not parsing
Problem: Frontmatter data not available in componentSolutions:
- Ensure frontmatter is valid YAML
- Check for proper
---delimiters - Rebuild with
npx scully - Verify no extra spaces or tabs
- Check for special characters (escape if needed)
Syntax highlighting not working
Syntax highlighting not working
Problem: Code blocks not highlightedSolutions:
- Enable:
setPluginConfig('md', { enableSyntaxHighlighting: true }) - Import language:
import 'prismjs/components/prism-<language>' - Import theme in
styles.css - Use proper code fence syntax with language
- Clear browser cache
Markdown not rendering as HTML
Markdown not rendering as HTML
Problem: Raw markdown visible on pageSolutions:
- Ensure
<scully-content>in template - Import
ScullyLibModulein component module - Run
npx scullyto generate pages - Check route is configured in
scully.config.ts - Verify markdown files are in correct folder
Images not loading
Images not loading
Problem: Images broken in markdownSolutions:
- Use absolute paths from
assets:/assets/images/pic.jpg - Or relative to markdown file:
./images/pic.jpg - Ensure images are in Angular assets folder
- Check
angular.jsonincludes images in assets - Verify image paths are correct after build
Best Practices
- Use meaningful frontmatter with consistent structure
- Add descriptions and metadata for SEO
- Keep markdown files organized in logical folders
- Use date prefixes for chronological content
- Include
publishedflag for draft management - Add custom metadata (author, date, tags) consistently
- Enable syntax highlighting for code examples
- Test with unpublished slugs before publishing
- Use semantic heading hierarchy (h1 → h2 → h3)
- Optimize images before adding to content
Next Steps
Create a Blog
Set up a complete blog with markdown
Configuration
Configure Scully for your needs
Plugins
Extend Scully with plugins
Deployment
Deploy your static site

