Commit df503ed
v1.2.0: {name} filename placeholder + collision numbering
Adds a `{name}` placeholder to the filename pattern that produces a
human-readable filename component: case and spaces preserved, only
filesystem-illegal characters (< > : " / \ | ? *) and control chars are
stripped, plus a few characters that confuse Obsidian's wiki-link parser
(# ^ [ ]). Suitable for vaults that want titled files like
"The Sagebrush Rebellion.md" rather than slug-style names.
When two items would produce the same filename — for example two
articles titled "The Sagebrush Rebellion" from different sources, both
rendered with `{name}` — the second and later get OS-style suffixes:
"The Sagebrush Rebellion (2).md", "The Sagebrush Rebellion (3).md", etc.
The check is case-insensitive (matches typical Windows/macOS filesystem
behavior) and looks at both files already on disk and filenames used
earlier in the same export batch.
Default filename pattern is unchanged. The new behavior is fully opt-in
by writing a pattern that uses {name}. Idempotency continues to work via
the frontmatter-embedded tropy_hash, so any pattern still re-runs safely.
Refactored applyFilenamePattern: filename variables are now pre-formatted
to their natural display form (slugified or sanitized as appropriate) and
the pattern substitution is a pure 1:1 replacement.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6626ced commit df503ed
3 files changed
Lines changed: 85 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
| 125 | + | |
| 126 | + | |
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
159 | 180 | | |
160 | 181 | | |
161 | 182 | | |
| |||
182 | 203 | | |
183 | 204 | | |
184 | 205 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
188 | 211 | | |
189 | 212 | | |
190 | | - | |
| 213 | + | |
191 | 214 | | |
192 | 215 | | |
193 | 216 | | |
194 | | - | |
| 217 | + | |
195 | 218 | | |
196 | 219 | | |
197 | 220 | | |
198 | 221 | | |
199 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
200 | 228 | | |
201 | 229 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
207 | 236 | | |
208 | 237 | | |
209 | 238 | | |
| |||
545 | 574 | | |
546 | 575 | | |
547 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
548 | 591 | | |
549 | 592 | | |
550 | 593 | | |
| |||
636 | 679 | | |
637 | 680 | | |
638 | 681 | | |
| 682 | + | |
639 | 683 | | |
640 | 684 | | |
641 | 685 | | |
| |||
658 | 702 | | |
659 | 703 | | |
660 | 704 | | |
661 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
662 | 721 | | |
663 | 722 | | |
664 | 723 | | |
| |||
698 | 757 | | |
699 | 758 | | |
700 | 759 | | |
| 760 | + | |
701 | 761 | | |
702 | 762 | | |
703 | 763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
0 commit comments