Skip to content

feat: Support multiple displayTitle sources with fallback - #509

Open
efirlus wants to merge 1 commit into
scambier:masterfrom
efirlus:feat/display-title-fallback
Open

feat: Support multiple displayTitle sources with fallback#509
efirlus wants to merge 1 commit into
scambier:masterfrom
efirlus:feat/display-title-fallback

Conversation

@efirlus

@efirlus efirlus commented Jan 10, 2026

Copy link
Copy Markdown

Summary

  • Allow users to specify multiple title sources separated by commas (e.g., #heading,title,name)
  • The first non-empty value is used, providing a fallback mechanism
  • Fully backward compatible with existing single-value settings

Related Issue

Closes #468

Changes

  • src/repositories/documents-repository.ts: Implement comma-separated source parsing with fallback logic
  • src/settings/settings-indexing.ts: Update setting description to explain new syntax and add placeholder

Example Usage

Setting Behavior
title Same as before - use frontmatter "title"
#heading Same as before - use first H1 heading
#heading,title Try H1 first, fallback to frontmatter "title"
#heading,title,name Try H1, then "title", then "name"

Tested

  • Build passes without errors
  • Single value settings work as before
  • Multiple sources with fallback work correctly
  • Whitespace around commas is trimmed properly
  • Empty sources are filtered out

Allow users to specify multiple title sources separated by commas.
The first non-empty value will be used.

Example: `#heading,title,name` tries H1 heading first, then
frontmatter "title", then frontmatter "name".

Closes scambier#468

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

[Feature request] Fallback for frontmatter title option

1 participant