(name)
| 51 | |
| 52 | /** Convert a PascalCase/camelCase name to a URL-friendly slug. */ |
| 53 | export function toSlug(name) { |
| 54 | return name |
| 55 | .replace(/([a-z])([A-Z])/g, '$1-$2') |
| 56 | .replace(/[_\s]+/g, '-') |
| 57 | .toLowerCase(); |
| 58 | } |
| 59 | |
| 60 | /** Strip leading YAML frontmatter (--- ... ---) from markdown content. */ |
| 61 | export function stripFrontmatter(content) { |