mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
Implemented a shorttitle substitution for templates, when creating notes in subdirs the shorttitle only uses that last part of the filename, not the entire path
This commit is contained in:
@@ -613,6 +613,11 @@ local function linesubst(line, title, dates, uuid)
|
||||
uuid = ""
|
||||
end
|
||||
|
||||
shorttitle = string.match(title, '^.+/(.+)$')
|
||||
if shorttitle == nil then
|
||||
shorttitle = title
|
||||
end
|
||||
|
||||
local substs = {
|
||||
hdate = dates.hdate,
|
||||
week = dates.week,
|
||||
@@ -637,6 +642,7 @@ local function linesubst(line, title, dates, uuid)
|
||||
saturday = dates.saturday,
|
||||
|
||||
title = title,
|
||||
shorttitle = shorttitle,
|
||||
uuid = uuid,
|
||||
}
|
||||
for k, v in pairs(substs) do
|
||||
|
||||
Reference in New Issue
Block a user