I have this template frontmatter:
tags: template
description: 'Page creation.'
hooks.newPage:
suggestedName: "{{today}} {{userInput}}"
confirmName: true
command: "Page create"
frontmatter: |
date: "{{today}}"
and this added to my space scripts:
silverbullet.registerFunction({name: 'userInput'}, (string) => {
out = editor.prompt("Enter input:", "Name");
return out;
})
My idea was to have the placeholder userInput
which would ask the user for a string which could be used in the suggestedName. It partially works. The problem is that I get the prompt twice.
Am I doing something wrong, is this a bug, or doesn’t this work (intentionally) at all?
Thanks for any help!