I have a virtual index page, rendering my projects.list():
event.listen {
name = "editor:pageCreating",
run = function(e)
if e.data.name != "index" then
return
end
return {
text = [[---
pageDecoration.disableTOC: true
---
]] .. projects.list() .. "\nThis page is rendered by [[^Templates/VirtualPages]]",
perm = "ro"
}
end
}
This only works, understandably, if index.md doesn’t exist. But it appears that sometimes the contents of this page does get saved as an index.md file. I’m not sure that a literal file on the server gets saved (my git auto-commit is every 10 minutes, and I have deleted this page every time), but I notice because the page is no longer read-only and it becomes a snapshot of my projects instead of updating dynamically.
…I get the feeling that I’m holding it wrong, too. This hack is a combination of:
This is likely a bug. It’s possible that due to various load orders there are scenarios where SB will trigger a save. It shouldn’t, but it sounds like it sometimes does. If you have a reproducible scenario that’d be helpful as a Github issue.
Perhaps this can help to narrow the issue too. I ran into this, for example, that when I delete a page, navigate elswhere quickly and then go back to the page, the page already exist as empty. I have this on my home page:
${widgets.commandButton("Quick Note")}
In the template there is some front-matter, # title and initial - with cursor placed after it. Nothing else and the page is created in a path like this: Inbox/Wednesday/2025/June/18.
Now, I click the button, edit some content for a while, then delete the page I am editing, click home top-bar button and click the “Quick Note” button again. And the page is there, but empty, without frontmatter and the title and the list item. Weird. It happens from time to time only…