I’ve written a little lua function to extract the page name from a file. I’m using it to create meeting notes. Now I’m facing the problem that it broke while switching from version 2.2.1 to 2.3.0 and I’ve got no clue why. Maybe someone can help?
Function:
function meetingName(input)
if not input then
return input
end
local pos = input:find("_")
if not pos then
return input
end
local nameWithoutPrefix = input:sub(pos + 1)
return nameWithoutPrefix:gsub("[_%-%+]", " ")
end
Call from template:
${meetingName(editor.getCurrentPageMeta().name)}
I’ve been using it to convert “Meetings/2025_12_05_next_steps” to “next steps”.
The find/sub combo ist working for me. It simply cuts after the date so I can use it as a clean header in created file.
Edit:
Just seen I’ve promoted the wrong example. My input name is something like ‘Meetings/2025-12-06_title’ which will be converted to ‘title’. Everything before the first underscore will be thrown away.
The first part is set by a template