EDITING CONTENT
MASTER YAML EDITING
Learn how to locate, open, and edit existing content files using text editors and CLI workflows.
FINDING CONTENT
Locate files to edit
List All Content:
BASH
# List all content files
./fyt content list
# List specific type
./fyt content list --type=page
./fyt content list --type=blogFind by URL:
| URL | File Path |
|---|---|
| `/about` | `content/pages/about.yaml` |
| `/docs/guides/print-optimization` | `content/pages/docs/guides/print-optimization.yaml` |
| `/blog/welcome` | `content/blog/2025-01-15-welcome.yaml` |
Search Content:
BASH
# Find files containing text
grep -r "search term" content/
# Find by filename
find content/ -name "*pricing*"TEXT EDITOR WORKFLOWS
Vi, Vim, Nano, VSCode
Vi/Vim:
BASH
# Open file
vi content/pages/about.yaml
# Basic commands
i # Enter insert mode
ESC # Exit insert mode
:w # Save
:q # Quit
:wq # Save and quit
:q! # Quit without saving
# Navigation
h j k l # Left, down, up, right
gg # Go to top
G # Go to bottom
/search # Search forwardNano:
BASH
# Open file
nano content/pages/about.yaml
# Commands (shown at bottom)
^O # Save (Ctrl+O)
^X # Exit (Ctrl+X)
^K # Cut line
^U # Paste
^W # SearchVSCode:
BASH
# Open file
code content/pages/about.yaml
# Or open entire project
code .YAML EDITING TIPS
Avoid common mistakes
Indentation Rules:
- Use 2 spaces (not tabs)
- Consistent indentation throughout
- Nested structures indent by 2 spaces each level
YAML
sections:
- id: "section-1" # 2 spaces
title: "Title" # 4 spaces
content: | # 4 spaces
Markdown content # 6 spaces (inside multiline)
variant: "brutal" # 4 spacesMultiline Content:
Use pipe
| for markdown content:YAML
content: |
## Heading
Paragraph text here.
- List item 1
- List item 2Common Mistakes:
☐
Mixing tabs and spaces
☐
Inconsistent indentation
☐
Missing colons after keys
☐
Unquoted strings with special characters
☐
Missing pipe for multiline content
MARKDOWN IN YAML
Supported markdown features
Headings:
MARKDOWN
# H1 Heading
**H2 Heading:**
**H3 Heading:**Lists:
MARKDOWN
- Unordered item
- Another item
1. Ordered item
2. Another itemChecklists:
MARKDOWN
- [ ] Unchecked item
- [x] Checked itemTables:
MARKDOWN
| Header 1 | Header 2 |
|----------|----------|
| Cell 1 | Cell 2 |Code Blocks:
`MARKDOWN
const example = "code here";
TEXT
Inline Formatting:
MARKDOWN
**Bold text**
*Italic text*
`Inline code`EDITING WORKFLOW
Best practices
Standard Workflow:
BASH
# 1. Find the file
./fyt content list
# 2. Open in editor
vi content/pages/about.yaml
# 3. Make changes
# (edit in vi)
# 4. Save and exit
:wq
# 5. Validate
./fyt validate
# 6. Preview
npm run devQuick Edits:
BASH
# Edit and validate in one go
vi content/pages/about.yaml && ./fyt validateBackup Before Editing:
BASH
# Create backup
cp content/pages/about.yaml content/pages/about.yaml.bak
# Edit
vi content/pages/about.yaml
# Restore if needed
mv content/pages/about.yaml.bak content/pages/about.yamlNEXT STEPS
Learn More:
- Styling & Variants - Style your content
- Content Validation - Validate changes
- Creating Content - Create new content
- CLI Reference - Complete CLI documentation