mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-14 20:00:39 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13343040c6 | ||
|
|
ca3240c2c4 | ||
|
|
2b0c5696bc | ||
|
|
dab8a29070 | ||
|
|
f395295721 | ||
|
|
200f6648aa | ||
|
|
31aa4ec318 | ||
|
|
231574903f | ||
|
|
dbc0497386 | ||
|
|
ab5e245fba | ||
|
|
78ce5662df | ||
|
|
8b880f65a2 | ||
|
|
d605158f96 | ||
|
|
1a44b908ce | ||
|
|
a0817e5dd7 | ||
|
|
703675e1e0 | ||
|
|
819d060a92 | ||
|
|
c3d7ecbde1 | ||
|
|
8bdb70878f | ||
|
|
2e1537d50c | ||
|
|
d4afbc038f | ||
|
|
58d03890b4 | ||
|
|
e3fb47a90b | ||
|
|
e4ad93ee8c | ||
|
|
0bdf6792d1 | ||
|
|
7e99efc513 | ||
|
|
527858fc14 | ||
|
|
9da41c8a37 | ||
|
|
2717dae127 | ||
|
|
8db6c7b28d | ||
|
|
298db97b84 | ||
|
|
bd8e2b0f96 | ||
|
|
117eaf57c3 | ||
|
|
1e69d86b0c | ||
|
|
cc6b66216d | ||
|
|
ca82416dea | ||
|
|
394d5a1ae2 | ||
|
|
371da3da74 | ||
|
|
7814285479 | ||
|
|
53824a2d00 | ||
|
|
9966d846b5 | ||
|
|
8c27a84059 | ||
|
|
388d0fbbc4 | ||
|
|
d71d0a0c20 | ||
|
|
191a0130d2 | ||
|
|
2c3ebaca0c | ||
|
|
7677f848c0 | ||
|
|
c7d2e1f1f4 | ||
|
|
c756191f49 | ||
|
|
e94e386c46 | ||
|
|
b7c782b10a | ||
|
|
49d3f64873 | ||
|
|
be3463c5f9 | ||
|
|
fde9924ee6 | ||
|
|
5b2ea63b14 | ||
|
|
23279a816a | ||
|
|
2c14a9541d | ||
|
|
c474649748 | ||
|
|
fad17cfbb3 | ||
|
|
6322acb88c | ||
|
|
95fc705b5d | ||
|
|
6801552fe6 | ||
|
|
6023d9ba10 | ||
|
|
cc4628d804 | ||
|
|
69286c6909 | ||
|
|
6c114267a5 | ||
|
|
e2ef236f68 | ||
|
|
80c2280ee6 | ||
|
|
44f6b520d5 | ||
|
|
3d71d9e35a | ||
|
|
124f4c4485 | ||
|
|
432d1c7ccb | ||
|
|
4b42e63601 | ||
|
|
f809c716eb | ||
|
|
aebeae9e1b | ||
|
|
564972ba74 | ||
|
|
d0c3cc8b47 | ||
|
|
b5b2a98d5e | ||
|
|
8894cbfe6e | ||
|
|
c58a116513 | ||
|
|
d4df3a0b53 | ||
|
|
9cfa43b8ae | ||
|
|
df6d62fd59 | ||
|
|
2438f4b018 | ||
|
|
8321a8e982 | ||
|
|
1de6adf308 | ||
|
|
a525f45b46 | ||
|
|
529e6d769b | ||
|
|
822ba0be0f | ||
|
|
a3455ebd0b | ||
|
|
24a19c092a | ||
|
|
fd5ef474c3 | ||
|
|
4f6b88c154 | ||
|
|
6dc7fada72 | ||
|
|
3b9c7d6fbe | ||
|
|
92bfc65e0b | ||
|
|
8348036d45 | ||
|
|
afeef1d745 | ||
|
|
3b5eb6664f | ||
|
|
68c4cfcfb6 | ||
|
|
dd325362f9 | ||
|
|
b9ae479b65 | ||
|
|
0cb520d2d1 | ||
|
|
1689576913 | ||
|
|
aea34418de | ||
|
|
4358c9630f | ||
|
|
9a96b4aba3 | ||
|
|
70fdb7af48 | ||
|
|
5099597634 | ||
|
|
d742de79ba | ||
|
|
f0e2e07f0b | ||
|
|
4e5dbe120d | ||
|
|
6a1db537d2 | ||
|
|
9517f82caf | ||
|
|
10e8c8ff7e | ||
|
|
fb787e8847 | ||
|
|
9012133e07 | ||
|
|
abaf4af465 | ||
|
|
8273c17dab | ||
|
|
24f5346084 | ||
|
|
6b9f872bcc | ||
|
|
91c721e650 | ||
|
|
500d397a5a | ||
|
|
2e004eddf6 | ||
|
|
e3bfe86181 | ||
|
|
804947ebb9 | ||
|
|
4fa5313acc | ||
|
|
f7313fe563 | ||
|
|
1c64ff051e | ||
|
|
c470d1fe9b | ||
|
|
cdceb25d00 | ||
|
|
cc9b28307c | ||
|
|
f2ddd6e459 | ||
|
|
ecc40a6012 | ||
|
|
659cfde8e1 | ||
|
|
0acfb8de4d | ||
|
|
c4b2bfb29b | ||
|
|
0d41f7467e | ||
|
|
1d35e3fcfb | ||
|
|
04c874b174 | ||
|
|
29f42847a5 | ||
|
|
426863a9b4 | ||
|
|
8f9639f1d6 | ||
|
|
3e130e01a7 | ||
|
|
3e3d84a5ed | ||
|
|
69f1a394b1 | ||
|
|
ae8636d95d | ||
|
|
1fd76acf28 | ||
|
|
62f8f707e9 | ||
|
|
9c7cb5752b | ||
|
|
4e394b9072 | ||
|
|
251a50801c | ||
|
|
aa5d63fdf7 | ||
|
|
65487654c4 | ||
|
|
8bab7957da | ||
|
|
666df5a8e6 | ||
|
|
a4aa9ba0d6 | ||
|
|
f5f54c82bf | ||
|
|
28f154554b | ||
|
|
2bc03d6a01 | ||
|
|
354a971b9e | ||
|
|
b41be92dfd | ||
|
|
bad12ea936 | ||
|
|
b5a22fa091 | ||
|
|
7d92f25cbb | ||
|
|
4584867b65 | ||
|
|
695e3c18bc | ||
|
|
2133ed20d7 | ||
|
|
dbc23e8b04 | ||
|
|
1acace5a16 | ||
|
|
9a9b792c63 | ||
|
|
99d14e76d7 | ||
|
|
aff9976042 | ||
|
|
cd8cb39329 | ||
|
|
9ed3b98db3 | ||
|
|
151ff4cbf3 | ||
|
|
2e66e8b02e | ||
|
|
24306722ec | ||
|
|
2f059f6a25 | ||
|
|
4e82da689e | ||
|
|
e37824fd8a | ||
|
|
81e11bb9c4 | ||
|
|
71d5d24813 | ||
|
|
20f559e545 | ||
|
|
dce75a1a22 | ||
|
|
93ec151374 | ||
|
|
29db1bb0e2 | ||
|
|
f42c217fc0 | ||
|
|
ec4a711e00 | ||
|
|
03893d585e | ||
|
|
3b97c38ee5 | ||
|
|
48a876db49 | ||
|
|
befc33c4eb | ||
|
|
8734e2e6ce | ||
|
|
18055c8855 | ||
|
|
6a7c280f04 | ||
|
|
bc87e19e3e | ||
|
|
75591cdbfc | ||
|
|
5901611af5 | ||
|
|
9c40da7369 | ||
|
|
5e7598ce45 | ||
|
|
42591a04d8 | ||
|
|
a3af44dc10 | ||
|
|
0e0dc2adf0 | ||
|
|
7b909c22a1 | ||
|
|
626f911503 | ||
|
|
de32259bb9 | ||
|
|
d70cd2a1ea | ||
|
|
26b217542b | ||
|
|
e3ecfe3adc | ||
|
|
c16c787861 | ||
|
|
13f5f95d01 | ||
|
|
c8db5e6259 | ||
|
|
9e511ecd14 | ||
|
|
45d95bb8d8 | ||
|
|
8d3eca6ee2 | ||
|
|
6a0ad102a8 | ||
|
|
b8e4b3337b | ||
|
|
cd92e77726 | ||
|
|
e84fbf32ad | ||
|
|
0266b27838 | ||
|
|
090c88eb92 | ||
|
|
e15803fae4 | ||
|
|
117673a725 | ||
|
|
ef43120d6e | ||
|
|
f9f595f0f4 | ||
|
|
2bbf50171b | ||
|
|
a492d8e23d | ||
|
|
c8afa39a01 | ||
|
|
d8f9091a12 | ||
|
|
ca18a579a1 | ||
|
|
6f2b24f7ca | ||
|
|
87d7dd0d37 | ||
|
|
768fb79e32 | ||
|
|
c920ebb282 | ||
|
|
9706e8b411 | ||
|
|
75698eefec | ||
|
|
dfd358c0a2 | ||
|
|
4c70946fa1 | ||
|
|
9d9c0c1ca7 | ||
|
|
a9d3a5a402 | ||
|
|
30dffb675e | ||
|
|
e67c3c6924 | ||
|
|
e2e410f334 | ||
|
|
27ce44238e | ||
|
|
abfaf8a042 | ||
|
|
18a807ea2e | ||
|
|
a6126c3bea | ||
|
|
a96d772963 | ||
|
|
732ef2605e | ||
|
|
72ee7b4c1e | ||
|
|
f807383f2a | ||
|
|
02bfed1c57 | ||
|
|
b11df79b91 | ||
|
|
8ee9bd7ba8 | ||
|
|
5b3f4195f0 | ||
|
|
236d971705 | ||
|
|
0cd4d87d46 | ||
|
|
1fdfd4a68a | ||
|
|
c1f73a9f03 | ||
|
|
d8f550e447 | ||
|
|
2e5ab98bfc | ||
|
|
0dbb7792d7 | ||
|
|
e10ce657dd | ||
|
|
3713fa08b2 | ||
|
|
c5002d8cad | ||
|
|
00b0a5708c | ||
|
|
f82ee8a18c | ||
|
|
632bb6b077 | ||
|
|
0b6ee9bca1 | ||
|
|
941dd668fe | ||
|
|
11ffd65503 | ||
|
|
ce0280ca9f | ||
|
|
1066ef0f76 | ||
|
|
7b38c28d52 | ||
|
|
97e7983bd8 | ||
|
|
6cf6ffae90 | ||
|
|
04873a4e9c | ||
|
|
1a08efd402 | ||
|
|
e36f3ff291 | ||
|
|
f3f017bd37 | ||
|
|
0d20a344b6 | ||
|
|
3acbdfc1b7 | ||
|
|
ed994bdbd5 | ||
|
|
27a4c7666b | ||
|
|
064ea99f49 | ||
|
|
71fb8a8b7c | ||
|
|
acdd121a61 | ||
|
|
2de853e814 | ||
|
|
4f17c94988 | ||
|
|
d39f65c564 | ||
|
|
673b015435 | ||
|
|
2fa4edaa84 | ||
|
|
83b46bd25d | ||
|
|
4e34e78176 | ||
|
|
3873ba0783 | ||
|
|
4799a98bf9 | ||
|
|
0953680112 | ||
|
|
f6789f517c | ||
|
|
5099b2a762 | ||
|
|
a93f11d25a | ||
|
|
3cf8072df5 | ||
|
|
bf609b443b | ||
|
|
c923598b40 | ||
|
|
d65ed408f0 | ||
|
|
e750c35f8c | ||
|
|
8daf281fca | ||
|
|
c30766ffe1 | ||
|
|
bf23116ce5 | ||
|
|
983bcf467a | ||
|
|
9ebf11edcf | ||
|
|
8d0ef21267 | ||
|
|
687d3ad12a | ||
|
|
b3db412428 | ||
|
|
3e42d6b1b0 | ||
|
|
0633dbeabb | ||
|
|
c371762c43 | ||
|
|
94d67d254d | ||
|
|
02e6171e25 | ||
|
|
479c63350a | ||
|
|
60c14ba057 | ||
|
|
c95b5bd718 | ||
|
|
4cb713dbf6 | ||
|
|
e97db63249 | ||
|
|
93433a8b30 | ||
|
|
6bf242b9fa | ||
|
|
c36801640d | ||
|
|
14b04688b5 | ||
|
|
1673e84e27 | ||
|
|
d2d6a38235 | ||
|
|
3b58f1c3f6 | ||
|
|
dd339dab05 | ||
|
|
f7ef9b61c1 | ||
|
|
3dfdf982c9 | ||
|
|
0f25017d5d | ||
|
|
8f05784a0c | ||
|
|
76f69db752 | ||
|
|
3aa47f6c85 | ||
|
|
6de933897e | ||
|
|
06ad0481db | ||
|
|
2c428221cb | ||
|
|
73dd48861d | ||
|
|
76087b8ec2 | ||
|
|
4826f48f1c | ||
|
|
f57156bccd | ||
|
|
61dac49b04 | ||
|
|
65b849c02a | ||
|
|
607a5cda3f | ||
|
|
6ea6881f08 | ||
|
|
aa27a6cd7b | ||
|
|
152778b6e3 | ||
|
|
3bf926b434 | ||
|
|
df8a919f71 | ||
|
|
f6762078e0 | ||
|
|
185312dbff | ||
|
|
5cd42f4500 | ||
|
|
40095a8e71 | ||
|
|
14527a2545 | ||
|
|
22386b0212 | ||
|
|
66541a62fd | ||
|
|
870e7ec6aa | ||
|
|
fc0cf6fe7b | ||
|
|
46b69db87a | ||
|
|
9733199dc3 | ||
|
|
1e6e9fe1a9 | ||
|
|
807e840712 | ||
|
|
a9afc9730c | ||
|
|
5f9abdc8c6 | ||
|
|
e24d9ab1b6 | ||
|
|
4b079c54b1 | ||
|
|
b600028607 | ||
|
|
5ec3f95317 | ||
|
|
ba5ff3f41c | ||
|
|
c69ad538d4 | ||
|
|
a373e50990 | ||
|
|
90d78ae6d5 | ||
|
|
60ec74f55d | ||
|
|
6502984b50 | ||
|
|
f82da11f5a | ||
|
|
ef289039fb | ||
|
|
04df9294b5 | ||
|
|
79892f6b72 | ||
|
|
19f3e23b27 | ||
|
|
993ea20b80 | ||
|
|
08cbb12228 | ||
|
|
9504e4e45b | ||
|
|
0b9b50c5d7 | ||
|
|
0073b90b31 | ||
|
|
081c432334 | ||
|
|
390cd23f5f | ||
|
|
2dd43559b5 | ||
|
|
5492fb0b17 | ||
|
|
1ecff1c341 | ||
|
|
d5e7b047bb | ||
|
|
b82fa9ed2b | ||
|
|
d4ad4b8a8c | ||
|
|
ab8db5394b | ||
|
|
b02a227a81 | ||
|
|
41a33834e7 | ||
|
|
53e7ea51bd | ||
|
|
ef3e520628 | ||
|
|
be755a900c | ||
|
|
3ad512c51c | ||
|
|
7bae5bcb79 | ||
|
|
3a7ddaa2c3 | ||
|
|
362e2d6451 | ||
|
|
6b83788077 | ||
|
|
4f8fc89c6f | ||
|
|
cc8851e56f | ||
|
|
154deeda76 | ||
|
|
d2c8d133ff | ||
|
|
96d98e4ebb | ||
|
|
f661cd8b85 | ||
|
|
493c4951e1 | ||
|
|
d3f3d81e2e | ||
|
|
c2ba1e1f1a | ||
|
|
31bec7e66e | ||
|
|
0b6f86d02a | ||
|
|
28330e1127 | ||
|
|
0426d08fd0 | ||
|
|
7fb01ad69a | ||
|
|
8028f82499 | ||
|
|
76019e9e18 | ||
|
|
538610e169 | ||
|
|
b65df447dc | ||
|
|
3b9fc7e6bf | ||
|
|
f35ab6b72e | ||
|
|
ab3b824cf8 | ||
|
|
ae45c4622e | ||
|
|
854e12ba53 | ||
|
|
ad8e2f7e63 | ||
|
|
e17bc97d8e | ||
|
|
aa15f3dfe1 | ||
|
|
a00945cad7 | ||
|
|
0f4e6d9981 | ||
|
|
db5de49f5e | ||
|
|
d50fd1df35 | ||
|
|
1e4f237022 | ||
|
|
9956c53b09 | ||
|
|
af841dc872 | ||
|
|
0408ae7f53 | ||
|
|
3cf35fd58e | ||
|
|
58f546ff80 | ||
|
|
a85b650ab2 | ||
|
|
d487a2d3ea | ||
|
|
0b543817ff | ||
|
|
0d52d570fc | ||
|
|
c354164352 | ||
|
|
fc045b5bbc | ||
|
|
c8c6dd8275 | ||
|
|
49c45a463b | ||
|
|
cef5d1aa1a | ||
|
|
6e6ea0ae58 | ||
|
|
dc9a6e019e |
@@ -0,0 +1,493 @@
|
||||
{
|
||||
"projectName": "liquidjs",
|
||||
"projectOwner": "harttle",
|
||||
"repoType": "github",
|
||||
"repoHost": "https://github.com",
|
||||
"files": [
|
||||
"README.md"
|
||||
],
|
||||
"imageSize": 100,
|
||||
"commit": false,
|
||||
"commitConvention": "angular",
|
||||
"contributors": [
|
||||
{
|
||||
"login": "harttle",
|
||||
"name": "Jun Yang",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/4427974?v=4",
|
||||
"profile": "https://harttle.land",
|
||||
"contributions": [
|
||||
"maintenance",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "chenos",
|
||||
"name": "chenos",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/2993310?v=4",
|
||||
"profile": "https://github.com/chenos",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "zachleat",
|
||||
"name": "Zach Leatherman",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/39355?v=4",
|
||||
"profile": "https://zachleat.com/",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "thardy",
|
||||
"name": "Tim Hardy",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/120636?v=4",
|
||||
"profile": "https://github.com/thardy",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "paulrobertlloyd",
|
||||
"name": "Paul Robert Lloyd",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/813383?v=4",
|
||||
"profile": "https://paulrobertlloyd.com/",
|
||||
"contributions": [
|
||||
"code",
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "aleclarson",
|
||||
"name": "Alec Larson",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/1925840?v=4",
|
||||
"profile": "https://twitter.com/alecdotbiz",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "pmalouin",
|
||||
"name": "Patrick Malouin",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1411117?v=4",
|
||||
"profile": "https://github.com/pmalouin",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jaswrks",
|
||||
"name": "jaswrks",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/1563559?v=4",
|
||||
"profile": "https://jaswrks.com",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "oott123",
|
||||
"name": "三三",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/905663?v=4",
|
||||
"profile": "https://oott123.com",
|
||||
"contributions": [
|
||||
"code",
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ssendev",
|
||||
"name": "ssendev",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/450793?v=4",
|
||||
"profile": "https://github.com/ssendev",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "wojtask9",
|
||||
"name": "wojtask9",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/6099236?v=4",
|
||||
"profile": "https://github.com/wojtask9",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "thelornenelson",
|
||||
"name": "Andrew Barclay",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/24596583?v=4",
|
||||
"profile": "https://github.com/thelornenelson",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "cmawhorter",
|
||||
"name": "Cory Mawhorter",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/142338?v=4",
|
||||
"profile": "https://www.stam.pr/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "thehappybug",
|
||||
"name": "Mehdi Jaffery",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/3393530?v=4",
|
||||
"profile": "https://github.com/thehappybug",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "robinbijlani",
|
||||
"name": "Robin Bijlani",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/2503108?v=4",
|
||||
"profile": "https://github.com/robinbijlani",
|
||||
"contributions": [
|
||||
"code",
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ryaninvents",
|
||||
"name": "Ryan Kennedy",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/8356669?v=4",
|
||||
"profile": "https://www.rmkennedy.com",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "strax",
|
||||
"name": "Sami Kukkonen",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/587213?v=4",
|
||||
"profile": "https://github.com/strax",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ScottFreeCode",
|
||||
"name": "Scott Santucci",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/16506071?v=4",
|
||||
"profile": "https://ScottFreeCode.github.io/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "stevenanthonyrevo",
|
||||
"name": "Steven ",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/8505293?v=4",
|
||||
"profile": "http://stevenrescigno.com",
|
||||
"contributions": [
|
||||
"example",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "azu",
|
||||
"name": "azu",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/19714?v=4",
|
||||
"profile": "https://efcl.info/",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "wyozi",
|
||||
"name": "Joonas",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/4894573?v=4",
|
||||
"profile": "https://github.com/wyozi",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jamelait",
|
||||
"name": "Jamel A.",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/14369255?v=4",
|
||||
"profile": "https://github.com/jamelait",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "brandonpittman",
|
||||
"name": "Brandon Pittman",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/967145?v=4",
|
||||
"profile": "https://brandonpittman.net",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tgrandgent",
|
||||
"name": "tgrandgent",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/17069042?v=4",
|
||||
"profile": "https://github.com/tgrandgent",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "mastodon0",
|
||||
"name": "Martin Schuster",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/7924332?v=4",
|
||||
"profile": "https://github.com/mastodon0",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "richardo2016",
|
||||
"name": "Ray",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/6339390?v=4",
|
||||
"profile": "http://js.chenlei.me",
|
||||
"contributions": [
|
||||
"test",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "CriGoT",
|
||||
"name": "Cristofer Gonzales",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1936786?v=4",
|
||||
"profile": "https://github.com/CriGoT",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "cfjedimaster",
|
||||
"name": "Raymond Camden",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/393660?v=4",
|
||||
"profile": "https://www.raymondcamden.com",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "stedman",
|
||||
"name": "Steve Stedman",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/183122?v=4",
|
||||
"profile": "https://stedman.dev",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "aciccarello",
|
||||
"name": "Anthony Ciccarello",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/11273838?v=4",
|
||||
"profile": "https://ciccarello.me",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "TrySound",
|
||||
"name": "Bogdan Chadkin",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5635476?v=4",
|
||||
"profile": "https://twitter.com/IAmTrySound",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tejasmanohar",
|
||||
"name": "Tejas Manohar",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5959235?v=4",
|
||||
"profile": "https://hightouch.io",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "pdehaan",
|
||||
"name": "Peter deHaan",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/557895?v=4",
|
||||
"profile": "http://about.me/peterdehaan",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "amit777",
|
||||
"name": "amit777",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/2703309?v=4",
|
||||
"profile": "https://github.com/amit777",
|
||||
"contributions": [
|
||||
"code",
|
||||
"financial"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sschuldenzucker",
|
||||
"name": "Steffen Schuldenzucker",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/1100776?v=4",
|
||||
"profile": "http://www.ifi.uzh.ch/en/ce/people/schuldenzucker.html",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Pixcell",
|
||||
"name": "Pixcell",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/4005291?v=4",
|
||||
"profile": "https://github.com/Pixcell",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "JasonEtco",
|
||||
"name": "Jason Etcovitch",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10660468?v=4",
|
||||
"profile": "https://jasonet.co",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kayuapi",
|
||||
"name": "ZC",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10304328?v=4",
|
||||
"profile": "https://github.com/kayuapi",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "mems",
|
||||
"name": "Memmie Lenglet",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/729275?v=4",
|
||||
"profile": "https://memmie.lenglet.name",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ilhamdev0",
|
||||
"name": "ilhamdev0",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/57636145?v=4",
|
||||
"profile": "https://github.com/ilhamdev0",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "c412216887",
|
||||
"name": "一饮一啄皆是人生",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/29691650?v=4",
|
||||
"profile": "https://github.com/c412216887",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "labnol",
|
||||
"name": "Amit Agarwal",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1344071?v=4",
|
||||
"profile": "https://digitalinspiration.com/",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "n1ru4l",
|
||||
"name": "Laurin Quast",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/14338007?v=4",
|
||||
"profile": "https://n1ru4l.cloud/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "mattvague",
|
||||
"name": "Matt Vague",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/64985?v=4",
|
||||
"profile": "https://github.com/mattvague",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "bglw",
|
||||
"name": "Liam Bigelow",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/40188355?v=4",
|
||||
"profile": "https://github.com/bglw",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "JaKXz",
|
||||
"name": "Jason Kurian",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/2642545?v=4",
|
||||
"profile": "https://about.me/jasonkurian",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "dphm",
|
||||
"name": "d pham (they/them)",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1707217?v=4",
|
||||
"profile": "https://github.com/dphm",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "AleksandrHovhannisyan",
|
||||
"name": "Aleksandr Hovhannisyan",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/19352442?v=4",
|
||||
"profile": "https://www.aleksandrhovhannisyan.com/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jg-rp",
|
||||
"name": "jg-rp",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/72664870?v=4",
|
||||
"profile": "https://github.com/jg-rp",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ameyaapte1",
|
||||
"name": "Ameya Apte",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/16054747?v=4",
|
||||
"profile": "https://github.com/ameyaapte1",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tbdrz",
|
||||
"name": "tbdrz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/50599116?v=4",
|
||||
"profile": "https://github.com/tbdrz",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "santialbo",
|
||||
"name": "Santi Albo",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1557563?v=4",
|
||||
"profile": "http://santialbo.com",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
"skipCi": true
|
||||
}
|
||||
@@ -2,3 +2,4 @@ node_modules
|
||||
dist
|
||||
demo
|
||||
coverage
|
||||
docs
|
||||
|
||||
+10
-1
@@ -18,8 +18,11 @@
|
||||
"prefer-const": 2,
|
||||
"no-unused-vars": "off",
|
||||
"indent": "off",
|
||||
"no-dupe-class-members": "off",
|
||||
"no-useless-constructor": "off",
|
||||
"@typescript-eslint/indent": ["error", 2],
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-object-literal-type-assertion": "off",
|
||||
"@typescript-eslint/no-use-before-define": "off",
|
||||
@@ -27,5 +30,11 @@
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"import/export": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false }]
|
||||
}
|
||||
},
|
||||
"overrides": [{
|
||||
"files": ["**/*.js", "*.js"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
# github: harttle
|
||||
patreon: harttle
|
||||
open_collective: liquidjs
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Check
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
release:
|
||||
name: Check
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
- name: Build
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
- name: Test
|
||||
run: |
|
||||
npm run lint
|
||||
npm run test
|
||||
- name: Coverage
|
||||
uses: coverallsapp/[email protected]
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Performance
|
||||
run: |
|
||||
npm run perf:diff
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
docs:
|
||||
name: Docs
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
- name: Build
|
||||
run: |
|
||||
npm ci
|
||||
npm run build:docs
|
||||
- name: Publish
|
||||
uses: JamesIves/[email protected]
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: docs/public
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Release
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
- name: Build
|
||||
run: |
|
||||
npm ci
|
||||
npm run build:dist
|
||||
- name: Test
|
||||
run: |
|
||||
npm run lint
|
||||
npm run test
|
||||
- name: Coverage
|
||||
uses: coverallsapp/[email protected]
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: npx semantic-release
|
||||
@@ -10,7 +10,10 @@ coverage/
|
||||
# modules
|
||||
node_modules/
|
||||
dist/
|
||||
demo/*/package-lock.json
|
||||
demo/*/yarn.json
|
||||
|
||||
# editors
|
||||
.*.swp
|
||||
.vscode
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
require: "ts-node/register/transpile-only",
|
||||
reporter: "spec"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"exclude": ["dist", "test"],
|
||||
"reporter": ["html", "lcov"]
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "10"
|
||||
- "8"
|
||||
- "6"
|
||||
jobs:
|
||||
include:
|
||||
- stage: test
|
||||
name: 'Linting'
|
||||
script: npm run lint
|
||||
- name: 'Coverage'
|
||||
script: npm run coverage-coveralls
|
||||
- stage: release
|
||||
if: branch = master
|
||||
script: skip
|
||||
deploy:
|
||||
provider: script
|
||||
skip_cleanup: true
|
||||
script: npx semantic-release
|
||||
+686
@@ -1,3 +1,689 @@
|
||||
# [9.35.0](https://github.com/harttle/liquidjs/compare/v9.34.1...v9.35.0) (2022-02-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `url_encode` throws on undefined value, fixes [#479](https://github.com/harttle/liquidjs/issues/479) ([ca3240c](https://github.com/harttle/liquidjs/commit/ca3240c2c4d157095d2ebe0024d0c71bc5e435f8))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* expose all tags/filters and TimezoneDate, closes [#464](https://github.com/harttle/liquidjs/issues/464) ([dab8a29](https://github.com/harttle/liquidjs/commit/dab8a29070b2508f2e6532717b7663966f610bec))
|
||||
|
||||
## [9.34.1](https://github.com/harttle/liquidjs/compare/v9.34.0...v9.34.1) (2022-02-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* array output now join with "" instead of "," ([ab5e245](https://github.com/harttle/liquidjs/commit/ab5e245fba9a0f6936275319d4e5e25aadb0f7c1))
|
||||
* sort filter unexpectedly modifies original array, [#475](https://github.com/harttle/liquidjs/issues/475) ([dbc0497](https://github.com/harttle/liquidjs/commit/dbc049738633b1b6f578d9d20f830b548ba67a22))
|
||||
|
||||
# [9.34.0](https://github.com/harttle/liquidjs/compare/v9.33.1...v9.34.0) (2022-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* where-filter null handling ([#457](https://github.com/harttle/liquidjs/issues/457)) ([9da41c8](https://github.com/harttle/liquidjs/commit/9da41c8a37d9c49ee4a16d5bd520fd6ae01c14ec))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `ownPropertyOnly` option to protect prototype, [#454](https://github.com/harttle/liquidjs/issues/454) ([7e99efc](https://github.com/harttle/liquidjs/commit/7e99efc5131e20cf3f59e1fc2c371a15aa4109db))
|
||||
|
||||
## [9.33.1](https://github.com/harttle/liquidjs/compare/v9.33.0...v9.33.1) (2022-01-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* liquidjs.version on npm package ([53824a2](https://github.com/harttle/liquidjs/commit/53824a2d00f978214fcd83a48118b7900cf97449))
|
||||
|
||||
# [9.33.0](https://github.com/harttle/liquidjs/compare/v9.32.1...v9.33.0) (2022-01-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support `offset:continue`, see [#439](https://github.com/harttle/liquidjs/issues/439) ([8c27a84](https://github.com/harttle/liquidjs/commit/8c27a84059384ae730eb0fa1524df04e122e27a0))
|
||||
* support Jekyll-like include syntax, see [#441](https://github.com/harttle/liquidjs/issues/441) ([388d0fb](https://github.com/harttle/liquidjs/commit/388d0fbbc42fe8cd69faba61c1dc29e9bb5ec2d0))
|
||||
|
||||
## [9.32.1](https://github.com/harttle/liquidjs/compare/v9.32.0...v9.32.1) (2022-01-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove limit on operator char length ([7677f84](https://github.com/harttle/liquidjs/commit/7677f848c0c57335dd1c4f1e3ec251fbf9b1663f))
|
||||
|
||||
# [9.32.0](https://github.com/harttle/liquidjs/compare/v9.31.0...v9.32.0) (2022-01-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support allow_false for `default` filter, see [#435](https://github.com/harttle/liquidjs/issues/435) ([c756191](https://github.com/harttle/liquidjs/commit/c756191f49f9c2b823048367abfdf0adf2bdb875))
|
||||
|
||||
# [9.31.0](https://github.com/harttle/liquidjs/compare/v9.30.0...v9.31.0) (2021-12-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* implement `liquid` and `echo` tags, see [#428](https://github.com/harttle/liquidjs/issues/428) ([fde9924](https://github.com/harttle/liquidjs/commit/fde9924ee622efae4c013d2aa01c6d705c8d5f46))
|
||||
|
||||
# [9.30.0](https://github.com/harttle/liquidjs/compare/v9.29.0...v9.30.0) (2021-12-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support jekyll-like include, see [#433](https://github.com/harttle/liquidjs/issues/433) ([23279a8](https://github.com/harttle/liquidjs/commit/23279a816a0582ade7f3b15c1c65c74bc147d134))
|
||||
|
||||
# [9.29.0](https://github.com/harttle/liquidjs/compare/v9.28.6...v9.29.0) (2021-12-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* customize globals & strictVariables when calling render, see [#432](https://github.com/harttle/liquidjs/issues/432) ([6801552](https://github.com/harttle/liquidjs/commit/6801552fe6829770cbbfdda051731c8b466ed9ec))
|
||||
|
||||
## [9.28.6](https://github.com/harttle/liquidjs/compare/v9.28.5...v9.28.6) (2021-12-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* size filter does not respect Objects, fixes [#385](https://github.com/harttle/liquidjs/issues/385) ([6c11426](https://github.com/harttle/liquidjs/commit/6c114267a526ef764dfd9bd94de199d2932ad91a))
|
||||
* throws when using `preserveTimezones` on Node.js, fixes [#431](https://github.com/harttle/liquidjs/issues/431) ([e2ef236](https://github.com/harttle/liquidjs/commit/e2ef236f68273b72a0b1293b0d13728cdb9aa4b8))
|
||||
|
||||
## [9.28.5](https://github.com/harttle/liquidjs/compare/v9.28.4...v9.28.5) (2021-11-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* always allow './' and '../' to be relative, even on windows ([44f6b52](https://github.com/harttle/liquidjs/commit/44f6b520d53ba984ecb5fc430d70f698837d1802))
|
||||
|
||||
## [9.28.4](https://github.com/harttle/liquidjs/compare/v9.28.3...v9.28.4) (2021-10-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow `{%render%}` to reassign argument, [#404](https://github.com/harttle/liquidjs/issues/404) ([124f4c4](https://github.com/harttle/liquidjs/commit/124f4c4485270a5fdfca610808a56ecd98d98417))
|
||||
|
||||
## [9.28.3](https://github.com/harttle/liquidjs/compare/v9.28.2...v9.28.3) (2021-10-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* relative root (by default) yields LookupError, fixes [#419](https://github.com/harttle/liquidjs/issues/419), [#424](https://github.com/harttle/liquidjs/issues/424), also related to [#395](https://github.com/harttle/liquidjs/issues/395) ([aebeae9](https://github.com/harttle/liquidjs/commit/aebeae9e1bbb8472af7788dfd09a08cb6de58e1c))
|
||||
|
||||
## [9.28.2](https://github.com/harttle/liquidjs/compare/v9.28.1...v9.28.2) (2021-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* cache ongoing parseFile() calls, fixes [#416](https://github.com/harttle/liquidjs/issues/416) ([8894cbf](https://github.com/harttle/liquidjs/commit/8894cbfe6e0dbad4c07439adcefb6b3e2056be11))
|
||||
|
||||
## [9.28.1](https://github.com/harttle/liquidjs/compare/v9.28.0...v9.28.1) (2021-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* hardcoded '/' in normalized `options.fs`, fixes [#412](https://github.com/harttle/liquidjs/issues/412), [#408](https://github.com/harttle/liquidjs/issues/408) ([9cfa43b](https://github.com/harttle/liquidjs/commit/9cfa43b8aee6a980f39d99f1cdb2be730ca21731))
|
||||
|
||||
# [9.28.0](https://github.com/harttle/liquidjs/compare/v9.27.1...v9.28.0) (2021-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* skip root check for renderFile() ([822ba0b](https://github.com/harttle/liquidjs/commit/822ba0be0f1cfbedd50376aff8ac49eee71bd48c))
|
||||
* support timezoneOffset for date from scope, [#401](https://github.com/harttle/liquidjs/issues/401) ([fd5ef47](https://github.com/harttle/liquidjs/commit/fd5ef474c36212e6a2446012dcd26bca93f84c7b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `relativeReference` for render/include/layout, [#395](https://github.com/harttle/liquidjs/issues/395) ([a3455eb](https://github.com/harttle/liquidjs/commit/a3455ebd0b207141c34630c0af44d917db2ca1dd))
|
||||
* implement `forloop.name` as found in ruby shopify/liquid ([6dc7fad](https://github.com/harttle/liquidjs/commit/6dc7fada72467418806c1ee4bd7eaf3003690fe6))
|
||||
|
||||
## [9.27.1](https://github.com/harttle/liquidjs/compare/v9.27.0...v9.27.1) (2021-10-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* directory info in lookupError message, [#395](https://github.com/harttle/liquidjs/issues/395) ([92bfc65](https://github.com/harttle/liquidjs/commit/92bfc65e0b1d937c00a8368b272223c702132d23))
|
||||
|
||||
# [9.27.0](https://github.com/harttle/liquidjs/compare/v9.26.0...v9.27.0) (2021-10-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove "stream" dependency in browser bundles, [#396](https://github.com/harttle/liquidjs/issues/396) ([3b5eb66](https://github.com/harttle/liquidjs/commit/3b5eb6664f673c29d74cb7645e01dcbdf43c8343))
|
||||
* renderToNodeStream() now emit 'error' event instead of throw ([afeef1d](https://github.com/harttle/liquidjs/commit/afeef1d7450b2799b3441b0241d2466b892a27ff))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add `layouts`, `partials` apart from `root`, [#395](https://github.com/harttle/liquidjs/issues/395) ([b9ae479](https://github.com/harttle/liquidjs/commit/b9ae479b653a34fadb98c324c4683dd1fdd31af1))
|
||||
* renderFileToNodeStream(filepath, scope) ([68c4cfc](https://github.com/harttle/liquidjs/commit/68c4cfcfb647c22225dd6edede53ad7a5d7c4485))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* make the most of streamed rendering ([aea3441](https://github.com/harttle/liquidjs/commit/aea34418de24cb85ea1acddf68c3683ce7fc9fa8))
|
||||
|
||||
# [9.26.0](https://github.com/harttle/liquidjs/compare/v9.25.1...v9.26.0) (2021-09-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* orderedFilterParameters, closes [#312](https://github.com/harttle/liquidjs/issues/312) ([10e8c8f](https://github.com/harttle/liquidjs/commit/10e8c8ff7e1cca6df43087953cd8daf4bd618563))
|
||||
* stream rendering, closed [#361](https://github.com/harttle/liquidjs/issues/361) fixes [#360](https://github.com/harttle/liquidjs/issues/360) ([9012133](https://github.com/harttle/liquidjs/commit/9012133e0717b1813c6a74a6a282f43ba14d0ada))
|
||||
* timezoneOffset option to specify output timezone, see [#375](https://github.com/harttle/liquidjs/issues/375) ([6b9f872](https://github.com/harttle/liquidjs/commit/6b9f872bccb4b0c636dc7be2088cafa9bc6c900a))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* improve performance by 4x by simplified parseFile ([24f5346](https://github.com/harttle/liquidjs/commit/24f534608489fccc155f30bbaf37397c46278da6))
|
||||
* parse filenames in parse() insteadof render() ([8273c17](https://github.com/harttle/liquidjs/commit/8273c17dab3dc09858330ce45e3617a650e7fcaa))
|
||||
|
||||
## [9.25.1](https://github.com/harttle/liquidjs/compare/v9.25.0...v9.25.1) (2021-06-20)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* add cross-engines benchmark ([cdceb25](https://github.com/harttle/liquidjs/commit/cdceb25d007b3d30a85e51ac538e12297c73bfcf))
|
||||
|
||||
# [9.25.0](https://github.com/harttle/liquidjs/compare/v9.24.2...v9.25.0) (2021-05-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* when tag with multiple values ([8f9639f](https://github.com/harttle/liquidjs/commit/8f9639f))
|
||||
|
||||
## [9.24.2](https://github.com/harttle/liquidjs/compare/v9.24.1...v9.24.2) (2021-05-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* operator boundary not correctly recognized, fixes [#342](https://github.com/harttle/liquidjs/issues/342) ([3e3d84a](https://github.com/harttle/liquidjs/commit/3e3d84a))
|
||||
|
||||
## [9.24.1](https://github.com/harttle/liquidjs/compare/v9.24.0...v9.24.1) (2021-05-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* make LiquidError context property public ([1fd76ac](https://github.com/harttle/liquidjs/commit/1fd76ac))
|
||||
|
||||
# [9.24.0](https://github.com/harttle/liquidjs/compare/v9.23.4...v9.24.0) (2021-05-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add context as a property on the LiquidError error ([9c7cb57](https://github.com/harttle/liquidjs/commit/9c7cb57))
|
||||
* export errors for better error handling in user-land ([4e394b9](https://github.com/harttle/liquidjs/commit/4e394b9))
|
||||
|
||||
## [9.23.4](https://github.com/harttle/liquidjs/compare/v9.23.3...v9.23.4) (2021-04-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* capitalize filter not lower case trailing string, fixes [#326](https://github.com/harttle/liquidjs/issues/326) ([6548765](https://github.com/harttle/liquidjs/commit/6548765))
|
||||
|
||||
## [9.23.3](https://github.com/harttle/liquidjs/compare/v9.23.2...v9.23.3) (2021-03-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* expose TokenKind ([dbc23e8](https://github.com/harttle/liquidjs/commit/dbc23e8))
|
||||
|
||||
## [9.23.2](https://github.com/harttle/liquidjs/compare/v9.23.1...v9.23.2) (2021-03-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* comparison for empty/nil, fixes [#321](https://github.com/harttle/liquidjs/issues/321) ([99d14e7](https://github.com/harttle/liquidjs/commit/99d14e7))
|
||||
* newline_to_br filter should output <br /> instead of <br/>, fixes [#320](https://github.com/harttle/liquidjs/issues/320) ([9a9b792](https://github.com/harttle/liquidjs/commit/9a9b792))
|
||||
|
||||
## [9.23.1](https://github.com/harttle/liquidjs/compare/v9.23.0...v9.23.1) (2021-02-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* lenientIf not working for the umd bundle, closes [#313](https://github.com/harttle/liquidjs/issues/313) ([2e66e8b](https://github.com/harttle/liquidjs/commit/2e66e8b))
|
||||
|
||||
# [9.23.0](https://github.com/harttle/liquidjs/compare/v9.22.1...v9.23.0) (2021-02-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* respect `fs` in parser options, for [#233](https://github.com/harttle/liquidjs/issues/233) ([4e82da6](https://github.com/harttle/liquidjs/commit/4e82da6))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support filters in if/unless/case, see [#287](https://github.com/harttle/liquidjs/issues/287) ([2f059f6](https://github.com/harttle/liquidjs/commit/2f059f6))
|
||||
* support function calls, closes [#222](https://github.com/harttle/liquidjs/issues/222) ([e37824f](https://github.com/harttle/liquidjs/commit/e37824f))
|
||||
* support layout none, closes [#299](https://github.com/harttle/liquidjs/issues/299) ([81e11bb](https://github.com/harttle/liquidjs/commit/81e11bb))
|
||||
|
||||
## [9.22.1](https://github.com/harttle/liquidjs/compare/v9.22.0...v9.22.1) (2021-02-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* default to precedence 1 for custom operators ([20f559e](https://github.com/harttle/liquidjs/commit/20f559e))
|
||||
|
||||
# [9.22.0](https://github.com/harttle/liquidjs/compare/v9.21.0...v9.22.0) (2021-02-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* compact filter ([f42c217](https://github.com/harttle/liquidjs/commit/f42c217))
|
||||
|
||||
# [9.21.0](https://github.com/harttle/liquidjs/compare/v9.20.1...v9.21.0) (2021-02-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add `operators` option for custom operators ([75591cd](https://github.com/harttle/liquidjs/commit/75591cd))
|
||||
* create trie programmatically in options ([befc33c](https://github.com/harttle/liquidjs/commit/befc33c))
|
||||
* export OperatorMap type ([bc87e19](https://github.com/harttle/liquidjs/commit/bc87e19))
|
||||
* export Operators from operator.ts ([6a7c280](https://github.com/harttle/liquidjs/commit/6a7c280))
|
||||
* rename to defaultOperators and Operators ([8734e2e](https://github.com/harttle/liquidjs/commit/8734e2e))
|
||||
|
||||
## [9.20.1](https://github.com/harttle/liquidjs/compare/v9.20.0...v9.20.1) (2021-01-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow string literals contain delimiters, fixes [#288](https://github.com/harttle/liquidjs/issues/288) ([9c40da7](https://github.com/harttle/liquidjs/commit/9c40da7))
|
||||
|
||||
# [9.20.0](https://github.com/harttle/liquidjs/compare/v9.19.0...v9.20.0) (2021-01-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support `{{block.super}}`, see [#38](https://github.com/harttle/liquidjs/issues/38) ([a3af44d](https://github.com/harttle/liquidjs/commit/a3af44d))
|
||||
|
||||
# [9.19.0](https://github.com/harttle/liquidjs/compare/v9.18.0...v9.19.0) (2020-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* lint ([de32259](https://github.com/harttle/liquidjs/commit/de32259))
|
||||
* move offset adding complexity inside TimezoneDate ([26b2175](https://github.com/harttle/liquidjs/commit/26b2175))
|
||||
* simpler timezone regex and non-null offset ([e3ecfe3](https://github.com/harttle/liquidjs/commit/e3ecfe3))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add preserveTimezones option ([d70cd2a](https://github.com/harttle/liquidjs/commit/d70cd2a))
|
||||
* parse and handle date timezone offsets ([c16c787](https://github.com/harttle/liquidjs/commit/c16c787))
|
||||
|
||||
# [9.18.0](https://github.com/harttle/liquidjs/compare/v9.17.0...v9.18.0) (2020-12-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address refactor comments ([6a0ad10](https://github.com/harttle/liquidjs/commit/6a0ad10))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add option for keeping variable type in output ([cd92e77](https://github.com/harttle/liquidjs/commit/cd92e77))
|
||||
|
||||
# [9.17.0](https://github.com/harttle/liquidjs/compare/v9.16.1...v9.17.0) (2020-12-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* elsif is not supported for unless, fixes [#268](https://github.com/harttle/liquidjs/issues/268) ([2bbf501](https://github.com/harttle/liquidjs/commit/2bbf501))
|
||||
* enforce string-type pattern in `replace`, fixes [#243](https://github.com/harttle/liquidjs/issues/243) ([c8afa39](https://github.com/harttle/liquidjs/commit/c8afa39))
|
||||
* raw block not ignoring {% characters, fixes [#263](https://github.com/harttle/liquidjs/issues/263) ([a492d8e](https://github.com/harttle/liquidjs/commit/a492d8e))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* passing liquid to FilterImpl, closes [#277](https://github.com/harttle/liquidjs/issues/277) ([f9f595f](https://github.com/harttle/liquidjs/commit/f9f595f))
|
||||
|
||||
## [9.16.1](https://github.com/harttle/liquidjs/compare/v9.16.0...v9.16.1) (2020-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* braced property access ([18a807e](https://github.com/harttle/liquidjs/commit/18a807e))
|
||||
|
||||
# [9.16.0](https://github.com/harttle/liquidjs/compare/v9.15.1...v9.16.0) (2020-10-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support jsTruthy, [#255](https://github.com/harttle/liquidjs/issues/255) [#257](https://github.com/harttle/liquidjs/issues/257) ([72ee7b4](https://github.com/harttle/liquidjs/commit/72ee7b4))
|
||||
|
||||
## [9.15.1](https://github.com/harttle/liquidjs/compare/v9.15.0...v9.15.1) (2020-10-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow quoted variable name in capture, fixes [#252](https://github.com/harttle/liquidjs/issues/252) ([5b3f419](https://github.com/harttle/liquidjs/commit/5b3f419))
|
||||
|
||||
# [9.15.0](https://github.com/harttle/liquidjs/compare/v9.14.1...v9.15.0) (2020-08-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* export toPromise and toValue, see [#158](https://github.com/harttle/liquidjs/issues/158) ([2e5ab98](https://github.com/harttle/liquidjs/commit/2e5ab98))
|
||||
|
||||
## [9.14.1](https://github.com/harttle/liquidjs/compare/v9.14.0...v9.14.1) (2020-07-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* enumerate Promises (e.g. in for & tablerow) ([#237](https://github.com/harttle/liquidjs/issues/237)) ([941dd66](https://github.com/harttle/liquidjs/commit/941dd66))
|
||||
|
||||
# [9.14.0](https://github.com/harttle/liquidjs/compare/v9.13.0...v9.14.0) (2020-06-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* setup universal browser and node builds ([6cf6ffa](https://github.com/harttle/liquidjs/commit/6cf6ffa))
|
||||
|
||||
# [9.13.0](https://github.com/harttle/liquidjs/compare/v9.12.0...v9.13.0) (2020-06-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* async filters, closes [#232](https://github.com/harttle/liquidjs/issues/232) ([e36f3ff](https://github.com/harttle/liquidjs/commit/e36f3ff))
|
||||
|
||||
# [9.12.0](https://github.com/harttle/liquidjs/compare/v9.11.11...v9.12.0) (2020-05-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* sort by key, see [#227](https://github.com/harttle/liquidjs/issues/227) ([4f17c94](https://github.com/harttle/liquidjs/commit/4f17c94))
|
||||
|
||||
## [9.11.11](https://github.com/harttle/liquidjs/compare/v9.11.10...v9.11.11) (2020-05-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* properly treat unicode blanks, fixes [#221](https://github.com/harttle/liquidjs/issues/221) ([673b015](https://github.com/harttle/liquidjs/commit/673b015))
|
||||
|
||||
## [9.11.10](https://github.com/harttle/liquidjs/compare/v9.11.9...v9.11.10) (2020-04-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* respect cache render options ([a93f11d](https://github.com/harttle/liquidjs/commit/a93f11d))
|
||||
|
||||
## [9.11.9](https://github.com/harttle/liquidjs/compare/v9.11.8...v9.11.9) (2020-03-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* coerce to Array in `map` and `where` filter ([c923598](https://github.com/harttle/liquidjs/commit/c923598))
|
||||
|
||||
## [9.11.8](https://github.com/harttle/liquidjs/compare/v9.11.7...v9.11.8) (2020-03-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* throw an error if : omitted unintentionally, [#212](https://github.com/harttle/liquidjs/issues/212), [#208](https://github.com/harttle/liquidjs/issues/208) ([8daf281](https://github.com/harttle/liquidjs/commit/8daf281))
|
||||
|
||||
## [9.11.7](https://github.com/harttle/liquidjs/compare/v9.11.6...v9.11.7) (2020-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* try fix travis ([b3db412](https://github.com/harttle/liquidjs/commit/b3db412))
|
||||
|
||||
## [9.11.6](https://github.com/harttle/liquidjs/compare/v9.11.5...v9.11.6) (2020-03-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* default filter not applied for empty array ([c371762](https://github.com/harttle/liquidjs/commit/c371762))
|
||||
|
||||
## [9.11.5](https://github.com/harttle/liquidjs/compare/v9.11.4...v9.11.5) (2020-03-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* throws on invalid arguments for prepend/append, fixes [#208](https://github.com/harttle/liquidjs/issues/208) ([479c633](https://github.com/harttle/liquidjs/commit/479c633))
|
||||
|
||||
## [9.11.4](https://github.com/harttle/liquidjs/compare/v9.11.3...v9.11.4) (2020-03-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* return variable name in include error ([93433a8](https://github.com/harttle/liquidjs/commit/93433a8))
|
||||
|
||||
## [9.11.3](https://github.com/harttle/liquidjs/compare/v9.11.2...v9.11.3) (2020-03-14)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* introduce AST to avoid reparse ([d2d6a38](https://github.com/harttle/liquidjs/commit/d2d6a38))
|
||||
* remove instanceof DelimitedToken ([1673e84](https://github.com/harttle/liquidjs/commit/1673e84))
|
||||
|
||||
## [9.11.2](https://github.com/harttle/liquidjs/compare/v9.11.1...v9.11.2) (2020-03-14)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* remove transient strings to reduce memory ([3dfdf98](https://github.com/harttle/liquidjs/commit/3dfdf98))
|
||||
|
||||
## [9.11.1](https://github.com/harttle/liquidjs/compare/v9.11.0...v9.11.1) (2020-03-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* concurrent write on LRU cache ([#200](https://github.com/harttle/liquidjs/issues/200)) ([6de9338](https://github.com/harttle/liquidjs/commit/6de9338))
|
||||
|
||||
# [9.11.0](https://github.com/harttle/liquidjs/compare/v9.10.0...v9.11.0) (2020-03-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `Buffer not defined` for browser bundles, fixes [#197](https://github.com/harttle/liquidjs/issues/197) ([65b849c](https://github.com/harttle/liquidjs/commit/65b849c))
|
||||
* stable sort for undefined keys, fixes [#191](https://github.com/harttle/liquidjs/issues/191) ([f57156b](https://github.com/harttle/liquidjs/commit/f57156b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* async cache.read()/write(), remove .has() ([61dac49](https://github.com/harttle/liquidjs/commit/61dac49))
|
||||
|
||||
# [9.10.0](https://github.com/harttle/liquidjs/compare/v9.9.0...v9.10.0) (2020-03-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support json filter, closes [#192](https://github.com/harttle/liquidjs/issues/192) ([aa27a6c](https://github.com/harttle/liquidjs/commit/aa27a6c))
|
||||
* with & for in `render` tag, closes [#195](https://github.com/harttle/liquidjs/issues/195) ([6ea6881](https://github.com/harttle/liquidjs/commit/6ea6881))
|
||||
|
||||
# [9.9.0](https://github.com/harttle/liquidjs/compare/v9.8.0...v9.9.0) (2020-03-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* move filters/tags to instances, fixes [#188](https://github.com/harttle/liquidjs/issues/188) ([df8a919](https://github.com/harttle/liquidjs/commit/df8a919))
|
||||
|
||||
# [9.8.0](https://github.com/harttle/liquidjs/compare/v9.7.2...v9.8.0) (2020-02-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* "today" when using date filter, fixes [#193](https://github.com/harttle/liquidjs/issues/193) ([185312d](https://github.com/harttle/liquidjs/commit/185312d))
|
||||
|
||||
## [9.7.2](https://github.com/harttle/liquidjs/compare/v9.7.1...v9.7.2) (2020-02-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add funding entry to show up in npm fund command ([40095a8](https://github.com/harttle/liquidjs/commit/40095a8))
|
||||
|
||||
## [9.7.1](https://github.com/harttle/liquidjs/compare/v9.7.0...v9.7.1) (2020-02-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update index.html ([22386b0](https://github.com/harttle/liquidjs/commit/22386b0))
|
||||
|
||||
# [9.7.0](https://github.com/harttle/liquidjs/compare/v9.6.2...v9.7.0) (2020-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* expression and string literal parser, [#186](https://github.com/harttle/liquidjs/issues/186) ([fc0cf6f](https://github.com/harttle/liquidjs/commit/fc0cf6f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* globals shared between tags, see [#185](https://github.com/harttle/liquidjs/issues/185) ([870e7ec](https://github.com/harttle/liquidjs/commit/870e7ec))
|
||||
|
||||
## [9.6.2](https://github.com/harttle/liquidjs/compare/v9.6.1...v9.6.2) (2020-01-10)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* prevent multiple case evaluations ([807e840](https://github.com/harttle/liquidjs/commit/807e840))
|
||||
|
||||
## [9.6.1](https://github.com/harttle/liquidjs/compare/v9.6.0...v9.6.1) (2020-01-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add `this` to fs references in parseFile ([4b079c5](https://github.com/harttle/liquidjs/commit/4b079c5))
|
||||
|
||||
# [9.6.0](https://github.com/harttle/liquidjs/compare/v9.5.0...v9.6.0) (2019-12-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* full syntax for strftime, close [#177](https://github.com/harttle/liquidjs/issues/177) ([ba5ff3f](https://github.com/harttle/liquidjs/commit/ba5ff3f))
|
||||
|
||||
# [9.5.0](https://github.com/harttle/liquidjs/compare/v9.4.2...v9.5.0) (2019-12-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* nested property for the `where` filter, [#178](https://github.com/harttle/liquidjs/issues/178) ([60ec74f](https://github.com/harttle/liquidjs/commit/60ec74f))
|
||||
|
||||
## [9.4.2](https://github.com/harttle/liquidjs/compare/v9.4.1...v9.4.2) (2019-11-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* reading .first, .last of Array, closes [#175](https://github.com/harttle/liquidjs/issues/175) ([f82da11](https://github.com/harttle/liquidjs/commit/f82da11))
|
||||
|
||||
## [9.4.1](https://github.com/harttle/liquidjs/compare/v9.4.0...v9.4.1) (2019-11-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove node dependencies for esm bundle, see [#173](https://github.com/harttle/liquidjs/issues/173) ([04df929](https://github.com/harttle/liquidjs/commit/04df929))
|
||||
|
||||
# [9.4.0](https://github.com/harttle/liquidjs/compare/v9.3.1...v9.4.0) (2019-11-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add ability to pass JSON context to CLI ([9504e4e](https://github.com/harttle/liquidjs/commit/9504e4e))
|
||||
|
||||
## [9.3.1](https://github.com/harttle/liquidjs/compare/v9.3.0...v9.3.1) (2019-11-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* liquidjs command in /bin/liquid.js, fixes [#169](https://github.com/harttle/liquidjs/issues/169) ([0073b90](https://github.com/harttle/liquidjs/commit/0073b90))
|
||||
|
||||
# [9.3.0](https://github.com/harttle/liquidjs/compare/v9.2.0...v9.3.0) (2019-11-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support require.resolve for lookup, see [#168](https://github.com/harttle/liquidjs/issues/168) ([2dd4355](https://github.com/harttle/liquidjs/commit/2dd4355))
|
||||
|
||||
## [9.1.1](https://github.com/harttle/liquidjs/compare/v9.1.0...v9.1.1) (2019-10-10)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* add string flattening to reduce retained memory (node only) ([3ad512c](https://github.com/harttle/liquidjs/commit/3ad512c))
|
||||
|
||||
# [9.1.0](https://github.com/harttle/liquidjs/compare/v9.0.1...v9.1.0) (2019-10-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* alias getTemplate() to parseFile() ([6b83788](https://github.com/harttle/liquidjs/commit/6b83788))
|
||||
|
||||
## [9.0.1](https://github.com/harttle/liquidjs/compare/v9.0.0...v9.0.1) (2019-10-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `unless` content is not waited, fixes [#160](https://github.com/harttle/liquidjs/issues/160) ([d2c8d13](https://github.com/harttle/liquidjs/commit/d2c8d13))
|
||||
|
||||
# [9.0.0](https://github.com/harttle/liquidjs/compare/v8.5.3...v9.0.0) (2019-08-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* break/continue omitting output before them, [#123](https://github.com/harttle/liquidjs/issues/123) ([ae45c46](https://github.com/harttle/liquidjs/commit/ae45c46))
|
||||
* reactjs demo during yarn install, fixes [#145](https://github.com/harttle/liquidjs/issues/145) ([b65df44](https://github.com/harttle/liquidjs/commit/b65df44))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* return value of Tag#render is no longer used ([8028f82](https://github.com/harttle/liquidjs/commit/8028f82))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* renderSync, parseAndRenderSync and renderFileSync, see [#48](https://github.com/harttle/liquidjs/issues/48) ([7fb01ad](https://github.com/harttle/liquidjs/commit/7fb01ad))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* target to es6, fixes [#137](https://github.com/harttle/liquidjs/issues/137) ([3b9fc7e](https://github.com/harttle/liquidjs/commit/3b9fc7e))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Tag#render now returns void, use emitter argument
|
||||
to write rendered html.
|
||||
* ship to Node.js 8, the dist/liquid.cjs.js (main) nolonger
|
||||
supports Node.js 6, other bundles are also provided via dist/liquid.esm.js, dist/liquid.js (ES5 umd) and liquid.min.js (minified ES5 umd)
|
||||
* remove default export, now should be used like import
|
||||
{Liquid} from 'liquidjs'
|
||||
|
||||
## [8.5.3](https://github.com/harttle/liquidjs/compare/v8.5.2...v8.5.3) (2019-08-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* escape filter when input is undefined ([a00945c](https://github.com/harttle/liquidjs/commit/a00945c))
|
||||
|
||||
## [8.5.2](https://github.com/harttle/liquidjs/compare/v8.5.1...v8.5.2) (2019-08-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* quotation tokenizing, [#151](https://github.com/harttle/liquidjs/issues/151) ([1e4f237](https://github.com/harttle/liquidjs/commit/1e4f237))
|
||||
|
||||
## [8.5.1](https://github.com/harttle/liquidjs/compare/v8.5.0...v8.5.1) (2019-08-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* publish bin directory to npm, fixes [#146](https://github.com/harttle/liquidjs/issues/146) ([a85b650](https://github.com/harttle/liquidjs/commit/a85b650))
|
||||
|
||||
# [8.5.0](https://github.com/harttle/liquidjs/compare/v8.4.1...v8.5.0) (2019-08-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* CLI support ([fc045b5](https://github.com/harttle/liquidjs/commit/fc045b5))
|
||||
|
||||
## [8.4.1](https://github.com/harttle/liquidjs/compare/v8.4.0...v8.4.1) (2019-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* some filters on undefined variable throws, [#140](https://github.com/harttle/liquidjs/issues/140) ([6e6ea0a](https://github.com/harttle/liquidjs/commit/6e6ea0a))
|
||||
|
||||
# [8.4.0](https://github.com/harttle/liquidjs/compare/v8.3.0...v8.4.0) (2019-07-06)
|
||||
|
||||
|
||||
|
||||
@@ -1,268 +1,158 @@
|
||||
# liquidjs
|
||||
[](https://www.npmjs.org/package/liquidjs)
|
||||
[](https://www.npmjs.org/package/liquidjs)
|
||||
[](https://coveralls.io/github/harttle/liquidjs?branch=master)
|
||||
[](https://github.com/harttle/liquidjs/actions/workflows/check.yml?query=branch%3Amaster)
|
||||
[](https://github.com/harttle/liquidjs/blob/master/LICENSE)
|
||||
[](https://github.com/harttle/liquidjs)
|
||||
|
||||
[](https://www.npmjs.org/package/liquidjs)
|
||||
[](https://www.npmjs.org/package/liquidjs)
|
||||
[](https://travis-ci.org/harttle/liquidjs)
|
||||
[](https://coveralls.io/github/harttle/liquidjs?branch=master)
|
||||
[](https://github.com/harttle/liquidjs/issues)
|
||||
[](https://github.com/harttle/liquidjs/graphs/contributors)
|
||||
[](https://david-dm.org/harttle/liquidjs)
|
||||
[](https://david-dm.org/harttle/liquidjs?type=dev)
|
||||
[](https://github.com/harttle/liquidjs/blob/master/LICENSE)
|
||||
[](http://github.com/harttle/liquidjs)
|
||||
[](https://github.com/harttle/liquidjs)
|
||||
A simple, expressive and safe [Shopify][shopify/liquid] / Github Pages compatible template engine in pure JavaScript.
|
||||
**The purpose of this repo** is to provide a standard Liquid implementation for the JavaScript community so that [Jekyll sites](https://jekyllrb.com), [Github Pages](https://pages.github.com/) and [Shopify templates](https://themes.shopify.com/) can be ported to Node.js without pain.
|
||||
|
||||
A [shopify][shopify/liquid] compatible [Liquid][tutorial] template engine in pure JavaScript.
|
||||
* [Documentation][doc]
|
||||
* Please star [LiquidJS on GitHub][github]!
|
||||
* Support [LiquidJS on Open Collective][oc] or [Patreon][patreon]
|
||||
|
||||
Install via npm:
|
||||
<p align="center"><a href="https://liquidjs.com"><img height="155px" width="155px" src="https://liquidjs.com/icon/mstile-310x310.png" alt="logo"></a></p>
|
||||
|
||||
## What's it like?
|
||||
|
||||
Basically there're two types of Liquid syntax: tags enclosed by `{% %}` and outputs enclosed by `{{ }}`. A Liquid template looks like:
|
||||
|
||||
```liquid
|
||||
{% if username %}
|
||||
{{ username | append: ", welcome to LiquidJS!" | capitalize }}
|
||||
{% endif %}
|
||||
```
|
||||
|
||||
[A live demo](https://liquidjs.com/playground.html) is also available and here's a [quick tutorial](https://liquidjs.com/tutorials/intro-to-liquid.html) for Liquid syntax.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Install from npm in Node.js:
|
||||
|
||||
```bash
|
||||
npm install --save liquidjs
|
||||
npm install liquidjs
|
||||
```
|
||||
|
||||
Or include the UMD build:
|
||||
Or use the UMD bundle from jsDelivr:
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/liquidjs/dist/liquid.min.js"></script> <!--for production-->
|
||||
<script src="//unpkg.com/liquidjs/dist/liquid.js"></script> <!--for development-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>
|
||||
```
|
||||
|
||||
You may need a [Promise polyfill][pp] for Node.js < 4 and ES5 browsers like [IE and Android UC][caniuse-promises].
|
||||
More details, refer to [The Setup Guide][setup].
|
||||
|
||||
## TOC
|
||||
## Related Packages
|
||||
|
||||
* Get Started
|
||||
* [Render from String](#render-from-string)
|
||||
* [Render from File](#render-from-file)
|
||||
* [Use with Express.js](#use-with-expressjs)
|
||||
* [Include Partials](#include-partials)
|
||||
* [Layout Templates (Extends)](#layout-templates-extends)
|
||||
* Demos
|
||||
* Node.js: [/demo/node/](demo/node/)
|
||||
* Browser: <https://jsfiddle.net/6u40xbzs/>, [/demo/browser/](demo/browser/).
|
||||
* Express.js: [/demo/express/](demo/express/)
|
||||
* TypeScript: [/demo/typescript/](demo/typescript/)
|
||||
* React JS: [/demo/reactjs/](demo/reactjs/)
|
||||
* Advanced
|
||||
* [Options](#options)
|
||||
* [Register Filters](#register-filters), [Builtin Filters](https://github.com/harttle/liquidjs/wiki/Builtin-Filters)
|
||||
* [Register Tags](#register-tags), [Builtin Tags](https://github.com/harttle/liquidjs/wiki/Builtin-Tags)
|
||||
* [Operators](https://github.com/harttle/liquidjs/wiki/Operators)
|
||||
* [Whitespace Control](https://github.com/harttle/liquidjs/wiki/Whitespace-Control)
|
||||
* [Plugin API](#plugin-api)
|
||||
* [Differences With shopify/liquid](#differences-with-shopify%2fliquid)
|
||||
* [Contribute Guidelines](#contribute-guidelines)
|
||||
* [gulp-liquidjs](https://www.npmjs.com/package/@tuanpham-dev/gulp-liquidjs): A shopify compatible Liquid template engine for Gulp using liquidjs.
|
||||
* [grunt-liquify](https://www.npmjs.com/package/grunt-liquify): A Grunt task to process Liquid using liquidjs. Use it to add Liquid magic to your scripts and css assets.
|
||||
* [react-liquid](https://github.com/aquibm/react-liquid#readme): Liquid templating language component for React
|
||||
* [@11ty/eleventy](https://www.npmjs.com/package/@11ty/eleventy): A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types) into HTML.
|
||||
|
||||
## Render from String
|
||||
## Financial Support
|
||||
|
||||
Just render a template string with a context:
|
||||
If you love LiquidJS or your company is using LiquidJS? Please consider [support us on Open Collective or Patreon][financial-support].
|
||||
|
||||
```javascript
|
||||
var Liquid = require('liquidjs');
|
||||
var engine = new Liquid();
|
||||
### Backers
|
||||
If you personally like LiquidJS and find it's useful to you, you can become a backer!
|
||||
|
||||
engine
|
||||
.parseAndRender('{{name | capitalize}}', {name: 'alice'})
|
||||
.then(console.log); // outputs 'Alice'
|
||||
```
|
||||
<object type="image/svg+xml" data="https://opencollective.com/liquidjs/backers.svg?avatarHeight=72"></object>
|
||||
|
||||
Caching parsed templates:
|
||||
### Sponsors
|
||||
If LiquidJS is benefiting your business/company, please sponsor us to make it better!
|
||||
|
||||
```javascript
|
||||
var tpl = engine.parse('{{name | capitalize}}');
|
||||
engine
|
||||
.render(tpl, {name: 'alice'})
|
||||
.then(console.log); // outputs 'Alice'
|
||||
```
|
||||
<object type="image/svg+xml" data="https://opencollective.com/liquidjs/sponsors.svg?avatarHeight=72"></object>
|
||||
## Contributors ✨
|
||||
|
||||
## Render from File
|
||||
Want to contribute? see [Contribution Guidelines][contribution]. Thanks goes to these wonderful people:
|
||||
|
||||
```javascript
|
||||
var engine = new Liquid({
|
||||
root: path.resolve(__dirname, 'views/'), // root for layouts/includes lookup
|
||||
extname: '.liquid' // used for layouts/includes, defaults ""
|
||||
});
|
||||
engine
|
||||
.renderFile("hello", {name: 'alice'}) // will read and render `views/hello.liquid`
|
||||
.then(console.log) // outputs "Alice"
|
||||
```
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="https://harttle.land"><img src="https://avatars3.githubusercontent.com/u/4427974?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jun Yang</b></sub></a><br /><a href="#maintenance-harttle" title="Maintenance">🚧</a> <a href="https://github.com/harttle/liquidjs/commits?author=harttle" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/chenos"><img src="https://avatars0.githubusercontent.com/u/2993310?v=4?s=100" width="100px;" alt=""/><br /><sub><b>chenos</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=chenos" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://zachleat.com/"><img src="https://avatars2.githubusercontent.com/u/39355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zach Leatherman</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/issues?q=author%3Azachleat" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://github.com/thardy"><img src="https://avatars3.githubusercontent.com/u/120636?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tim Hardy</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=thardy" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://paulrobertlloyd.com/"><img src="https://avatars3.githubusercontent.com/u/813383?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul Robert Lloyd</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=paulrobertlloyd" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/issues?q=author%3Apaulrobertlloyd" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://twitter.com/alecdotbiz"><img src="https://avatars2.githubusercontent.com/u/1925840?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alec Larson</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=aleclarson" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/pmalouin"><img src="https://avatars1.githubusercontent.com/u/1411117?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patrick Malouin</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=pmalouin" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/commits?author=pmalouin" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://jaswrks.com"><img src="https://avatars3.githubusercontent.com/u/1563559?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jaswrks</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=jaswrks" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://oott123.com"><img src="https://avatars2.githubusercontent.com/u/905663?v=4?s=100" width="100px;" alt=""/><br /><sub><b>三三</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=oott123" title="Code">💻</a> <a href="#ideas-oott123" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/ssendev"><img src="https://avatars0.githubusercontent.com/u/450793?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ssendev</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ssendev" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/commits?author=ssendev" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/wojtask9"><img src="https://avatars3.githubusercontent.com/u/6099236?v=4?s=100" width="100px;" alt=""/><br /><sub><b>wojtask9</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=wojtask9" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/thelornenelson"><img src="https://avatars3.githubusercontent.com/u/24596583?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrew Barclay</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=thelornenelson" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://www.stam.pr/"><img src="https://avatars2.githubusercontent.com/u/142338?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cory Mawhorter</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=cmawhorter" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/thehappybug"><img src="https://avatars0.githubusercontent.com/u/3393530?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mehdi Jaffery</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=thehappybug" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/robinbijlani"><img src="https://avatars0.githubusercontent.com/u/2503108?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Robin Bijlani</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=robinbijlani" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/issues?q=author%3Arobinbijlani" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://www.rmkennedy.com"><img src="https://avatars3.githubusercontent.com/u/8356669?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ryan Kennedy</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ryaninvents" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/strax"><img src="https://avatars2.githubusercontent.com/u/587213?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sami Kukkonen</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=strax" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://ScottFreeCode.github.io/"><img src="https://avatars3.githubusercontent.com/u/16506071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Scott Santucci</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ScottFreeCode" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://stevenrescigno.com"><img src="https://avatars3.githubusercontent.com/u/8505293?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steven </b></sub></a><br /><a href="#example-stevenanthonyrevo" title="Examples">💡</a> <a href="https://github.com/harttle/liquidjs/commits?author=stevenanthonyrevo" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://efcl.info/"><img src="https://avatars1.githubusercontent.com/u/19714?v=4?s=100" width="100px;" alt=""/><br /><sub><b>azu</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=azu" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/wyozi"><img src="https://avatars3.githubusercontent.com/u/4894573?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joonas</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=wyozi" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/jamelait"><img src="https://avatars1.githubusercontent.com/u/14369255?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jamel A.</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=jamelait" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://brandonpittman.net"><img src="https://avatars0.githubusercontent.com/u/967145?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brandon Pittman</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=brandonpittman" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/tgrandgent"><img src="https://avatars3.githubusercontent.com/u/17069042?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tgrandgent</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=tgrandgent" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/mastodon0"><img src="https://avatars1.githubusercontent.com/u/7924332?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Martin Schuster</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mastodon0" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://js.chenlei.me"><img src="https://avatars0.githubusercontent.com/u/6339390?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ray</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=richardo2016" title="Tests">⚠️</a> <a href="https://github.com/harttle/liquidjs/commits?author=richardo2016" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/CriGoT"><img src="https://avatars0.githubusercontent.com/u/1936786?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cristofer Gonzales</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=CriGoT" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://www.raymondcamden.com"><img src="https://avatars3.githubusercontent.com/u/393660?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Raymond Camden</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=cfjedimaster" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://stedman.dev"><img src="https://avatars1.githubusercontent.com/u/183122?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steve Stedman</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=stedman" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://ciccarello.me"><img src="https://avatars0.githubusercontent.com/u/11273838?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anthony Ciccarello</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=aciccarello" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://twitter.com/IAmTrySound"><img src="https://avatars0.githubusercontent.com/u/5635476?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bogdan Chadkin</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=TrySound" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://hightouch.io"><img src="https://avatars0.githubusercontent.com/u/5959235?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tejas Manohar</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=tejasmanohar" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://about.me/peterdehaan"><img src="https://avatars2.githubusercontent.com/u/557895?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Peter deHaan</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=pdehaan" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/amit777"><img src="https://avatars0.githubusercontent.com/u/2703309?v=4?s=100" width="100px;" alt=""/><br /><sub><b>amit777</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=amit777" title="Code">💻</a> <a href="#financial-amit777" title="Financial">💵</a></td>
|
||||
<td align="center"><a href="http://www.ifi.uzh.ch/en/ce/people/schuldenzucker.html"><img src="https://avatars3.githubusercontent.com/u/1100776?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steffen Schuldenzucker</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=sschuldenzucker" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Pixcell"><img src="https://avatars0.githubusercontent.com/u/4005291?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pixcell</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=Pixcell" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://jasonet.co"><img src="https://avatars.githubusercontent.com/u/10660468?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jason Etcovitch</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=JasonEtco" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/kayuapi"><img src="https://avatars.githubusercontent.com/u/10304328?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ZC</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=kayuapi" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://memmie.lenglet.name"><img src="https://avatars.githubusercontent.com/u/729275?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Memmie Lenglet</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mems" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/ilhamdev0"><img src="https://avatars.githubusercontent.com/u/57636145?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ilhamdev0</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ilhamdev0" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/c412216887"><img src="https://avatars.githubusercontent.com/u/29691650?v=4?s=100" width="100px;" alt=""/><br /><sub><b>一饮一啄皆是人生</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=c412216887" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://digitalinspiration.com/"><img src="https://avatars.githubusercontent.com/u/1344071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amit Agarwal</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=labnol" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://n1ru4l.cloud/"><img src="https://avatars.githubusercontent.com/u/14338007?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Laurin Quast</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=n1ru4l" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/mattvague"><img src="https://avatars.githubusercontent.com/u/64985?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt Vague</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mattvague" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/bglw"><img src="https://avatars.githubusercontent.com/u/40188355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Liam Bigelow</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=bglw" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://about.me/jasonkurian"><img src="https://avatars.githubusercontent.com/u/2642545?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jason Kurian</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=JaKXz" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/dphm"><img src="https://avatars.githubusercontent.com/u/1707217?v=4?s=100" width="100px;" alt=""/><br /><sub><b>d pham (they/them)</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=dphm" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://www.aleksandrhovhannisyan.com/"><img src="https://avatars.githubusercontent.com/u/19352442?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aleksandr Hovhannisyan</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=AleksandrHovhannisyan" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/jg-rp"><img src="https://avatars.githubusercontent.com/u/72664870?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jg-rp</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=jg-rp" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/ameyaapte1"><img src="https://avatars.githubusercontent.com/u/16054747?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ameya Apte</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ameyaapte1" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/tbdrz"><img src="https://avatars.githubusercontent.com/u/50599116?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tbdrz</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=tbdrz" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="http://santialbo.com"><img src="https://avatars.githubusercontent.com/u/1557563?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Santi Albo</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=santialbo" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Use with Express.js
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
```javascript
|
||||
// register liquid engine
|
||||
app.engine('liquid', engine.express());
|
||||
app.set('views', './views'); // specify the views directory
|
||||
app.set('view engine', 'liquid'); // set to default
|
||||
```
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
[`views`][express-views] in express.js will be included when looking up
|
||||
partials(includes and layouts).
|
||||
|
||||
## Include Partials
|
||||
|
||||
```
|
||||
// file: color.liquid
|
||||
color: '{{ color }}' shape: '{{ shape }}'
|
||||
|
||||
// file: theme.liquid
|
||||
{% assign shape = 'circle' %}
|
||||
{% include 'color' %}
|
||||
{% include 'color' with 'red' %}
|
||||
{% include 'color', color: 'yellow', shape: 'square' %}
|
||||
```
|
||||
|
||||
The output will be:
|
||||
|
||||
```
|
||||
color: '' shape: 'circle'
|
||||
color: 'red' shape: 'circle'
|
||||
color: 'yellow' shape: 'square'
|
||||
```
|
||||
|
||||
## Layout Templates (Extends)
|
||||
|
||||
```
|
||||
// file: default-layout.liquid
|
||||
Header
|
||||
{% block content %}My default content{% endblock %}
|
||||
Footer
|
||||
|
||||
// file: page.liquid
|
||||
{% layout "default-layout" %}
|
||||
{% block content %}My page content{% endblock %}
|
||||
```
|
||||
|
||||
The output of `page.liquid`:
|
||||
|
||||
```
|
||||
Header
|
||||
My page content
|
||||
Footer
|
||||
```
|
||||
|
||||
* It's possible to define multiple blocks.
|
||||
* block name is optional when there's only one block.
|
||||
|
||||
## Options
|
||||
|
||||
The full list of options for `Liquid()` is listed as following:
|
||||
|
||||
* `root` is a directory or an array of directories to resolve layouts and includes, as well as the filename passed in when calling `.renderFile()`.
|
||||
If an array, the files are looked up in the order they occur in the array.
|
||||
Defaults to `["."]`
|
||||
|
||||
* `extname` is used to lookup the template file when filepath doesn't include an extension name. Eg: setting to `".html"` will allow including file by basename. Defaults to `""`.
|
||||
|
||||
* `cache` indicates whether or not to cache resolved templates. Defaults to `false`.
|
||||
|
||||
* `dynamicPartials`: if set, treat `<filepath>` parameter in `{%include filepath %}`, `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`.
|
||||
|
||||
* `strictFilters` is used to enable strict filter existence. If set to `false`, undefined filters will be rendered as empty string. Otherwise, undefined filters will cause an exception. Defaults to `false`.
|
||||
|
||||
* `strictVariables` is used to enable strict variable derivation.
|
||||
If set to `false`, undefined variables will be rendered as empty string.
|
||||
Otherwise, undefined variables will cause an exception. Defaults to `false`.
|
||||
|
||||
* `trimTagRight` is used to strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`.
|
||||
|
||||
* `trimTagLeft` is similiar to `trimTagRight`, whereas the `\n` is exclusive. Defaults to `false`. See [Whitespace Control][whitespace control] for details.
|
||||
|
||||
* `trimOutputRight` is used to strip blank characters (including ` `, `\t`, and `\r`) from the right of values (`{{ }}`) until `\n` (inclusive). Defaults to `false`.
|
||||
|
||||
* `trimOutputLeft` is similiar to `trimOutputRight`, whereas the `\n` is exclusive. Defaults to `false`. See [Whitespace Control][whitespace control] for details.
|
||||
|
||||
* `tagDelimiterLeft` and `tagDelimiterRight` are used to override the delimiter for liquid tags.
|
||||
|
||||
* `outputDelimiterLeft` and `outputDelimiterRight` are used to override the delimiter for liquid outputs.
|
||||
|
||||
* `greedy` is used to specify whether `trim*Left`/`trim*Right` is greedy. When set to `true`, all consecutive blank characters including `\n` will be trimed regardless of line breaks. Defaults to `true`.
|
||||
|
||||
* `fs` is used to override the default file-system module with a custom implementation.
|
||||
|
||||
## Register Filters
|
||||
|
||||
```javascript
|
||||
// Usage: {{ name | uppper }}
|
||||
engine.registerFilter('upper', v => v.toUpperCase())
|
||||
```
|
||||
|
||||
Filter arguments will be passed to the registered filter function, for example:
|
||||
|
||||
```javascript
|
||||
// Usage: {{ 1 | add: 2, 3 }}
|
||||
engine.registerFilter('add', (initial, arg1, arg2) => initial + arg1 + arg2)
|
||||
```
|
||||
|
||||
See existing filter implementations here: <https://github.com/harttle/liquidjs/tree/master/src/builtin/filters>
|
||||
|
||||
## Register Tags
|
||||
|
||||
```javascript
|
||||
// Usage: {% upper name%}
|
||||
engine.registerTag('upper', {
|
||||
parse: function(tagToken, remainTokens) {
|
||||
this.str = tagToken.args; // name
|
||||
},
|
||||
render: async function(scope, hash) {
|
||||
var str = await Liquid.evalValue(this.str, scope); // 'alice'
|
||||
return str.toUpperCase() // 'Alice'
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
* `parse`: Read tokens from `remainTokens` until your end token.
|
||||
* `render`: Combine scope data with your parsed tokens into HTML string.
|
||||
|
||||
See existing tag implementations here: <https://github.com/harttle/liquidjs/tree/master/src/builtin/tags>
|
||||
|
||||
## Plugin API
|
||||
|
||||
A pack of tags or filters can be encapsulated into a **plugin**, which will be typically installed via npm.
|
||||
|
||||
```javascript
|
||||
engine.plugin(require('./some-plugin'));
|
||||
|
||||
// some-plugin.js
|
||||
module.exports = function (Liquid) {
|
||||
// here `this` refers to the engine instance
|
||||
// `Liquid` provides facilities to implement tags and filters
|
||||
this.registerFilter('foo', x => x);
|
||||
}
|
||||
```
|
||||
|
||||
Plugin List:
|
||||
|
||||
* To add your plugin, contact me or simply send a PR.
|
||||
|
||||
## Differences With shopify/liquid
|
||||
|
||||
Though being compatible with [Ruby Liquid](https://github.com/shopify/liquid) is one of our priorities, there're still certain differences. You may need some configuration to get it compatible in these senarios:
|
||||
|
||||
* Dynamic file locating (enabled by default), that means layout/partial names are treated as variables in liquidjs. See [#51](https://github.com/harttle/liquidjs/issues/51).
|
||||
* Truthy and Falsy. All values except `undefined`, `null`, `false` are truthy, whereas in Ruby Liquid all except `nil` and `false` are truthy. See [#26](https://github.com/harttle/liquidjs/pull/26).
|
||||
* Number Rendering. Since JavaScript do not distinguish `float` and `integer`, we cannot either convert between them nor render regarding to their type. See [#59](https://github.com/harttle/liquidjs/issues/59).
|
||||
* [.to_liquid()](https://github.com/Shopify/liquid/wiki/Introduction-to-Drops) is replaced by `.toLiquid()`
|
||||
* [.to_s()](https://www.rubydoc.info/gems/liquid/Liquid/Drop) is replaced by JavaScript `.toString()`
|
||||
|
||||
## Contribute Guidelines
|
||||
|
||||
This repo uses [eslint](https://eslint.org/) to check code style, [semantic-release](https://github.com/semantic-release/semantic-release) to generate changelog and publish to npm and Github Releases.
|
||||
|
||||
* Code Style: <https://github.com/standard/eslint-config-standard>, `npm run lint` to check locally.
|
||||
* Commit Message: <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits>
|
||||
|
||||
[nunjucks]: http://mozilla.github.io/nunjucks/
|
||||
[liquid-node]: https://github.com/sirlantis/liquid-node
|
||||
[shopify/liquid]: https://shopify.github.io/liquid/
|
||||
[jekyll]: http://jekyllrb.com/
|
||||
[gh]: https://pages.github.com/
|
||||
[any-promise]: https://github.com/kevinbeaty/any-promise
|
||||
[test]: https://github.com/harttle/liquidjs/tree/master/test
|
||||
[caniuse-promises]: http://caniuse.com/#feat=promises
|
||||
[whitespace control]: https://github.com/harttle/liquidjs/wiki/Whitespace-Control
|
||||
[tags]: https://github.com/harttle/liquidjs/wiki/Builtin-Tags
|
||||
[filters]: https://github.com/harttle/liquidjs/wiki/Builtin-Filters
|
||||
[express-views]: http://expressjs.com/en/guide/using-template-engines.html
|
||||
[pp]: https://github.com/taylorhakes/promise-polyfill
|
||||
[tutorial]: https://shopify.github.io/liquid/basics/introduction/
|
||||
[plugins]: https://liquidjs.com/tutorials/plugins.html#Plugin-List
|
||||
[setup]: https://liquidjs.com/tutorials/setup.html
|
||||
[doc]: https://liquidjs.com
|
||||
[github]: https://github.com/harttle/liquidjs
|
||||
[patreon]: https://www.patreon.com/harttle
|
||||
[oc]: https://opencollective.com/liquidjs/
|
||||
[contribution]: https://liquidjs.com/tutorials/contribution-guidelines.html
|
||||
[financial-support]: https://liquidjs.com/tutorials/contribution-guidelines.html#Financial-Support
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Only the latest major version is supported with security updates. It can be changed if many people are relying on a specific version for some reason. If this is the case, welcome to file an issue.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please contact yangjvn@126.com to report a vulnerability.
|
||||
|
||||
- It will be fixed very soon (maybe within 1 week or couple of days) if that vulnerability obviously affects common use cases.
|
||||
- Otherwise, it'll be scheduled with a priority just like requested features (which is lower than bugs).
|
||||
- If it's declined, you'll receive an email (more oftenly there will be a discuss).
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"extends": ["standard"],
|
||||
"rules": {
|
||||
"no-unused-expressions": "off"
|
||||
"no-unused-expressions": "off",
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const Benchmark = require('benchmark')
|
||||
const data = require('./data/todolist.json')
|
||||
const path = require('path')
|
||||
|
||||
const engines = {
|
||||
handlebars: require('./engines/handlebars'),
|
||||
liquid: require('./engines/liquid'),
|
||||
react: require('./engines/react'),
|
||||
swig: require('./engines/swig')
|
||||
}
|
||||
|
||||
function crossEngines () {
|
||||
console.log(' cross engines')
|
||||
console.log('------------------------')
|
||||
return new Promise(resolve => {
|
||||
const suit = new Benchmark.Suite('cross engines')
|
||||
|
||||
for (const [name, { load, render }] of Object.entries(engines)) {
|
||||
const tpl = load(path.resolve(__dirname, `templates/todolist`))
|
||||
suit.add(name, () => render(tpl, data))
|
||||
}
|
||||
|
||||
suit.on('cycle', event => console.log(String(event.target)))
|
||||
suit.on('complete', resolve)
|
||||
suit.run({ async: true })
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = { crossEngines }
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"categories": [{
|
||||
"color": "red",
|
||||
"id": "CAT1",
|
||||
"title": "work"
|
||||
}, {
|
||||
"color": "red",
|
||||
"id": "CAT2",
|
||||
"title": "emergency"
|
||||
}, {
|
||||
"color": "green",
|
||||
"id": "CAT3",
|
||||
"title": "sport"
|
||||
}],
|
||||
"todos": [{
|
||||
"title": "fork and clone",
|
||||
"id": "TODO1",
|
||||
"category": "work"
|
||||
}, {
|
||||
"title": "make it better",
|
||||
"id": "TODO2",
|
||||
"category": "sport"
|
||||
}, {
|
||||
"title": "make a pull request",
|
||||
"id": "TODO3",
|
||||
"category": "work"
|
||||
}]
|
||||
}
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
const Benchmark = require('benchmark')
|
||||
const { Liquid } = require('..')
|
||||
const ctx = require('./data/todolist.json')
|
||||
const { resolve } = require('path')
|
||||
|
||||
const engine = new Liquid({
|
||||
root: resolve(__dirname, 'templates'),
|
||||
extname: '.liquid'
|
||||
})
|
||||
|
||||
engine.registerTag('header', {
|
||||
parse: function (token) {
|
||||
const [key, val] = token.args.split(':')
|
||||
this[key] = val
|
||||
},
|
||||
render: function (ctx) {
|
||||
const title = this.liquid.evalValue(this.content, ctx)
|
||||
return `<h1>${title}</h1>`
|
||||
}
|
||||
})
|
||||
|
||||
function demo () {
|
||||
console.log(' demo')
|
||||
console.log('------------------------')
|
||||
return new Promise(resolve => {
|
||||
new Benchmark.Suite('demo')
|
||||
.add('demo', {
|
||||
defer: true,
|
||||
fn: d => engine.renderFile('todolist', ctx).then(x => d.resolve(x))
|
||||
})
|
||||
.on('cycle', event => console.log(String(event.target)))
|
||||
.on('complete', resolve)
|
||||
.run({ 'async': true })
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = { demo }
|
||||
@@ -1,49 +0,0 @@
|
||||
import * as Benchmark from 'benchmark'
|
||||
import Liquid from '../src/liquid'
|
||||
import TagToken from '../src/parser/tag-token'
|
||||
import Context from '../src/context/context'
|
||||
|
||||
const engine = new Liquid({
|
||||
root: __dirname,
|
||||
extname: '.liquid'
|
||||
})
|
||||
|
||||
engine.registerTag('header', {
|
||||
parse: function (token: TagToken) {
|
||||
const [key, val] = token.args.split(':')
|
||||
this[key] = val
|
||||
},
|
||||
render: function (ctx: Context) {
|
||||
const title = this.liquid.evalValue(this.content, ctx)
|
||||
return `<h1>${title}</h1>`
|
||||
}
|
||||
})
|
||||
|
||||
const ctx = {
|
||||
todos: ['fork and clone', 'make it better', 'make a pull request'],
|
||||
title: 'Welcome to liquidjs!'
|
||||
}
|
||||
|
||||
const template = `
|
||||
{%header content: "welcome to liquid" | capitalize%}
|
||||
|
||||
<ul>
|
||||
{% for todo in todos %}
|
||||
<li>{{forloop.index}} - {{todo}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
`
|
||||
|
||||
export default function () {
|
||||
console.log('--- demo ---')
|
||||
return new Promise(resolve => {
|
||||
new Benchmark.Suite('demo')
|
||||
.add('demo', {
|
||||
defer: true,
|
||||
fn: (d: any) => engine.parseAndRender(template, ctx).then(x => d.resolve(x))
|
||||
})
|
||||
.on('cycle', (event: any) => console.log(String(event.target)))
|
||||
.on('complete', resolve)
|
||||
.run({ 'async': true })
|
||||
})
|
||||
}
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env node
|
||||
const { performance } = require('perf_hooks')
|
||||
const path = require('path')
|
||||
|
||||
const FILE_LOCAL = process.argv[2]
|
||||
const FILE_LATEST = process.argv[3]
|
||||
console.log(`Local: ${FILE_LOCAL}`)
|
||||
console.log(`Latest: ${FILE_LATEST}`)
|
||||
|
||||
const { createEngine } = require('./engines/create-liquid')
|
||||
const local = createEngine(require(path.resolve(__dirname, '..', FILE_LOCAL)))
|
||||
const latest = createEngine(require(path.resolve(__dirname, '..', FILE_LOCAL)))
|
||||
const data = require('./data/todolist.json')
|
||||
const tpl = path.resolve(__dirname, `templates/todolist`)
|
||||
|
||||
const begin = performance.now()
|
||||
const tplLocal = local.load(tpl)
|
||||
const tplLatest = latest.load(tpl)
|
||||
const tasks = [
|
||||
{
|
||||
cycles: 0,
|
||||
time: 0,
|
||||
fn: () => latest.render(tplLatest, data)
|
||||
},
|
||||
{
|
||||
cycles: 0,
|
||||
time: 0,
|
||||
fn: () => local.render(tplLocal, data)
|
||||
}
|
||||
]
|
||||
while (performance.now() - begin < 20e3) {
|
||||
const task = tasks[Math.floor(Math.random() * 2)]
|
||||
task.time -= performance.now()
|
||||
task.fn()
|
||||
task.time += performance.now()
|
||||
task.cycles++
|
||||
}
|
||||
|
||||
const [ latestResult, localResult ] = tasks.map(task => {
|
||||
task.perf = task.cycles * 1000 / task.time
|
||||
return task
|
||||
})
|
||||
const diff = (localResult.perf - latestResult.perf) / latestResult.perf
|
||||
|
||||
console.log(`Local: ${localResult.perf.toFixed(3)} ops/s (${localResult.cycles} cycles)`)
|
||||
console.log(`Latest: ${latestResult.perf.toFixed(3)} ops/s (${latestResult.cycles} cycles)`)
|
||||
console.log(`Diff: ${(diff * 100).toFixed(3)}%`)
|
||||
|
||||
const THRESHOLD_PERCENT = -3
|
||||
process.exit(diff * 100 < THRESHOLD_PERCENT ? 1 : 0)
|
||||
@@ -0,0 +1,17 @@
|
||||
const { readFileSync } = require('fs')
|
||||
const { join } = require('path')
|
||||
|
||||
function createEngine (pkg) {
|
||||
const liquid = new pkg.Liquid({
|
||||
root: join(__dirname, '../templates'),
|
||||
cache: true,
|
||||
extname: '.liquid'
|
||||
})
|
||||
liquid.registerFilter('url', path => `http://example.com${path}`)
|
||||
return {
|
||||
load: path => liquid.parse(readFileSync(path + '.liquid', 'utf8')),
|
||||
render: (tpl, data) => liquid.renderSync(tpl, data)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { createEngine }
|
||||
@@ -0,0 +1,33 @@
|
||||
const handlebars = require('handlebars')
|
||||
const { readFileSync } = require('fs')
|
||||
const { join } = require('path')
|
||||
|
||||
handlebars.registerPartial(
|
||||
'todo-icon',
|
||||
readFileSync(join(__dirname, '../templates/todo-icon.hbs'), 'utf8')
|
||||
)
|
||||
|
||||
handlebars.registerHelper('concat', function (...args) {
|
||||
return args.filter(x => typeof x === 'string').join('')
|
||||
})
|
||||
|
||||
handlebars.registerHelper('url', function (path) {
|
||||
return `http://example.com${path}`
|
||||
})
|
||||
|
||||
handlebars.registerHelper('inc', function (num) {
|
||||
return Number(num) + 1
|
||||
})
|
||||
|
||||
handlebars.registerHelper('capitalize', function (str) {
|
||||
return str[0].toUpperCase() + str.slice(1).toLowerCase()
|
||||
})
|
||||
|
||||
handlebars.registerHelper('upcase', function (str) {
|
||||
return str.toUpperCase()
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
load: path => handlebars.compile(readFileSync(path + '.hbs', 'utf8')),
|
||||
render: (tpl, data) => tpl(data)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
const { createEngine } = require('./create-liquid')
|
||||
|
||||
module.exports = createEngine(require('../../dist/liquid.node.cjs'))
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
const { readFileSync } = require('fs')
|
||||
const React = require('react')
|
||||
const ReactDOMServer = require('react-dom/server')
|
||||
const babel = require('@babel/core')
|
||||
const requireFromString = require('require-from-string')
|
||||
|
||||
const babelConfig = {
|
||||
presets: ['@babel/preset-react', '@babel/preset-env']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
load: path => {
|
||||
const src = readFileSync(path + '.jsx', 'utf8')
|
||||
const transformed = babel.transform(src, babelConfig)
|
||||
return requireFromString(transformed.code)
|
||||
},
|
||||
render: (Component, data) => {
|
||||
return ReactDOMServer.renderToString(React.createElement(Component, data))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
const swig = require('swig')
|
||||
|
||||
swig.setFilter('url', function (path) {
|
||||
return `http://example.com${path}`
|
||||
})
|
||||
|
||||
swig.setFilter('prepend', function (input, arg) {
|
||||
return arg + input
|
||||
})
|
||||
|
||||
swig.setFilter('append', function (input, arg) {
|
||||
return input + arg
|
||||
})
|
||||
|
||||
swig.setFilter('inc', function (num) {
|
||||
return Number(num) + 1
|
||||
})
|
||||
|
||||
swig.setFilter('capitalize', function (str) {
|
||||
return str[0].toUpperCase() + str.slice(1).toLowerCase()
|
||||
})
|
||||
|
||||
swig.setFilter('upcase', function (str) {
|
||||
return str.toUpperCase()
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
load: path => swig.compileFile(path + '.swig'),
|
||||
render: (tpl, data) => tpl(data)
|
||||
}
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
const { output } = require('./output')
|
||||
const { tag } = require('./tag')
|
||||
const { demo } = require('./demo')
|
||||
const { layout } = require('./layout')
|
||||
const { memory } = require('./memory')
|
||||
const { crossEngines } = require('./cross-engines')
|
||||
|
||||
async function main () {
|
||||
await output()
|
||||
await tag()
|
||||
await demo()
|
||||
await layout()
|
||||
await memory()
|
||||
await crossEngines()
|
||||
}
|
||||
|
||||
main()
|
||||
@@ -1,13 +0,0 @@
|
||||
import output from './output'
|
||||
import tag from './tag'
|
||||
import demo from './demo'
|
||||
import layout from './layout'
|
||||
|
||||
async function main () {
|
||||
await output()
|
||||
await tag()
|
||||
await demo()
|
||||
await layout()
|
||||
}
|
||||
|
||||
main()
|
||||
Regular → Executable
+10
-7
@@ -1,5 +1,5 @@
|
||||
import * as Benchmark from 'benchmark'
|
||||
import Liquid from '../src/liquid'
|
||||
const Benchmark = require('benchmark')
|
||||
const { Liquid } = require('..')
|
||||
|
||||
const engineOptions = {
|
||||
root: __dirname,
|
||||
@@ -17,20 +17,23 @@ const template = `
|
||||
{% block body %}a small body{% endblock %}
|
||||
`
|
||||
|
||||
export default function () {
|
||||
console.log('--- layout ---')
|
||||
function layout () {
|
||||
console.log(' layout')
|
||||
console.log('------------------------')
|
||||
return new Promise(resolve => {
|
||||
new Benchmark.Suite('layout')
|
||||
.add('cache=false', {
|
||||
defer: true,
|
||||
fn: (d: any) => engine.parseAndRender(template, {}).then(x => d.resolve(x))
|
||||
fn: d => engine.parseAndRender(template, {}).then(x => d.resolve(x))
|
||||
})
|
||||
.add('cache=true', {
|
||||
defer: true,
|
||||
fn: (d: any) => cachingEngine.parseAndRender(template, {}).then(x => d.resolve(x))
|
||||
fn: d => cachingEngine.parseAndRender(template, {}).then(x => d.resolve(x))
|
||||
})
|
||||
.on('cycle', (event: any) => console.log(String(event.target)))
|
||||
.on('cycle', event => console.log(String(event.target)))
|
||||
.on('complete', resolve)
|
||||
.run({ 'async': true })
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = { layout }
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
const { join } = require('path')
|
||||
const { readFileSync } = require('fs')
|
||||
const { getHeapStatistics } = require('v8')
|
||||
const { Liquid } = require('..')
|
||||
|
||||
const engineOptions = {
|
||||
root: __dirname,
|
||||
extname: '.liquid'
|
||||
}
|
||||
|
||||
const engine = new Liquid(engineOptions)
|
||||
|
||||
const SAMPLE_COUNT = 1024
|
||||
|
||||
function memory () {
|
||||
console.log(' memory')
|
||||
console.log('------------------------')
|
||||
html()
|
||||
todolist()
|
||||
}
|
||||
|
||||
function html () {
|
||||
const str = readFileSync(join(__dirname, 'templates/lorem-html.liquid'), 'utf8')
|
||||
|
||||
global.gc()
|
||||
const base = getHeapStatistics().used_heap_size
|
||||
const templates = []
|
||||
|
||||
for (let i = 0; i < SAMPLE_COUNT; i++) {
|
||||
templates.push(engine.parse(str))
|
||||
}
|
||||
const diff1 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
|
||||
console.log(`[lorem-html ${h(str.length)}][before GC] ${h(diff1)}/tpl (${SAMPLE_COUNT} runs sampled)`)
|
||||
|
||||
global.gc()
|
||||
const diff2 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
|
||||
console.log(`[lorem-html ${h(str.length)}][after GC] ${h(diff2)}/tpl (${SAMPLE_COUNT} runs sampled)`)
|
||||
}
|
||||
|
||||
function todolist () {
|
||||
const str = readFileSync(join(__dirname, 'templates/todolist.liquid'), 'utf8')
|
||||
|
||||
global.gc()
|
||||
const base = getHeapStatistics().used_heap_size
|
||||
const templates = []
|
||||
|
||||
for (let i = 0; i < SAMPLE_COUNT; i++) {
|
||||
templates.push(engine.parse(str))
|
||||
}
|
||||
const diff1 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
|
||||
console.log(`[todolist ${h(str.length)}][before GC] ${h(diff1)}/tpl (${SAMPLE_COUNT} runs sampled)`)
|
||||
|
||||
global.gc()
|
||||
const diff2 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
|
||||
console.log(`[todolist ${h(str.length)}][after GC] ${h(diff2)}/tpl (${SAMPLE_COUNT} runs sampled)`)
|
||||
}
|
||||
|
||||
function h (size) {
|
||||
return (size / 1024).toFixed(3) + ' KB'
|
||||
}
|
||||
|
||||
module.exports = { memory }
|
||||
Regular → Executable
+10
-7
@@ -1,10 +1,11 @@
|
||||
import * as Benchmark from 'benchmark'
|
||||
import Liquid from '../src/liquid'
|
||||
const Benchmark = require('benchmark')
|
||||
const { Liquid } = require('..')
|
||||
|
||||
const liquid = new Liquid()
|
||||
|
||||
export default function () {
|
||||
console.log('--- output ---')
|
||||
function output () {
|
||||
console.log(' output')
|
||||
console.log('------------------------')
|
||||
return new Promise(resolve => {
|
||||
new Benchmark.Suite('output')
|
||||
.add('literal', test('{{false}}{{"foo"}}{{32.322}}'))
|
||||
@@ -12,15 +13,17 @@ export default function () {
|
||||
.add('date', test('{{"now" | date: "%d%Y%m"}}'))
|
||||
.add('escape', test('{{"1<2" | escape}}'))
|
||||
.add('default', test('{{"" | default: 3}}'))
|
||||
.on('cycle', (event: any) => console.log(String(event.target)))
|
||||
.on('cycle', (event) => console.log(String(event.target)))
|
||||
.on('complete', resolve)
|
||||
.run({ 'async': true })
|
||||
})
|
||||
}
|
||||
|
||||
function test (str: string) {
|
||||
function test (str) {
|
||||
return {
|
||||
defer: true,
|
||||
fn: (d: any) => liquid.parseAndRender(str).then(x => d.resolve(x))
|
||||
fn: d => liquid.parseAndRender(str).then(x => d.resolve(x))
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { output }
|
||||
Generated
+3380
File diff suppressed because it is too large
Load Diff
Executable
+23
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "benchmark",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node --expose-gc index",
|
||||
"engines": "node -e 'require(\"./cross-engines\").crossEngines()'"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.14",
|
||||
"@babel/preset-env": "^7.13.12",
|
||||
"@babel/preset-react": "^7.13.13",
|
||||
"handlebars": "^4.7.7",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"require-from-string": "^2.0.2",
|
||||
"swig": "^1.4.2"
|
||||
}
|
||||
}
|
||||
Regular → Executable
+10
-7
@@ -1,10 +1,11 @@
|
||||
import * as Benchmark from 'benchmark'
|
||||
import Liquid from '../src/liquid'
|
||||
const Benchmark = require('benchmark')
|
||||
const { Liquid } = require('..')
|
||||
|
||||
const liquid = new Liquid()
|
||||
|
||||
export default function () {
|
||||
console.log('--- tag ---')
|
||||
function tag () {
|
||||
console.log(' tag')
|
||||
console.log('------------------------')
|
||||
return new Promise(resolve => {
|
||||
new Benchmark.Suite('tag')
|
||||
.add('if', test('{% if "foobar" %}foo{% endif %}'))
|
||||
@@ -16,15 +17,17 @@ export default function () {
|
||||
.add('increment', test('{%increment a%}'))
|
||||
.add('decrement', test('{%decrement a%}'))
|
||||
.add('tablerow', test('{%tablerow i in (1..10) cols:3%}{%endtablerow%}'))
|
||||
.on('cycle', (event: any) => console.log(String(event.target)))
|
||||
.on('cycle', (event) => console.log(String(event.target)))
|
||||
.on('complete', resolve)
|
||||
.run({ 'async': true })
|
||||
})
|
||||
}
|
||||
|
||||
function test (str: string) {
|
||||
function test (str) {
|
||||
return {
|
||||
defer: true,
|
||||
fn: (d: any) => liquid.parseAndRender(str).then(x => d.resolve(x))
|
||||
fn: d => liquid.parseAndRender(str).then(x => d.resolve(x))
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { tag }
|
||||
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<!-- You may use a different charset if needed -->
|
||||
|
||||
<title>Latin Lipsum - Courtesy generator.lorem-ipsum.info</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Lorem ipsum dolor sit amet, falli detraxit facilisis sit ex. Nec vidit nihil ut, vis utamur definitionem in. Ancillae phaedrum ut eos. Ne eam errem cotidieque.
|
||||
</p>
|
||||
<p>
|
||||
Sit amet vitae referrentur ad, oportere necessitatibus vituperatoribus vim ne. Audiam quaeque nusquam ei eos, mel ex adhuc prompta complectitur. Decore voluptua cotidieque vel ei, veri novum persecuti te sea. Nisl novum sea cu. Dicta delicatissimi ut est. Et has eripuit impedit mediocrem.
|
||||
</p>
|
||||
<p>
|
||||
Eu vim evertitur argumentum, pro legendos iudicabit voluptatibus ne. Ne alii nullam deserunt duo, vis no animal verterem. Ne quo veniam euripidis. Pri discere mentitum vituperatoribus ne. Meliore corrumpit vim at, has ea admodum convenire.
|
||||
</p>
|
||||
<p>
|
||||
Ne mea alii detraxit electram, his ne epicurei gloriatur consetetur. Ex pro aeque omnes appareat, possit integre accommodare eu quo. Qui in porro molestiae, no sit equidem petentium patrioque, omnes voluptaria vim te. Odio quot rebum ad sed, ei sale reque inani sea.
|
||||
</p>
|
||||
<p>
|
||||
At mea vidit petentium, mei lorem pertinacia signiferumque ne. Per eu dicam postea probatus, sea pericula accusamus omittantur ad. Id mei munere ullamcorper. Oportere ocurreret cu vel. Pri ne dicant soluta graecis, duis ponderum corrumpit sed eu, pro ei rebum vivendum.
|
||||
</p>
|
||||
<p>
|
||||
Eum ea exerci sententiae constituam, ut lorem putant volutpat pro. Vix ex iudicabit salutatus principes, pri nisl erat ut, ne cum persius verterem phaedrum. Vix mundi vitae eu. Vel summo vocent albucius in. Qui omnis partem possim ex, wisi doctus efficiantur cu has. Aperiri denique ea pri, cum dissentias signiferumque eu. Per posse dissentiet necessitatibus id, omnis eleifend te mel.
|
||||
</p>
|
||||
<p>
|
||||
Phaedrum erroribus adolescens ut nec, duo mutat viris id. In tale purto dolores sit, ei consul inermis est, his ea movet expetenda. Cibo scribentur id eam, per an quem iracundia, has erat zril solet eu. Falli fierent ne cum, eam placerat facilisis suscipiantur te. Id quo dicat tractatos definiebas, est copiosae splendide id.
|
||||
</p>
|
||||
<p>
|
||||
Constituto neglegentur qui ne, eum ne putent phaedrum, no quod nominati consulatu per. Mei cu accusam principes interesset, vim fugit abhorreant eu, ludus feugait an sed. Clita expetendis definitionem has in, meis pericula no mea, soluta nemore cotidieque eos cu. Summo populo signiferumque pri eu, eum no labores democritum posidonium, pro ignota adipisci in. Tollit molestie id mei.
|
||||
</p>
|
||||
<p>
|
||||
Ipsum impetus et eam, ei his epicuri instructior. Impedit ullamcorper vim an. Impedit ullamcorper vim an. Et eum senserit sententiae reprimique, quem detracto sententiae at sed, no inermis ocurreret rationibus sea pericula no.
|
||||
|
||||
</body></html>
|
||||
@@ -0,0 +1 @@
|
||||
<img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{{id}}.png">
|
||||
@@ -0,0 +1 @@
|
||||
<img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{{id}}.png">
|
||||
@@ -0,0 +1 @@
|
||||
<img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{{todo.id}}.png">
|
||||
@@ -0,0 +1,44 @@
|
||||
<section class="todo-list">
|
||||
<h1>
|
||||
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
|
||||
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
|
||||
neque luctus tincidunt. Duis interdum tempus elit.
|
||||
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
|
||||
</h1>
|
||||
<a href={{url "/add"}} class="todo-add"><i class="fa fa-plus-square"></i>Add Todo</a>
|
||||
<ul class="filter-category">
|
||||
{{#each categories }}
|
||||
<li style="background: {{ color }}">
|
||||
<a href="/todos/category/{{ id }}">{{ title }}</a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{#each todos }}
|
||||
<div>
|
||||
<h2>
|
||||
Todo {{inc @index}}:
|
||||
<span class="todo-item content" data-todo-index="{{@index}}">
|
||||
{{ upcase (concat 'TODO: ' title) }}
|
||||
</span>
|
||||
</h2>
|
||||
{{> todo-icon id=id }}
|
||||
|
||||
<p class="description">
|
||||
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
|
||||
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
|
||||
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
|
||||
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
|
||||
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
|
||||
</p>
|
||||
|
||||
<div class="todo-meta">
|
||||
{{# if category }}
|
||||
<span>{{ capitalize category }}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<a class="btn btn-primary" href={{ url (concat "/edit/" id) }}><i class="fa fa-pencil"></i> Edit</a>
|
||||
<a class="btn btn-default"><i class="fa fa-check"></i> Check</a>
|
||||
<a class="btn ben-danger" href={{ url (concat "/delete/" id) }}><i class="fa fa-trash-o"</i> Trash</a>
|
||||
</div>
|
||||
{{/each}}
|
||||
</section>
|
||||
@@ -0,0 +1,57 @@
|
||||
// eslint-disable-next-line
|
||||
const React = require('react')
|
||||
|
||||
function capitalize (str) {
|
||||
return str[0].toUpperCase() + str.slice(1).toLowerCase()
|
||||
}
|
||||
function url (path) {
|
||||
return `http://example.com${path}`
|
||||
}
|
||||
function renderTodoIcon (id) {
|
||||
return <img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{id}.png"/>
|
||||
}
|
||||
|
||||
module.exports = ({ categories, todos }) => {
|
||||
return <section className="todo-list">
|
||||
<h1>
|
||||
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
|
||||
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
|
||||
neque luctus tincidunt. Duis interdum tempus elit.
|
||||
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
|
||||
</h1>
|
||||
<a href={url('/add')} className="todo-add"><i className="fa fa-plus-square"></i>Add Todo</a>
|
||||
<ul className="filter-category">
|
||||
{categories.map((item, i) => {
|
||||
return <li key={i} style={{ background: item.color }}>
|
||||
<a href={'/todos/category/' + item.id }>{ item.title }</a>
|
||||
</li>
|
||||
})}
|
||||
</ul>
|
||||
{todos.map((todo, index0) => {
|
||||
return <div key={index0}>
|
||||
<h2>
|
||||
Todo { index0 + 1 }:
|
||||
<span className="todo-item content" data-todo-index="{{ forloop.index0 }}">
|
||||
{ ('TODO: ' + todo.title).toUpperCase() }
|
||||
</span>
|
||||
</h2>
|
||||
{ renderTodoIcon(todo.id) }
|
||||
|
||||
<p className="description">
|
||||
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
|
||||
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
|
||||
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
|
||||
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
|
||||
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
|
||||
</p>
|
||||
|
||||
<div className="todo-meta">
|
||||
{ todo.category ? <span>{capitalize(todo.category)}</span> : '' }
|
||||
</div>
|
||||
<a className="btn btn-primary" href={url('/edit/' + todo.id)}><i className="fa fa-pencil"></i> Edit</a>
|
||||
<a className="btn btn-default"><i className="fa fa-check"></i> Check</a>
|
||||
<a className="btn ben-danger" href={url('/delete/' + todo.id)}><i className="fa fa-trash-o"></i> Trash</a>
|
||||
</div>
|
||||
})}
|
||||
</section>
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<section class="todo-list">
|
||||
<h1>
|
||||
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
|
||||
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
|
||||
neque luctus tincidunt. Duis interdum tempus elit.
|
||||
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
|
||||
</h1>
|
||||
<a href={{"/add" | url}} class="todo-add"><i class="fa fa-plus-square"></i>Add Todo</a>
|
||||
<ul class="filter-category">
|
||||
{% for item in categories %}
|
||||
<li style="background: {{ item.color }}">
|
||||
<a href="/todos/category/{{ item.id }}">{{ item.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% for todo in todos %}
|
||||
<div>
|
||||
<h2>
|
||||
Todo {{ forloop.index }}:
|
||||
<span class="todo-item content" data-todo-index="{{ forloop.index0 }}">
|
||||
{{ todo.title | prepend: 'TODO: ' | upcase }}
|
||||
</span>
|
||||
</h2>
|
||||
{% render "todo-icon", id:todo.id %}
|
||||
|
||||
<p class="description">
|
||||
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
|
||||
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
|
||||
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
|
||||
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
|
||||
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
|
||||
</p>
|
||||
|
||||
<div class="todo-meta">
|
||||
{% if todo.category %}
|
||||
<span>{{ todo.category | capitalize }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a class="btn btn-primary" href={{"/edit/" | append: todo.id | url }}><i class="fa fa-pencil"></i> Edit</a>
|
||||
<a class="btn btn-default"><i class="fa fa-check"></i> Check</a>
|
||||
<a class="btn ben-danger" href={{"/delete/" | append: todo.id | url }}><i class="fa fa-trash-o"</i> Trash</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
@@ -0,0 +1,44 @@
|
||||
<section class="todo-list">
|
||||
<h1>
|
||||
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
|
||||
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
|
||||
neque luctus tincidunt. Duis interdum tempus elit.
|
||||
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
|
||||
</h1>
|
||||
<a href={{"/add" | url}} class="todo-add"><i class="fa fa-plus-square"></i>Add Todo</a>
|
||||
<ul class="filter-category">
|
||||
{% for item in categories %}
|
||||
<li style="background: {{ item.color }}">
|
||||
<a href="/todos/category/{{ item.id }}">{{ item.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% for todo in todos %}
|
||||
<div>
|
||||
<h2>
|
||||
Todo {{ loop.index }}:
|
||||
<span class="todo-item content" data-todo-index="{{ loop.index0 }}">
|
||||
{{ todo.title | prepend('TODO: ') | upcase }}
|
||||
</span>
|
||||
</h2>
|
||||
{% include "todo-icon.swig" %}
|
||||
|
||||
<p class="description">
|
||||
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
|
||||
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
|
||||
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
|
||||
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
|
||||
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
|
||||
</p>
|
||||
|
||||
<div class="todo-meta">
|
||||
{% if todo.category %}
|
||||
<span>{{ todo.category | capitalize }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a class="btn btn-primary" href={{"/edit/" | append(todo.id) | url }}><i class="fa fa-pencil"></i> Edit</a>
|
||||
<a class="btn btn-default"><i class="fa fa-check"></i> Check</a>
|
||||
<a class="btn ben-danger" href={{"/delete/" | append(todo.id) | url }}><i class="fa fa-trash-o"</i> Trash</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</section>
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"extends": ["standard"],
|
||||
"env": {
|
||||
"mocha": true,
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"plugins": [
|
||||
"mocha",
|
||||
"standard",
|
||||
"promise"
|
||||
],
|
||||
"rules": {
|
||||
"no-var": 2,
|
||||
"prefer-const": 2,
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"no-unused-vars": "off",
|
||||
"indent": "off"
|
||||
}
|
||||
}
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
rm -rf docs/source/api docs/source/zh-cn/api
|
||||
typedoc ./src --gitRevision master --out docs/source/api --plugin typedoc-plugin-markdown --ignoreCompilerErrors true --theme vuepress
|
||||
rm docs/source/api/README.md
|
||||
|
||||
for file in $(find docs/source/api -name "*.md"); do
|
||||
sed -i \
|
||||
-e 's/\(\]([^_)]*\)\/_/\1\//g' \
|
||||
-e 's/\(\]([^)]*\.\)md/\1html/g' \
|
||||
-e 's/\](_/\](/g' \
|
||||
-e '1 s/"/\"/g' \
|
||||
-e '1 s/</\</g' \
|
||||
-e '1 s/>/\>/g' \
|
||||
-e '1 s/\*//g' \
|
||||
-e '1 s/^# \(.*\)/---\ntitle: "\1"\nauto: true\n---/' \
|
||||
$file
|
||||
target=${file/\/_/\/}
|
||||
cat $file | ./bin/escape-nunjucks.js > $target
|
||||
done
|
||||
|
||||
cp -r docs/source/api docs/source/zh-cn/api
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd docs
|
||||
cp ../CHANGELOG.md source/tutorials/changelog.md
|
||||
sed -i \
|
||||
-e 's/{%/{% raw %}{%{% endraw %}/g' \
|
||||
-e 's/{{/{% raw %}{{{% endraw %}/g' \
|
||||
-e '1 s/"/\"/g' \
|
||||
-e '1 s/</\</g' \
|
||||
-e '1 s/>/\>/g' \
|
||||
source/tutorials/changelog.md
|
||||
cp source/tutorials/changelog.md source/zh-cn/tutorials/changelog.md
|
||||
|
||||
sed -i '1i ---\ntitle: Changelog\nauto: true\n---\n' source/tutorials/changelog.md
|
||||
sed -i '1i ---\ntitle: 更新日志\nauto: true\n---\n' source/zh-cn/tutorials/changelog.md
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cp .all-contributorsrc docs/.all-contributorsrc
|
||||
sed -i \
|
||||
-e 's/README.md/docs\/themes\/navy\/layout\/partial\/all-contributors.swig/g' \
|
||||
-e 's/"contributorsPerLine": 7/"contributorsPerLine": 65535/g' \
|
||||
docs/.all-contributorsrc
|
||||
|
||||
all-contributors --config docs/.all-contributorsrc generate
|
||||
sed -i 's/<br \/>.*<\/td>/<\/a><\/td>/g' docs/themes/navy/layout/partial/all-contributors.swig
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
./bin/build-contributors.sh
|
||||
./bin/build-apidoc.sh
|
||||
./bin/build-changelog.sh
|
||||
|
||||
cd docs
|
||||
npm ci
|
||||
npm run build
|
||||
cp CNAME public/
|
||||
|
||||
if [ "$HEXO_ALGOLIA_INDEXING_KEY" != "" ]; then
|
||||
npm run index
|
||||
fi
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Prerequisites:
|
||||
# 1.imagemagick. try brew install imagemagick
|
||||
# 2. logo.png in size 512x512
|
||||
# 3. this script should be run with cwd docs/source/icon/
|
||||
|
||||
echo creating apple touch icons...
|
||||
apple=(57x57 60x60 72x72 76x76 114x114 120x120 144x144 152x152)
|
||||
for size in "${apple[@]}"; do
|
||||
echo $size
|
||||
convert logo.png -resize $size apple-touch-icon-$size.png
|
||||
done
|
||||
cp logo.png apple-touch-icon.png
|
||||
convert logo.png \
|
||||
\( +clone -alpha extract \
|
||||
-draw 'fill black polygon 0,0 0,80 80,0 fill white circle 80,80 80,0' \
|
||||
\( +clone -flip \) -compose Multiply -composite \
|
||||
\( +clone -flop \) -compose Multiply -composite \
|
||||
\) -alpha off -compose CopyOpacity -composite apple-touch-icon-precomposed.png
|
||||
|
||||
echo creating favicon...
|
||||
convert logo.png -resize 48x48 ../favicon.ico
|
||||
favicon=(16x16 32x32 96x96 160x160 196x196)
|
||||
for size in "${favicon[@]}"; do
|
||||
echo $size
|
||||
convert logo.png -resize $size favicon-$size.png
|
||||
done
|
||||
|
||||
echo creating mstile icons...
|
||||
mstile=(70x70 144x144 150x150 310x310)
|
||||
for size in "${mstile[@]}"; do
|
||||
echo $size
|
||||
convert logo.png -resize $size mstile-$size.png
|
||||
done
|
||||
convert mstile-150x150.png -gravity center -background white -extent 310x150 mstile-310x150.png
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const isQuote = c => c === '"' || c === "'"
|
||||
const isOperator = c => '!=<>'.includes(c)
|
||||
const isNumber = c => c >= '0' && c <= '9'
|
||||
const isCharacter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
|
||||
const isIdentifier = c => '_-?'.includes(c) || isCharacter(c) || isNumber(c)
|
||||
const isBlank = c => c === '\n' || c === '\t' || c === ' ' || c === '\r' || c === '\v' || c === '\f'
|
||||
const isInlineBlank = c => c === '\t' || c === ' ' || c === '\r'
|
||||
const isSign = c => c === '-' || c === '+'
|
||||
// See https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp
|
||||
const unicodeBlanks = '\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000'
|
||||
|
||||
const types = []
|
||||
for (let i = 0; i < 128; i++) {
|
||||
const c = String.fromCharCode(i)
|
||||
let n = 0
|
||||
if (isIdentifier(c)) n |= 1
|
||||
if (isOperator(c)) n |= 2
|
||||
if (isBlank(c)) n |= 4
|
||||
if (isQuote(c)) n |= 8
|
||||
if (isInlineBlank(c)) n |= 16
|
||||
if (isNumber(c)) n |= 32
|
||||
if (isSign(c)) n |= 64
|
||||
types.push(n)
|
||||
}
|
||||
|
||||
console.log(`
|
||||
// **DO NOT CHANGE THIS FILE**
|
||||
//
|
||||
// This file is generated by bin/character-gen.js
|
||||
// bitmask character types to boost performance
|
||||
export const TYPES = [${types.join(', ')}]
|
||||
export const IDENTIFIER = 1
|
||||
export const OPERATOR = 2
|
||||
export const BLANK = 4
|
||||
export const QUOTE = 8
|
||||
export const INLINE_BLANK = 16
|
||||
export const NUMBER = 32
|
||||
export const SIGN = 64
|
||||
`.trim())
|
||||
|
||||
console.log([...unicodeBlanks].map(char => `TYPES[${char.charCodeAt(0)}]`).join(' = ') + ' = BLANK')
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// In Hexo, content inside markdown code/code fences,
|
||||
// will not go through nunjucks.
|
||||
// So we're escaping special chars outside code only.
|
||||
let backTick = 0
|
||||
process.stdin.on('data', (buffer) => {
|
||||
for (const c of buffer.toString()) {
|
||||
if (c === '`') {
|
||||
backTick++
|
||||
}
|
||||
const shouldEscape = '{%%}'.includes(c) && backTick % 2 === 0
|
||||
if (shouldEscape) {
|
||||
const code = c.charCodeAt(0).toString(16)
|
||||
process.stdout.write(`&#x${code};`)
|
||||
} else process.stdout.write(c)
|
||||
}
|
||||
})
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const Liquid = require('..').Liquid
|
||||
const contextArg = process.argv.slice(2)[0]
|
||||
let context = {}
|
||||
|
||||
if (contextArg) {
|
||||
if (contextArg.endsWith('.json')) {
|
||||
const fs = require('fs')
|
||||
context = JSON.parse(fs.readFileSync(contextArg, 'utf8'))
|
||||
} else {
|
||||
context = JSON.parse(contextArg)
|
||||
}
|
||||
}
|
||||
|
||||
let tpl = ''
|
||||
process.stdin.on('data', chunk => (tpl += chunk))
|
||||
process.stdin.on('end', () => render(tpl))
|
||||
|
||||
async function render (tpl) {
|
||||
const liquid = new Liquid()
|
||||
const html = await liquid.parseAndRender(tpl, context)
|
||||
process.stdout.write(html)
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION_LATEST=$(cat package.json | grep '"version":' | awk -F'"' '{print $4}')
|
||||
FILE_LOCAL=dist/liquid.node.cjs.js
|
||||
FILE_LATEST=dist/liquid.node.cjs.$VERSION_LATEST.js
|
||||
URL_LATEST=https://unpkg.com/liquidjs@$VERSION_LATEST/dist/liquid.node.cjs.js
|
||||
|
||||
if [ ! -f $FILE_LATEST ]; then
|
||||
curl $URL_LATEST > $FILE_LATEST
|
||||
fi
|
||||
|
||||
# if [ ! -f $FILE_LOCAL ]; then
|
||||
BUNDLES=cjs npm run build:dist
|
||||
# fi
|
||||
|
||||
exec node benchmark/diff.js $FILE_LOCAL $FILE_LATEST
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = { extends: ['@commitlint/config-conventional'] }
|
||||
@@ -0,0 +1,9 @@
|
||||
# LiquidJS for Browsers
|
||||
|
||||
## Get Started
|
||||
|
||||
```bash
|
||||
cd demo/browser
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
@@ -1 +0,0 @@
|
||||
<h2>Welcome to {{ name | capitalize}}, {% include 'date.html' %}</h2>
|
||||
@@ -3,27 +3,24 @@
|
||||
|
||||
<head>
|
||||
<title>liquidjs for the browser</title>
|
||||
<script src="node_modules/liquidjs/dist/liquid.min.js"></script>
|
||||
<script src="node_modules/liquidjs/dist/liquid.browser.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
var engine = new window.Liquid({
|
||||
var Liquid = window.liquidjs.Liquid
|
||||
var engine = new Liquid({
|
||||
extname: '.html',
|
||||
cache: true
|
||||
});
|
||||
var src = '<h2>Welcome to {{ name | capitalize}}, ' +
|
||||
'access time: {{date|date: "%Y-%m-%d %H:%M:%S"}}</h2>';
|
||||
var src = "<h2>Welcome to {{ name | capitalize}}, {% include 'date.html' %}</h2>";
|
||||
var ctx = {
|
||||
name: 'Liquid',
|
||||
date: new Date()
|
||||
};
|
||||
engine.parseAndRender(src, ctx)
|
||||
.then(function(html) {
|
||||
return engine.renderFile('hello', ctx);
|
||||
})
|
||||
.then(function(html) {
|
||||
document.body.innerHTML += html
|
||||
document.body.innerHTML = html
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Generated
-220
@@ -1,220 +0,0 @@
|
||||
{
|
||||
"name": "liquidjs-demo-browser",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"async": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
|
||||
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
|
||||
"dev": true
|
||||
},
|
||||
"colors": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
|
||||
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
|
||||
"dev": true
|
||||
},
|
||||
"corser": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
|
||||
"integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=",
|
||||
"dev": true
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.1"
|
||||
}
|
||||
},
|
||||
"ecstatic": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.1.tgz",
|
||||
"integrity": "sha512-/rrctvxZ78HMI/tPIsqdvFKHHscxR3IJuKrZI2ZoUgkt2SiufyLFBmcco+aqQBIu6P1qBsUNG3drAAGLx80vTQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"he": "1.2.0",
|
||||
"mime": "1.6.0",
|
||||
"minimist": "1.2.0",
|
||||
"url-join": "2.0.5"
|
||||
}
|
||||
},
|
||||
"eventemitter3": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz",
|
||||
"integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==",
|
||||
"dev": true
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz",
|
||||
"integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "3.2.6"
|
||||
}
|
||||
},
|
||||
"he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"dev": true
|
||||
},
|
||||
"http-proxy": {
|
||||
"version": "1.17.0",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz",
|
||||
"integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"eventemitter3": "3.1.0",
|
||||
"follow-redirects": "1.7.0",
|
||||
"requires-port": "1.0.0"
|
||||
}
|
||||
},
|
||||
"http-server": {
|
||||
"version": "0.11.1",
|
||||
"resolved": "https://registry.npmjs.org/http-server/-/http-server-0.11.1.tgz",
|
||||
"integrity": "sha512-6JeGDGoujJLmhjiRGlt8yK8Z9Kl0vnl/dQoQZlc4oeqaUoAKQg94NILLfrY3oWzSyFaQCVNTcKE5PZ3cH8VP9w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"colors": "1.0.3",
|
||||
"corser": "2.0.1",
|
||||
"ecstatic": "3.3.1",
|
||||
"http-proxy": "1.17.0",
|
||||
"opener": "1.4.3",
|
||||
"optimist": "0.6.1",
|
||||
"portfinder": "1.0.20",
|
||||
"union": "0.4.6"
|
||||
}
|
||||
},
|
||||
"liquidjs": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-7.0.0.tgz",
|
||||
"integrity": "sha512-/JL+VQUI++6iCS7JQ4fPPeji6vyvHCU/iuz2bLSiE0tn0eO3kf8GEyfaXnQUHSroy8SmJu7HQIvjvOErtYEvUg=="
|
||||
},
|
||||
"mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"dev": true
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
|
||||
"dev": true
|
||||
},
|
||||
"opener": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz",
|
||||
"integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=",
|
||||
"dev": true
|
||||
},
|
||||
"optimist": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
|
||||
"integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.10",
|
||||
"wordwrap": "0.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
|
||||
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"portfinder": {
|
||||
"version": "1.0.20",
|
||||
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.20.tgz",
|
||||
"integrity": "sha512-Yxe4mTyDzTd59PZJY4ojZR8F+E5e97iq2ZOHPz3HDgSvYC5siNad2tLooQ5y5QHyQhc3xVqvyk/eNA3wuoa7Sw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"async": "1.5.2",
|
||||
"debug": "2.6.9",
|
||||
"mkdirp": "0.5.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"qs": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz",
|
||||
"integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=",
|
||||
"dev": true
|
||||
},
|
||||
"requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
|
||||
"dev": true
|
||||
},
|
||||
"union": {
|
||||
"version": "0.4.6",
|
||||
"resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz",
|
||||
"integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"qs": "2.3.3"
|
||||
}
|
||||
},
|
||||
"url-join": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz",
|
||||
"integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=",
|
||||
"dev": true
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
|
||||
"integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "liquidjs-demo-browser",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Liquidjs Demo for Browser Usage",
|
||||
"main": "index.html",
|
||||
"scripts": {
|
||||
@@ -8,10 +9,8 @@
|
||||
},
|
||||
"author": "harttle <[email protected]>",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"http-server": "^0.11.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"liquidjs": "^7.0.0"
|
||||
"http-server": "^0.11.1",
|
||||
"liquidjs": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# LiquidJS for Express.js
|
||||
|
||||
## Get Started
|
||||
|
||||
```bash
|
||||
cd demo/express
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
const express = require('express')
|
||||
const Liquid = require('../..')
|
||||
const { Liquid } = require('liquidjs')
|
||||
|
||||
const app = express()
|
||||
const engine = new Liquid({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "express-demo",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Express Demo Using liquidjs",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -10,6 +11,7 @@
|
||||
"author": "harttle",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"express": "^4.14.0"
|
||||
"express": "^4.14.0",
|
||||
"liquidjs": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# LiquidJS for Node.js
|
||||
|
||||
## Get Started
|
||||
|
||||
```bash
|
||||
cd demo/nodejs
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
+25
-10
@@ -1,8 +1,14 @@
|
||||
const Liquid = require('liquidjs')
|
||||
const { Liquid } = require('liquidjs')
|
||||
|
||||
const engine = new Liquid({
|
||||
extname: '.liquid',
|
||||
globals: { title: 'LiquidJS Demo' },
|
||||
// root files for `.render()` and `.parse()`
|
||||
root: __dirname,
|
||||
extname: '.liquid'
|
||||
// layout files for `{% layout %}`
|
||||
layouts: './layouts',
|
||||
// partial files for `{% include %}` and `{% render %}`
|
||||
partials: './partials'
|
||||
})
|
||||
|
||||
engine.registerTag('header', {
|
||||
@@ -10,17 +16,26 @@ engine.registerTag('header', {
|
||||
const [key, val] = token.args.split(':')
|
||||
this[key] = val
|
||||
},
|
||||
render: function (scope, hash) {
|
||||
const title = this.liquid.evalValue(this.content, scope)
|
||||
return `<h1>${title}</h1>`
|
||||
render: async function (scope, emitter) {
|
||||
const title = await this.liquid.evalValue(this.content, scope)
|
||||
emitter.write(`<h1>${title}</h1>`)
|
||||
}
|
||||
})
|
||||
|
||||
const ctx = {
|
||||
todos: ['fork and clone', 'make it better', 'make a pull request'],
|
||||
title: 'Welcome to liquidjs!'
|
||||
todos: ['fork and clone', 'make it better', 'make a pull request']
|
||||
}
|
||||
|
||||
engine.renderFile('todolist', ctx)
|
||||
.then(console.log)
|
||||
.catch(err => console.error(err.stack))
|
||||
async function main () {
|
||||
console.log('==========renderFile===========')
|
||||
const html = await engine.renderFile('todolist', ctx)
|
||||
console.log(html)
|
||||
|
||||
console.log('===========Streamed===========')
|
||||
const tpls = await engine.parseFile('todolist')
|
||||
engine.renderToNodeStream(tpls, ctx)
|
||||
.on('data', data => process.stdout.write(data))
|
||||
.on('end', () => console.log(''))
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<head><meta name="title" content="{{title}}"></head>
|
||||
<body>
|
||||
{% block %}{% endblock %}
|
||||
{% render "footer.liquid" %}
|
||||
</body>
|
||||
</html>
|
||||
Generated
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "Node.js demo for liquidjs",
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"liquidjs": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-7.0.0.tgz",
|
||||
"integrity": "sha512-/JL+VQUI++6iCS7JQ4fPPeji6vyvHCU/iuz2bLSiE0tn0eO3kf8GEyfaXnQUHSroy8SmJu7HQIvjvOErtYEvUg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "liquidjs-demo-nodejs",
|
||||
"description": "Node.js demo for liquidjs",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"liquidjs": "^7.0.0"
|
||||
"liquidjs": "^9.28.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<small>{{title}}</small>
|
||||
@@ -0,0 +1 @@
|
||||
<li>{{index}} - {{todo}}</li>
|
||||
@@ -1,7 +1,7 @@
|
||||
{%header content: "welcome to liquid" | capitalize%}
|
||||
|
||||
{% layout 'html.liquid' %}
|
||||
{%header content: title | capitalize%}
|
||||
<ul>
|
||||
{% for todo in todos %}
|
||||
<li>{{forloop.index}} - {{todo}}</li>
|
||||
{% render 'todo.liquid' with todo, index: forloop.index%}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</ul>
|
||||
@@ -0,0 +1 @@
|
||||
SKIP_PREFLIGHT_CHECK=true
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["react-app"]
|
||||
}
|
||||
Generated
-16737
File diff suppressed because it is too large
Load Diff
@@ -3,10 +3,8 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"dns": "^0.2.2",
|
||||
"html-react-parser": "^0.4.7",
|
||||
"liquidjs": "^6.0.1",
|
||||
"path": "^0.12.7",
|
||||
"liquidjs": "^9.1.0",
|
||||
"react": "^16.5.2",
|
||||
"react-dom": "^16.5.2",
|
||||
"react-promise": "^2.0.3",
|
||||
@@ -18,13 +16,13 @@
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
]
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.7"
|
||||
}
|
||||
}
|
||||
|
||||
+9
-32
@@ -1,38 +1,17 @@
|
||||
import React, { Component } from 'react';
|
||||
import logo from './logo.svg';
|
||||
import './App.css';
|
||||
import tpl from './views/demo.liquid';
|
||||
import Parser from 'html-react-parser';
|
||||
import { engine } from './engine';
|
||||
|
||||
let path = require('path')
|
||||
let Liquid = require('liquidjs');
|
||||
export class App extends Component {
|
||||
async componentDidMount() {
|
||||
const html = await engine.renderFile(tpl.toString(), {name: 'alice', logo: logo })
|
||||
this.setState({ html }) // outputs "Alice"
|
||||
}
|
||||
|
||||
let config = require('./views/demo.liquid');
|
||||
let pageConfig = config.toString()
|
||||
|
||||
let Parser = require('html-react-parser');
|
||||
|
||||
class App extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
let engine = new Liquid({
|
||||
root: path.resolve(__dirname, 'views/'), // dirs to lookup layouts/includes
|
||||
extname: '.liquid' // the extname used for layouts/includes, defaults
|
||||
});
|
||||
|
||||
engine.registerFilter('image', d => {
|
||||
let img = `<img src="${d}" class="App-logo" alt="logo"></img>`;
|
||||
return img
|
||||
})
|
||||
|
||||
engine.renderFile(pageConfig, {name: 'alice', logo: logo })
|
||||
.then((htmlTemp) => {
|
||||
this.setState({ html: htmlTemp })
|
||||
}) // outputs "Alice"
|
||||
}
|
||||
|
||||
state = {
|
||||
html: []
|
||||
}
|
||||
state = { html: '' }
|
||||
|
||||
render() {
|
||||
return (
|
||||
@@ -42,5 +21,3 @@ state = {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* function Component with Hooks: Modify ./index.js to apply this file
|
||||
*/
|
||||
import React, { useState, useLayoutEffect } from 'react';
|
||||
import './App.css';
|
||||
import logo from './logo.svg';
|
||||
import tplsrc from './views/showing-click-times.liquid';
|
||||
import Parser from 'html-react-parser';
|
||||
import { engine } from './engine';
|
||||
import { Context } from './Context';
|
||||
import { ClickButton } from './ClickButton';
|
||||
|
||||
const fetchTpl = engine.getTemplate(tplsrc.toString())
|
||||
|
||||
export function App() {
|
||||
const [state, setState] = useState({
|
||||
logo: logo,
|
||||
name: 'alice',
|
||||
clickCount: 0,
|
||||
html: ''
|
||||
});
|
||||
|
||||
useLayoutEffect(() => {
|
||||
fetchTpl
|
||||
.then(tpl => engine.render(tpl, state))
|
||||
.then(html => setState({...state, html}))
|
||||
}, [state.clickCount])
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
{Parser(`${state.html}`)}
|
||||
<Context.Provider
|
||||
value={{
|
||||
count: () => setState({...state, clickCount: state.clickCount + 1})
|
||||
}}
|
||||
>
|
||||
<ClickButton/>
|
||||
</Context.Provider>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
button {
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
bottom: 20px;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import './ClickButton.css';
|
||||
import React from 'react';
|
||||
import { Context } from './Context';
|
||||
|
||||
export function ClickButton() {
|
||||
return (
|
||||
<Context.Consumer>
|
||||
{context => (
|
||||
<button onClick={context.count}>
|
||||
Click Here!
|
||||
</button>
|
||||
)}
|
||||
</Context.Consumer>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
import React from "react";
|
||||
|
||||
export const Context = React.createContext()
|
||||
@@ -0,0 +1,12 @@
|
||||
import path from 'path';
|
||||
import { Liquid } from 'liquidjs';
|
||||
|
||||
export const engine = new Liquid({
|
||||
root: path.resolve(__dirname, 'views/'), // dirs to lookup layouts/includes
|
||||
extname: '.liquid' // the extname used for layouts/includes, defaults
|
||||
});
|
||||
|
||||
engine.registerFilter('image', d => {
|
||||
let img = `<img src="${d}" class="App-logo" alt="logo"></img>`;
|
||||
return img
|
||||
})
|
||||
@@ -1,8 +1,9 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
import { App } from './App';
|
||||
// import { App } from './AppWithHooks';
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<header className="App-header">
|
||||
{{ logo | image }}
|
||||
<h2>Welcome {{name | capitalize}}</h2>
|
||||
<p>Edit <code>src/App.js</code> and save to reload.</p>
|
||||
<p>You have clicked {{clickCount}} times.</p>
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://reactjs.org"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Learn React
|
||||
</a>
|
||||
</header>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
# LiquidJS for TypeScript
|
||||
|
||||
LiquidJS is written in TypeScript and type definitions are available in `liquidjs` package.
|
||||
|
||||
## Get Started
|
||||
|
||||
```bash
|
||||
cd demo/typescript
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
+24
-25
@@ -1,25 +1,24 @@
|
||||
import Liquid from 'liquidjs'
|
||||
|
||||
const engine = new Liquid({
|
||||
root: __dirname,
|
||||
extname: '.liquid'
|
||||
})
|
||||
|
||||
engine.registerTag('header', {
|
||||
parse: function (token) {
|
||||
const [key, val] = token.args.split(':')
|
||||
this[key] = val
|
||||
},
|
||||
render: function (scope, hash) {
|
||||
const title = this.liquid.evalValue(this['content'], scope)
|
||||
return `<h1>${title}</h1>`
|
||||
}
|
||||
})
|
||||
|
||||
const ctx = {
|
||||
todos: ['fork and clone', 'make it better', 'make a pull request'],
|
||||
title: 'Welcome to liquidjs!'
|
||||
}
|
||||
|
||||
// console.log('isTruthy:', isTruthy('a string here'));
|
||||
engine.renderFile('todolist', ctx).then(console.log)
|
||||
import { Liquid, TagToken, Context, Emitter } from 'liquidjs'
|
||||
|
||||
const engine = new Liquid({
|
||||
root: __dirname,
|
||||
extname: '.liquid'
|
||||
})
|
||||
|
||||
engine.registerTag('header', {
|
||||
parse: function (token: TagToken) {
|
||||
const [key, val] = token.args.split(':')
|
||||
this[key] = val
|
||||
},
|
||||
render: async function (context: Context, emitter: Emitter) {
|
||||
const title = await this.liquid.evalValue(this['content'], context)
|
||||
emitter.write(`<h1>${title}</h1>`)
|
||||
}
|
||||
})
|
||||
|
||||
const ctx = {
|
||||
todos: ['fork and clone', 'make it better', 'make a pull request'],
|
||||
title: 'Welcome to liquidjs!'
|
||||
}
|
||||
|
||||
engine.renderFile('todolist', ctx).then(console.log)
|
||||
|
||||
Generated
-8701
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,17 @@
|
||||
{
|
||||
"name": "liquidjs-demo-typescript",
|
||||
"private": true,
|
||||
"description": "TypeScript demo for liquidjs",
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"start": "ts-node index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"liquidjs": "^7.0.0"
|
||||
"liquidjs": "*",
|
||||
"ts-node": "^8.10.2",
|
||||
"typescript": "^4.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ts-node": "^8.0.2"
|
||||
"@types/node": "^14.14.37"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{%header content: "welcome to liquid" | capitalize%}
|
||||
{%header content: title | capitalize%}
|
||||
|
||||
<ul>
|
||||
{% for todo in todos %}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"types": [
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
.all-contributorsrc
|
||||
source/api/
|
||||
source/zh-cn/api/
|
||||
.vuepress
|
||||
db.json
|
||||
public
|
||||
changelog.md
|
||||
@@ -0,0 +1 @@
|
||||
liquidjs.com
|
||||
@@ -0,0 +1,38 @@
|
||||
title: LiquidJS
|
||||
subtitle: "A simple, expressive and safe template engine."
|
||||
description: "LiquidJS is a simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript."
|
||||
author: Harttle
|
||||
language:
|
||||
- en
|
||||
- zh-cn
|
||||
timezone: UTC
|
||||
|
||||
url: https://liquidjs.com
|
||||
root: /
|
||||
permalink: news/:year/:month/:day/:title/
|
||||
relative_link: true
|
||||
new_post_name: :year-:month-:day-:title.md # File name of new posts
|
||||
post_asset_folder: true
|
||||
per_page: 0
|
||||
pretty_urls:
|
||||
trailing_index: false
|
||||
trailing_html: false
|
||||
|
||||
theme: navy
|
||||
|
||||
highlight:
|
||||
enable: false
|
||||
prismjs:
|
||||
enable: true
|
||||
preprocess: true
|
||||
line_number: true
|
||||
tab_replace: ''
|
||||
|
||||
algolia:
|
||||
applicationID: 0X19J927JZ
|
||||
apiKey: 533161d821384919672e4ce8a39451b3
|
||||
indexName: liquidjs
|
||||
twitter: harttleharttle
|
||||
github: harttle/liquidjs
|
||||
patreon: harttle
|
||||
oc: liquidjs
|
||||
Generated
+9254
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "liquidjs-website",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"hexo": {
|
||||
"version": "5.4.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "hexo generate",
|
||||
"start": "hexo serve",
|
||||
"lint": "eslint .",
|
||||
"index": "hexo algolia"
|
||||
},
|
||||
"dependencies": {
|
||||
"cheerio": "^0.22.0",
|
||||
"hexo": "^5.4.0",
|
||||
"hexo-algolia": "^1.3.1",
|
||||
"hexo-clean-css": "^1.0.0",
|
||||
"hexo-filter-nofollow": "^2.0.2",
|
||||
"hexo-generator-archive": "^1.0.0",
|
||||
"hexo-generator-feed": "^2.0.0",
|
||||
"hexo-generator-sitemap": "^2.0.0",
|
||||
"hexo-renderer-marked": "^2.0.0",
|
||||
"hexo-renderer-pug": "^2.0.0",
|
||||
"hexo-renderer-stylus": "^1.0.0",
|
||||
"hexo-renderer-swig": "^1.1.0",
|
||||
"hexo-server": "^1.0.0",
|
||||
"hexo-uglify": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"all-contributors-cli": "^6.8.1",
|
||||
"eslint": "^6.0.1",
|
||||
"eslint-config-hexo": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict'
|
||||
|
||||
const { resolve, basename } = require('path')
|
||||
const { readFileSync } = require('fs')
|
||||
const cheerio = require('cheerio')
|
||||
const fullUrlFor = hexo.extend.helper.get('full_url_for').bind(hexo)
|
||||
|
||||
const localizedPath = ['tutorials', 'filters', 'tags', 'playground', 'api']
|
||||
|
||||
hexo.extend.helper.register('page_nav', function () {
|
||||
const type = this.page.canonical_path.split('/')[0]
|
||||
const sidebar = this.site.data.sidebar[type]
|
||||
const path = basename(this.path)
|
||||
const list = {}
|
||||
const prefix = 'sidebar.' + type + '.'
|
||||
|
||||
for (const i in sidebar) {
|
||||
if (typeof sidebar[i] === 'string') list[sidebar[i]] = i
|
||||
else for (const j in sidebar[i]) list[sidebar[i][j]] = j
|
||||
}
|
||||
|
||||
const keys = Object.keys(list)
|
||||
const index = keys.indexOf(path)
|
||||
let result = ''
|
||||
|
||||
if (index > 0) {
|
||||
result += `<a href="${keys[index - 1]}" class="article-footer-prev" title="${this.__(prefix + list[keys[index - 1]])}"><i class="icon-chevron-left"></i><span>${this.__('page.prev')}</span></a>`
|
||||
}
|
||||
|
||||
if (index < keys.length - 1) {
|
||||
result += `<a href="${keys[index + 1]}" class="article-footer-next" title="${this.__(prefix + list[keys[index + 1]])}"><span>${this.__('page.next')}</span><i class="icon-chevron-right"></i></a>`
|
||||
}
|
||||
|
||||
return result
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('raw', function (filepath) {
|
||||
const content = readFileSync(resolve(this.view_dir, filepath), 'utf8')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
return content
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('doc_sidebar', function (className) {
|
||||
const type = this.page.canonical_path.split('/')[0]
|
||||
const sidebar = this.site.data.sidebar[type]
|
||||
const path = basename(this.path)
|
||||
let result = ''
|
||||
const { __ } = this
|
||||
const prefix = 'sidebar.' + type + '.'
|
||||
|
||||
if (typeof sidebar === 'undefined') {
|
||||
return ''
|
||||
}
|
||||
|
||||
for (const [title, menu] of Object.entries(sidebar)) {
|
||||
if (typeof menu === 'string') renderLink(title, menu)
|
||||
else renderSection(title, menu)
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
function renderLink (text, link) {
|
||||
let itemClass = className + '-link'
|
||||
if (link === path) itemClass += ' current'
|
||||
|
||||
const localized = __(prefix + text) === prefix + text ? text : __(prefix + text)
|
||||
result += '<a href="' + link + '" class="' + itemClass + '">' + localized + '</a>'
|
||||
}
|
||||
|
||||
function renderSection (title, menu) {
|
||||
result += '<strong class="' + className + '-title">' + __(prefix + title) + '</strong>'
|
||||
for (const [text, link] of Object.entries(menu)) renderLink(text, link)
|
||||
}
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('header_menu', function (className) {
|
||||
const menu = this.site.data.menu
|
||||
let result = ''
|
||||
const lang = this.page.lang
|
||||
const isEnglish = lang === 'en'
|
||||
|
||||
for (const [title, path] of Object.entries(menu)) {
|
||||
let langPath = path
|
||||
if (!isEnglish && ~localizedPath.indexOf(title)) langPath = lang + path
|
||||
const url = this.url_for(langPath)
|
||||
const active = ('/' + this.page.canonical_path).slice(0, path.length) === path ? ' active' : ''
|
||||
result += `<a href="${url}" class="${className}-link${active}">${this.__('menu.' + title)}</a>`
|
||||
}
|
||||
|
||||
return result
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('canonical_url', function (lang) {
|
||||
let path = this.page.path
|
||||
if (lang && lang !== 'en') path = lang + '/' + path
|
||||
|
||||
return fullUrlFor(path)
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('url_for_lang', function (path) {
|
||||
const lang = this.page.lang
|
||||
let url = this.url_for(path)
|
||||
|
||||
if (lang !== 'en' && path[0] === '/') url = '/' + lang + path
|
||||
|
||||
return url
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('raw_link', path => `https://github.com/harttle/liquidjs/edit/master/docs/source/${path}`)
|
||||
|
||||
hexo.extend.helper.register('page_anchor', str => {
|
||||
const $ = cheerio.load(str, { decodeEntities: false })
|
||||
const headings = $('h1, h2, h3, h4, h5, h6')
|
||||
|
||||
if (!headings.length) return str
|
||||
|
||||
headings.each(function () {
|
||||
const id = $(this).attr('id')
|
||||
|
||||
$(this)
|
||||
.addClass('article-heading')
|
||||
.append(`<a class="article-anchor" href="#${id}" aria-hidden="true"></a>`)
|
||||
})
|
||||
|
||||
return $.html()
|
||||
})
|
||||
|
||||
// Will be replace with fullUrlFor after hexo v4 release
|
||||
hexo.extend.helper.register('canonical_path_for_nav', function () {
|
||||
const path = this.page.canonical_path
|
||||
for (const slug of localizedPath) if (path.startsWith(slug)) return path
|
||||
return ''
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('lang_name', function (lang) {
|
||||
const data = this.site.data.languages[lang]
|
||||
return data.name || data
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('hexo_version', function () {
|
||||
return this.env.version
|
||||
})
|
||||
@@ -0,0 +1,23 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.extend.tag.register('note', (args, text) => {
|
||||
const className = args.shift()
|
||||
let header = ''
|
||||
let result = ''
|
||||
|
||||
if (args.length) {
|
||||
header += `<strong class="note-title">${args.join(' ')}</strong>`
|
||||
}
|
||||
|
||||
result += `<blockquote class="note ${className}">${header}`
|
||||
result += hexo.render.renderSync({ text, engine: 'markdown' })
|
||||
result += '</blockquote>'
|
||||
|
||||
return result
|
||||
}, true)
|
||||
|
||||
hexo.extend.tag.register('since', (args, text) => {
|
||||
return `<p class="since">${text.trim()}</p>`
|
||||
}, true)
|
||||
@@ -0,0 +1,3 @@
|
||||
en: English
|
||||
zh-cn:
|
||||
name: 简体中文
|
||||
@@ -0,0 +1,5 @@
|
||||
tutorials: /tutorials/intro-to-liquid.html
|
||||
tags: /tags/overview.html
|
||||
filters: /filters/overview.html
|
||||
playground: /playground.html
|
||||
api: /api/classes/liquid_.liquid.html
|
||||
@@ -0,0 +1,24 @@
|
||||
-
|
||||
url: https://opencollective.com/liquidjs/#section-contribute
|
||||
date: '2020-02-26'
|
||||
title:
|
||||
zh-cn: '赞助人:第一个 backer 通过 Open Collective 贡献于 LiquidJS。'
|
||||
en: 'Backers: the first backer contributed to LiquidJS via Open Collective.'
|
||||
-
|
||||
url: https://github.com/harttle/liquidjs/pull/202
|
||||
date: '2020-03-11'
|
||||
title:
|
||||
zh-cn: '内存优化:用更精细的手法重写了解析器,来避免临时字符串的生成,内存占用降低 57.7% 以上。'
|
||||
en: 'Memory Optimization: a more elaborate parser reducing the memory footprint by 57.7%.'
|
||||
-
|
||||
url: https://github.com/harttle/liquidjs/pull/205
|
||||
date: '2020-03-15'
|
||||
title:
|
||||
zh-cn: '性能提升:引入 AST 并重新设计 Token 类型系统,使渲染性能平均提升 100.3%。'
|
||||
en: 'Performance Boost: a simple AST to improve render performance by 100.3%.'
|
||||
-
|
||||
url: https://github.com/harttle/liquidjs/milestone/3?closed=1
|
||||
date: '2021-09-30'
|
||||
title:
|
||||
zh-cn: '流式渲染:4 倍渲染速度,并增加了对流式渲染的支持。'
|
||||
en: 'Streamed Rendering: now render is 4x faster and support streamed rendering.'
|
||||
@@ -0,0 +1,146 @@
|
||||
tutorials:
|
||||
getting_started:
|
||||
intro: intro-to-liquid.html
|
||||
setup: setup.html
|
||||
options: options.html
|
||||
render_file: render-file.html
|
||||
partials: partials-and-layouts.html
|
||||
express: use-in-expressjs.html
|
||||
advanced:
|
||||
caching: caching.html
|
||||
registeration: register-filters-tags.html
|
||||
access_scope_in_filters: access-scope-in-filters.html
|
||||
parse_parameters: parse-parameters.html
|
||||
render_tag_content: render-tag-content.html
|
||||
sync_and_async: sync-and-async.html
|
||||
whitespace: whitespace-control.html
|
||||
plugins: plugins.html
|
||||
operators: operators.html
|
||||
truth: truthy-and-falsy.html
|
||||
miscellaneous:
|
||||
migration9: migrate-to-9.html
|
||||
changelog: changelog.html
|
||||
differences: differences.html
|
||||
contribution_guidelines: contribution-guidelines.html
|
||||
|
||||
filters:
|
||||
overview: overview.html
|
||||
abs: abs.html
|
||||
append: append.html
|
||||
at_least: at_least.html
|
||||
at_most: at_most.html
|
||||
capitalize: capitalize.html
|
||||
ceil: ceil.html
|
||||
compact: compact.html
|
||||
concat: concat.html
|
||||
date: date.html
|
||||
default: default.html
|
||||
divided_by: divided_by.html
|
||||
downcase: downcase.html
|
||||
escape: escape.html
|
||||
escape_once: escape_once.html
|
||||
first: first.html
|
||||
floor: floor.html
|
||||
join: join.html
|
||||
json: json.html
|
||||
last: last.html
|
||||
lstrip: lstrip.html
|
||||
map: map.html
|
||||
minus: minus.html
|
||||
modulo: modulo.html
|
||||
newline_to_br: newline_to_br.html
|
||||
plus: plus.html
|
||||
prepend: prepend.html
|
||||
remove: remove.html
|
||||
remove_first: remove_first.html
|
||||
replace: replace.html
|
||||
replace_first: replace_first.html
|
||||
reverse: reverse.html
|
||||
round: round.html
|
||||
rstrip: rstrip.html
|
||||
size: size.html
|
||||
slice: slice.html
|
||||
sort: sort.html
|
||||
sort_natural: sort_natural.html
|
||||
split: split.html
|
||||
strip: strip.html
|
||||
strip_html: strip_html.html
|
||||
strip_newlines: strip_newlines.html
|
||||
times: times.html
|
||||
truncate: truncate.html
|
||||
truncatewords: truncatewords.html
|
||||
uniq: uniq.html
|
||||
upcase: upcase.html
|
||||
url_decode: url_decode.html
|
||||
url_encode: url_encode.html
|
||||
where: where.html
|
||||
|
||||
tags:
|
||||
overview: overview.html
|
||||
assign: assign.html
|
||||
capture: capture.html
|
||||
case: case.html
|
||||
comment: comment.html
|
||||
cycle: cycle.html
|
||||
decrement: decrement.html
|
||||
echo: echo.html
|
||||
for: for.html
|
||||
if: if.html
|
||||
include: include.html
|
||||
increment: increment.html
|
||||
layout: layout.html
|
||||
liquid: liquid.html
|
||||
raw: raw.html
|
||||
render: render.html
|
||||
tablerow: tablerow.html
|
||||
unless: unless.html
|
||||
|
||||
api:
|
||||
quick_entry:
|
||||
Liquid: "../classes/liquid_.liquid.html"
|
||||
LiquidOptions: "../interfaces/liquid_options_.liquidoptions.html"
|
||||
FS: "../interfaces/fs_fs_.fs.html"
|
||||
Cache: "../interfaces/cache_cache_.cache.html"
|
||||
classes:
|
||||
BlankDrop: "../classes/drop_blank_drop_.blankdrop.html"
|
||||
Context: "../classes/context_context_.context.html"
|
||||
DelimitedToken: "../classes/tokens_delimited_token_.delimitedtoken.html"
|
||||
Drop: "../classes/drop_drop_.drop.html"
|
||||
EmptyDrop: "../classes/drop_empty_drop_.emptydrop.html"
|
||||
Expression: "../classes/render_expression_.expression.html"
|
||||
FilterToken: "../classes/tokens_filter_token_.filtertoken.html"
|
||||
ForloopDrop: "../classes/drop_forloop_drop_.forloopdrop.html"
|
||||
HTMLToken: "../classes/tokens_html_token_.htmltoken.html"
|
||||
HashToken: "../classes/tokens_hash_token_.hashtoken.html"
|
||||
LRU: "../classes/cache_lru_.lru.html"
|
||||
Liquid: "../classes/liquid_.liquid.html"
|
||||
LiteralToken: "../classes/tokens_literal_token_.literaltoken.html"
|
||||
NullDrop: "../classes/drop_null_drop_.nulldrop.html"
|
||||
NumberToken: "../classes/tokens_number_token_.numbertoken.html"
|
||||
OperatorToken: "../classes/tokens_operator_token_.operatortoken.html"
|
||||
OutputToken: "../classes/tokens_output_token_.outputtoken.html"
|
||||
ParseError: "../classes/util_error_.parseerror.html"
|
||||
ParseStream: "../classes/parser_parse_stream_.parsestream.html"
|
||||
Parser: "../classes/parser_parser_.parser.html"
|
||||
PropertyaccessToken: "../classes/tokens_property_access_token_.propertyaccesstoken.html"
|
||||
QuotedToken: "../classes/tokens_quoted_token_.quotedtoken.html"
|
||||
RangeToken: "../classes/tokens_range_token_.rangetoken.html"
|
||||
Render: "../classes/render_render_.render.html"
|
||||
RenderError: "../classes/util_error_.rendererror.html"
|
||||
TablerowloopDrop: "../classes/drop_tablerowloop_drop_.tablerowloopdrop.html"
|
||||
TagToken: "../classes/tokens_tag_token_.tagtoken.html"
|
||||
Token: "../classes/tokens_token_.token.html"
|
||||
TokenizationError: "../classes/util_error_.tokenizationerror.html"
|
||||
Tokenizer: "../classes/parser_tokenizer_.tokenizer.html"
|
||||
WordToken: "../classes/tokens_word_token_.wordtoken.html"
|
||||
enums:
|
||||
BlockMode: "../enums/context_block_mode_.blockmode.html"
|
||||
TokenKind: "../enums/parser_token_kind_.tokenkind.html"
|
||||
interfaces:
|
||||
Cache: "../interfaces/cache_cache_.cache.html"
|
||||
FilterImplOptions: "../interfaces/template_filter_filter_impl_options_.filterimploptions.html"
|
||||
FS: "../interfaces/fs_fs_.fs.html"
|
||||
LiquidOptions: "../interfaces/liquid_options_.liquidoptions.html"
|
||||
NormalizedFullOptions: "../interfaces/liquid_options_.normalizedfulloptions.html"
|
||||
PlainObject: "../interfaces/context_scope_.plainobject.html"
|
||||
TagImplOptions: "../interfaces/template_tag_tag_impl_options_.tagimploptions.html"
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="/icon/mstile-70x70.png"/>
|
||||
<square150x150logo src="/icon/mstile-150x150.png"/>
|
||||
<square310x310logo src="/icon/mstile-310x310.png"/>
|
||||
<wide310x150logo src="/icon/mstile-310x150.png"/>
|
||||
<TileColor>#2f83cd</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user