dependabot[bot] on npm_and_yarn
Bump json5 from 1.0.1 to 1.0.2 … (compare)
nebrelbug on npm_and_yarn
nebrelbug on master
Bump qs from 6.5.2 to 6.5.3 Bu… Merge pull request #249 from sq… (compare)
nebrelbug on npm_and_yarn
nebrelbug on master
Bump tmpl from 1.0.4 to 1.0.5 … Merge pull request #234 from sq… (compare)
nebrelbug on npm_and_yarn
nebrelbug on master
Bump i from 0.3.6 to 0.3.7 Bum… Merge pull request #235 from sq… (compare)
dependabot[bot] on npm_and_yarn
Bump qs from 6.5.2 to 6.5.3 Bu… (compare)
{{@includeFile("path-to-template") /}}
, and Squirrelly will automatically find and load the partial. Example: {{@includeFile('partials/head.sqrl') /}}
got a general question. my typings for typescript are screaming at me for the below
filters.define('add', (str:string, val: string) => {
return (parseFloat(str) + parseFloat(val)).toString()
})
This works and is documented at https://squirrelly.js.org/docs/api/filter-api via the replace filter
Argument of type '(str: string, val: string) => string' is not assignable to parameter of type 'FilterFunction'.ts(2345)
Is there a bad typing out there (v8 squirrelly)
filters.define('add', (val1: number, val2: number) => {
return val1 + val2 // JS will automatically convert to a string when we output it into the template
})
And then write a template like:{{ it.num | add(72) }}
I've been updating Eta, Squirrelly's companion project, and just added support for Deno. I'm planning to merge those changes into Squirrelly (along with some file handling improvements) soon.
However, for Deno support, we have to generate a deno_dist
folder in the GitHub repo. I'm not sure whether it would confuse users to have a deno_dist
folder and not a dist
folder, and we would still have to commit every time.
deno_dist
folder on every commit (removing the need to commit locally and build every PR manually).
@jmclean-cnexus that would be great!
Right now I use https://github.com/sindresorhus/np to publish, but I'm not sure what the best way to generate the dist
folder before publishing is. Maybe a package.json script like "release": "npm run build && np"
?
Hi all
I'm struggling to use the @each
template helper. When rendering the template, Squirrelly throws me following error:
Squirrelly Error: invalid syntax at line 17 col 48:
{[@each(it.door_icons) => image_path, index]}<div>{[image_path]}</div>{[/each]}
Here's my original piece of code:
{[@each(it.door_icons) => image_path, index]}<div>{[image_path]}</div>{[/each]}
As you can see I customized my opening {[
and closing ]}
tags since I'm using Squirrelly in a Twig context. It works well for the @if
template helper, some custom filters and helpers. What am I doing wrong?
=>
characters in the @each
statement.
My guess is that Twig is XML-escaping the template? I'm not sure exactly how you're using Twig, but hopefully there's some way to disable XML-escaping on the template and check if it solves your problem.
Hope this helps :smiley:
Hmm... the best way might be to put your template in a script tag.
<script id="template" type="text/x-squirrelly-template">
Your template here
</script>
Since the script type is unrecognized, calling innerHTML
should give you the raw inner content :). Handlebars and others recommend using the <script>
tag as well.
Let me know if this helps!
defaultFilter
(defaultFilter
is still called before all other filters, which is slightly inconsistent)
nl2br
, join
, first
, etc.) into Squirrelly.
@/all Hey everyone! Just wanted to share that Squirrelly is looking for a new lead maintainer: see squirrellyjs/squirrelly#210. As of October 28th, I will be unable to continue developing the project.
My plan is to have Squirrelly's API stabilized and well-tested by that time. We should also have fairly decent documentation, several plugins, and integrations with popular tools and server frameworks.
In case I'm unable to find a maintainer, I have backup plans to ensure that Squirrelly can continue to be developed (see the link above for more info).
Several of you on this chat have been influential in guiding Squirrelly's progress -- message me if you would like to become a maintainer! (In the link above, I listed a few maintainer requirements you should check first)