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
// if there's a file extension... it's a file// (alternatively, if it has dots or slashes... it's a path or URL)
@loadOnce('path/to/js.js')
@loadOnce('path/to/css.css')
// if it doesn't have an extension... it's a block
@loadOnce('unique_name_for_code_block')
<script>
<!-- YourJS here -->
</script>
<!-- OR -->
<style>
<!-- YourCSS here -->
</style>
@endLoadOnce
The text was updated successfully, but these errors were encountered:
I think we should not rely on dots or slashes, because a path may be just @loadOnce('main.js'), we should rely on the name ending with .js or .css, and expect users to not use ids that look like a file name.
Maybe we could also check if file exists, but it's more "expensive" probably and in a situation where the file mistakenly doesn't exist it would be, wrongly, expect an ending block – so it's not a good idea.
Pedro said - what if we only have:
The text was updated successfully, but these errors were encountered: