Projects
Writings
Notes
Log
Glossary
Contact

YAML Field Notes - Scalars, Anchors, and Structures

April 13, 2026

Practical patterns for writing expressive and reusable YAML

Scalars

Folded Scalar

yaml
name: Folded Scalar. Replaces
with a space
command: >
put commands here, that may
go off screen.

Multiline/Block Scalar

yaml
name: Multiline Scalar. Use where
is signifact.
command: |
command one -a arg_1
command two -a arg_1

Anchors & Aliases

Anchors and aliases in YAML provide a convenient way to reuse data and avoid duplication within a YAML document. They are particularly useful for defining default configurations and inheriting values across multiple sections of the document.

yaml
defaults: &defaults
username: guest
password: guest
 
admin:
<<: *defaults
password: secret

Lists and Hashmaps

Inline List + Inline Map

yaml
colors: [red, green, blue]
person: {name: John Doe, age: 30}

Matrix/Matrices

Aka. a list of lists

yaml
matrix:
- [1, 2, 3]
- [4, 5, 6]
- [7, 8, 9]
Dart
Java
Python
Pytest
LaTeX
JavaScript
Jest
TypeScript
React
Gatsby
HTML
Markdown
CSS
Sass
Bootstrap
Tailwind CSS
Django
Flask
Flutter
SQLite

© 2025–2026 manjana/blue-hexagon

Connect with me on GitHub or LinkedIn

PostgreSQL
Nginx
Postman
Terraform
Vim
Git
Github
Heroku
Docker
GitHub Actions
Linux
DigitalOcean
JetBrains
PyCharm
Bash
VMWare
Cisco
Ansible
Paloalto