mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
feat: add filename_small_case (#344)
Add an option to cast the new filename to lowercase. Closes #311.
This commit is contained in:
@@ -73,6 +73,8 @@ local function defaultConfig(home)
|
||||
uuid_sep = "-",
|
||||
-- if not nil, replaces any spaces in the title when it is used in filename generation
|
||||
filename_space_subst = nil,
|
||||
-- if true, make the filename lowercase
|
||||
filename_small_case = false,
|
||||
-- following a link to a non-existing note will create it
|
||||
follow_creates_nonexisting = true,
|
||||
dailies_create_nonexisting = true,
|
||||
@@ -180,6 +182,10 @@ local function generate_note_filename(uuid, title)
|
||||
title = title:gsub(" ", M.Cfg.filename_space_subst)
|
||||
end
|
||||
|
||||
if M.cfg.filename_small_case then
|
||||
title = string.lower(title)
|
||||
end
|
||||
|
||||
local pp = Path:new(title)
|
||||
local p_splits = pp:_split()
|
||||
local filename = p_splits[#p_splits]
|
||||
|
||||
Reference in New Issue
Block a user