You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Honor openIfExists: true when using Page: From Template command (#1831)
* Improve Page Template option behaviour documentation
* Check pageName == nil or "" when getting page template name from prompt
* Honor `openIfExists: true` when using `Page: From Template` command
Copy file name to clipboardExpand all lines: libraries/Library/Std/Infrastructure/Page Templates.md
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,8 @@ the page.
17
17
Optional keys you can set in the page’s frontmatter:
18
18
19
19
*`suggestedName`: the proposed name for the new page, can use embedded Lua expressions, like `Daily/${date.today()}`.
20
-
*`confirmName`: Confirm the suggested page name before creating it (defaults to `true`).
21
-
*`openIfExists`: If a page with the `suggestedName` already exists, open it rather than attempting to create it anew.
20
+
*`confirmName`: Confirm the suggested page name before creating it (defaults to `true`). Only effects pages created by a key binding, otherwise you will always be prompted to confirm the new page name.
21
+
*`openIfExists`: If a page with the `suggestedName` already exists, open it rather than showing an error.
22
22
*`command`: expose the page template as a command with this name.
23
23
*`key`: Bind the snippet to a keyboard shortcut (note: this requires to _also_ specify the `command` configuration).
24
24
*`mac`: Bind the snippet to a Mac-specific keyboard shortcut.
@@ -79,11 +79,16 @@ This is my quick note version
79
79
```space-lua
80
80
-- priority: 10
81
81
82
-
local function createPageFromTemplate(templatePage, pageName)
82
+
local function createPageFromTemplate(templatePage, pageName, openIfExists)
0 commit comments