diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-01 17:39:53 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-01 17:39:53 +0200 |
| commit | 6136b8a79a7f0ce5e35dc07cd88965953bd0e1af (patch) | |
| tree | a916024f725f8de6e79d85cabfaecfb723ac65b7 /lib/notes.source.sh | |
| parent | 309c63c420c425a55ee2a91dd03c77138305a05d (diff) | |
Extract generate::extract_title helper to eliminate duplication
Title extraction ($SED pattern + quote sanitization) was duplicated
in generate, atomfeed, gemfeed, notes, and template modules. Now
centralized with unit tests for heading extraction and empty files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'lib/notes.source.sh')
| -rw-r--r-- | lib/notes.source.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/notes.source.sh b/lib/notes.source.sh index dc62caf..64625b4 100644 --- a/lib/notes.source.sh +++ b/lib/notes.source.sh @@ -27,8 +27,7 @@ NOTES while read -r gmi_file; do # Extract first heading as post title. - local title=$($SED -n '/^# / { s/# //; p; q; }' \ - "$notes_dir/$gmi_file" | tr '"' "'") + local title=$(generate::extract_title "$notes_dir/$gmi_file") echo "=> ./$gmi_file $title" >> "$notes_dir/index.gmi.tmp" done < <(notes::_get_notes) |
