Skip to content

Common Patterns

Different Prefix Formats

Three-Digit Prefixes

pattern: '^\d{3}--'  # Matches: 001--file.md, 010--file.md

Underscore Separator

pattern: '^\d+_'     # Matches: 01_file.md, 10_file.md

Dot Notation

pattern: '^\d+\.'    # Matches: 1.file.md, 10.file.md

Complex Patterns

pattern: '^[0-9]{2,4}-'  # Matches: 01-file.md, 0001-file.md

Migration Strategy

When migrating existing docs:

  1. Add prefixes gradually:

    mv introduction.md 010--introduction.md
    mv installation.md 020--installation.md
    

  2. Enable link rewriting:

    strip_links: true  # Automatically updates internal links
    

  3. Test with strict mode:

    strict: true  # Catches any URL collisions
    

Troubleshooting

URL Collisions

If you get collision errors:

Error: URL collision detected
- 010--setup.md -> setup/
- 020--setup.md -> setup/  # Collision!

Solution: Use unique names after the prefix.

Previous: Real-World Usage | Next: Best Practices