-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ end | |
gemspec | ||
|
||
gem "base64" | ||
gem "webrick" | ||
|
||
group :benchmark, :test do | ||
gem 'benchmark-ips' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,71 @@ | ||
<p>Hello world!</p> | ||
{% # theme-check-disable UnknownFilter, UndefinedObject %} | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Liquid filters playground</title> | ||
<script> | ||
setInterval(() => { | ||
fetch(window.location.href) | ||
.then(response => response.text()) | ||
.then(html => { | ||
const parser = new DOMParser(); | ||
const newDoc = parser.parseFromString(html, 'text/html'); | ||
const newBody = newDoc.body; | ||
document.body.innerHTML = newBody.innerHTML; | ||
}) | ||
.catch(error => console.error('Error updating content:', error)); | ||
}, 1000); | ||
</script> | ||
<style> | ||
body { | ||
zoom: 2; | ||
font-family: monospace | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<p>It is {{date}}</p> | ||
<h1> | ||
Liquid filters playground | ||
</h1> | ||
|
||
{{ products | map: "name" | json }} | ||
|
||
<p>Check out the <a href="/products">Products</a> screen </p> | ||
<h2> | ||
find | ||
</h2> | ||
<pre> | ||
{% assign product = products | find: "name", "Mountain boots" %} | ||
{{ product.name }} - {{ product.price.value }} | ||
|
||
{% assign product = products | find: "price.unit", "USD" %} | ||
{{ product.name }} - {{ product.price.value }} | ||
</pre> | ||
|
||
<h2> | ||
find_index | ||
</h2> | ||
<pre> | ||
{% assign index = products | find_index: "name", "Mountain boots" %} | ||
{{ index }} | ||
</pre> | ||
|
||
<h2> | ||
has | ||
</h2> | ||
<pre> | ||
{{ products | has: "name", "Mountain boots" }} | ||
</pre> | ||
|
||
|
||
<h2> | ||
reject | ||
</h2> | ||
<pre> | ||
{{ products | map: "name" | join: ", " }} | ||
{{ products | reject: "name", "Mountain boots" | map: "name" | join: ", " }} | ||
</pre> | ||
|
||
</body> | ||
</html> |