silverbullet icon indicating copy to clipboard operation
silverbullet copied to clipboard

Index scripts and styles in templates

Open onespaceman opened this issue 11 months ago • 2 comments

Index space-scripts and space-styles in templates, and removes them when rendering

onespaceman avatar Mar 23 '24 02:03 onespaceman

Right, I had something like this for a bit, but then reverted it. The reason is that I don't know what the desired behavior is. Does it make sense to remove space scripts from rendered templates? What one could expect to work is creating e.g. a page template that actually generates a space script based on template variables. I don't immediately see use cases for this yet, but I'd expect that to work. What do you think?

zefhemel avatar Mar 23 '24 18:03 zefhemel

I was trying to make an widget, which needed a custom function to process the text to a table. It made sense to include the script in the template file instead of separately. For the styles, it's for the future when we can add css classes to blocks. Makes sense to include it along with the widget it styles. Put all these together and it's a mini plug system.

onespaceman avatar Mar 23 '24 18:03 onespaceman