Skip to content

feat(collections): add per-collection slugify option for path indexing#400

Open
klokie wants to merge 1 commit intotobi:mainfrom
klokie:feat/slugify-option
Open

feat(collections): add per-collection slugify option for path indexing#400
klokie wants to merge 1 commit intotobi:mainfrom
klokie:feat/slugify-option

Conversation

@klokie
Copy link

@klokie klokie commented Mar 13, 2026

Summary

  • Adds a slugify option to the Collection interface (default: true for backward compatibility)
  • When slugify: false, filenames are stored as-is during indexing, preserving spaces, uppercase, and special characters
  • Fixes path resolution for files like BASS PLAYER Lesson 02.md which were previously slugified to bass-player-lesson-02.md

Motivation

QMD normalizes filenames to kebab-case during indexing via handelize(). This breaks path resolution for downstream tools (e.g. qmd-search-obsidian) when files have spaces or uppercase characters in their names. Making it configurable preserves backward compatibility while letting users opt in to original-path preservation.

Usage

# ~/.config/qmd/index.yml
collections:
  notes:
    path: /Users/me/Documents/notes
    pattern: "**/*.md"
    slugify: false   # preserve original filenames

Test plan

  • New test: default behavior (slugify: true) still handleizes paths to kebab-case
  • New test: slugify: false preserves original filenames with spaces and uppercase
  • New test: search results return original filenames when slugify: false
  • All existing tests pass (450 tests across 7 test files)
  • Manual test: index a collection with slugify: false containing files with spaces, verify qmd search --json returns correct paths

Made with Cursor

Add `slugify` option to collection config (default: true) that controls
whether filenames are converted to kebab-case during indexing. Setting
`slugify: false` preserves original filenames with spaces and uppercase
characters, fixing path resolution for tools like qmd-search-obsidian.

Made-with: Cursor
@klokie klokie force-pushed the feat/slugify-option branch from e882f6b to 3fbb30a Compare March 14, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant