diff --git a/.gitignore b/.gitignore index f86209f36..24be3ed8d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ coverage/ node_modules/ # tmp -docs/public/js/liquid.browser.min.js +docs/themes/navy/source/js/liquid.browser.min.js docs/themes/navy/layout/partial/all-contributors.swig docs/themes/navy/layout/partial/financial-contributors.swig dist/ diff --git a/docs/scripts/prism-bash-extend.js b/docs/scripts/prism-bash-extend.js new file mode 100644 index 000000000..397f961ec --- /dev/null +++ b/docs/scripts/prism-bash-extend.js @@ -0,0 +1,43 @@ +'use strict' + +/** + * Extend Prism's bash grammar with extra CLI commands for docs code blocks. + * Hexo loads scripts from docs/scripts/ during init, before `hexo generate` + * highlights fenced code via syntax_highlighter: prismjs. + * + * To highlight another command, add its name to EXTRA_BASH_COMMANDS below. + */ +const EXTRA_BASH_COMMANDS = [ + 'npx' +] + +const Prism = require('prismjs') +require('prismjs/components/prism-bash') + +function extendBashCommandHighlighting (commands) { + const bash = Prism.languages.bash + if (!bash || !bash.function) return + + const fnToken = bash.function + const pattern = fnToken.pattern + if (!(pattern instanceof RegExp)) return + + const source = pattern.source + const listMatch = source.match(/\(\?:([^)]+)\)(?=\(\?\=)/) + if (!listMatch) return + + const existing = listMatch[1] + const toAdd = commands.filter((cmd) => { + const re = new RegExp(`(?:^|\\|)${cmd.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?:\\||$)`) + return !re.test(existing) + }) + if (toAdd.length === 0) return + + const extended = `${existing}|${toAdd.join('|')}` + fnToken.pattern = new RegExp( + source.replace(/\(\?:([^)]+)\)(?=\(\?\=)/, `(?:${extended})`), + pattern.flags + ) +} + +extendBashCommandHighlighting(EXTRA_BASH_COMMANDS) diff --git a/docs/source/filters/abs.md b/docs/source/filters/abs.md index 11bdba31d..e1c7d98cc 100644 --- a/docs/source/filters/abs.md +++ b/docs/source/filters/abs.md @@ -1,5 +1,5 @@ --- -title: abs +title: '`abs`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/append.md b/docs/source/filters/append.md index 666e9b8a1..a67ea5449 100644 --- a/docs/source/filters/append.md +++ b/docs/source/filters/append.md @@ -1,5 +1,5 @@ --- -title: append +title: '`append`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/array_to_sentence_string.md b/docs/source/filters/array_to_sentence_string.md index 32f25f7ad..3db10cae8 100644 --- a/docs/source/filters/array_to_sentence_string.md +++ b/docs/source/filters/array_to_sentence_string.md @@ -1,5 +1,5 @@ --- -title: array_to_sentence_string +title: '`array_to_sentence_string`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/at_least.md b/docs/source/filters/at_least.md index 4309ea90e..29301ae15 100644 --- a/docs/source/filters/at_least.md +++ b/docs/source/filters/at_least.md @@ -1,5 +1,5 @@ --- -title: at_least +title: '`at_least`' --- {% since %}v8.4.0{% endsince %} diff --git a/docs/source/filters/at_most.md b/docs/source/filters/at_most.md index bd6876fa3..fa3f3563c 100644 --- a/docs/source/filters/at_most.md +++ b/docs/source/filters/at_most.md @@ -1,5 +1,5 @@ --- -title: at_most +title: '`at_most`' --- {% since %}v8.4.0{% endsince %} diff --git a/docs/source/filters/base64_decode.md b/docs/source/filters/base64_decode.md index bcccac826..bc024b475 100644 --- a/docs/source/filters/base64_decode.md +++ b/docs/source/filters/base64_decode.md @@ -1,5 +1,5 @@ --- -title: base64_decode +title: '`base64_decode`' --- {% since %}v10.24.0{% endsince %} diff --git a/docs/source/filters/base64_encode.md b/docs/source/filters/base64_encode.md index 2bddde867..c9445d310 100644 --- a/docs/source/filters/base64_encode.md +++ b/docs/source/filters/base64_encode.md @@ -1,5 +1,5 @@ --- -title: base64_encode +title: '`base64_encode`' --- {% since %}v10.24.0{% endsince %} diff --git a/docs/source/filters/capitalize.md b/docs/source/filters/capitalize.md index 74d2ae4b1..9f5e860e8 100644 --- a/docs/source/filters/capitalize.md +++ b/docs/source/filters/capitalize.md @@ -1,5 +1,5 @@ --- -title: capitalize +title: '`capitalize`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/ceil.md b/docs/source/filters/ceil.md index a365e77a7..8439c607b 100644 --- a/docs/source/filters/ceil.md +++ b/docs/source/filters/ceil.md @@ -1,5 +1,5 @@ --- -title: ceil +title: '`ceil`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/cgi_escape.md b/docs/source/filters/cgi_escape.md index 2544b841e..56063b4c6 100644 --- a/docs/source/filters/cgi_escape.md +++ b/docs/source/filters/cgi_escape.md @@ -1,5 +1,5 @@ --- -title: cgi_escape +title: '`cgi_escape`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/compact.md b/docs/source/filters/compact.md index fb642b818..83d6acc93 100644 --- a/docs/source/filters/compact.md +++ b/docs/source/filters/compact.md @@ -1,5 +1,5 @@ --- -title: compact +title: '`compact`' --- {% since %}v9.22.0{% endsince %} diff --git a/docs/source/filters/concat.md b/docs/source/filters/concat.md index 902b1c866..4c7ba9114 100644 --- a/docs/source/filters/concat.md +++ b/docs/source/filters/concat.md @@ -1,5 +1,5 @@ --- -title: concat +title: '`concat`' --- {% since %}v2.0.0{% endsince %} diff --git a/docs/source/filters/date.md b/docs/source/filters/date.md index c38de7ddc..f03b3a824 100644 --- a/docs/source/filters/date.md +++ b/docs/source/filters/date.md @@ -1,9 +1,9 @@ --- -title: date +title: '`date`' --- {% since %}v1.9.1{% endsince %} -Date filter is used to convert a timestamp into the specified format. +The `date` filter is used to convert a timestamp into the specified format. * LiquidJS tries to conform to Shopify/Liquid, which uses Ruby's core [Time#strftime(string)](https://www.ruby-doc.org/core/Time.html#method-i-strftime). There're differences with [Ruby's format flags](https://ruby-doc.org/core/strftime_formatting_rdoc.html): * `%Z` (since v10.11.1) is replaced by the passed-in timezone name from `LiquidOption` or in-place value (see TimeZone below). If passed-in timezone is an offset number instead of string, it'll behave like `%z`. If there's none passed-in timezone, it returns [the runtime's default time zone](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions#timezone). diff --git a/docs/source/filters/date_to_long_string.md b/docs/source/filters/date_to_long_string.md index a300797d7..a736463b2 100644 --- a/docs/source/filters/date_to_long_string.md +++ b/docs/source/filters/date_to_long_string.md @@ -1,5 +1,5 @@ --- -title: date_to_long_string +title: '`date_to_long_string`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/date_to_rfc822.md b/docs/source/filters/date_to_rfc822.md index afdd98cd6..fd0851e3d 100644 --- a/docs/source/filters/date_to_rfc822.md +++ b/docs/source/filters/date_to_rfc822.md @@ -1,5 +1,5 @@ --- -title: date_to_rfc822 +title: '`date_to_rfc822`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/date_to_string.md b/docs/source/filters/date_to_string.md index 0534b8fe0..c55c4db80 100644 --- a/docs/source/filters/date_to_string.md +++ b/docs/source/filters/date_to_string.md @@ -1,5 +1,5 @@ --- -title: date_to_string +title: '`date_to_string`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/date_to_xmlschema.md b/docs/source/filters/date_to_xmlschema.md index dd2e870eb..730f99020 100644 --- a/docs/source/filters/date_to_xmlschema.md +++ b/docs/source/filters/date_to_xmlschema.md @@ -1,5 +1,5 @@ --- -title: date_to_xmlschema +title: '`date_to_xmlschema`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/default.md b/docs/source/filters/default.md index 3351525c8..b8273c60d 100644 --- a/docs/source/filters/default.md +++ b/docs/source/filters/default.md @@ -1,5 +1,5 @@ --- -title: default +title: '`default`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/divided_by.md b/docs/source/filters/divided_by.md index 13fe10228..334a772cf 100644 --- a/docs/source/filters/divided_by.md +++ b/docs/source/filters/divided_by.md @@ -1,5 +1,5 @@ --- -title: divided_by +title: '`divided_by`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/downcase.md b/docs/source/filters/downcase.md index 445298e5b..f2d0a88cf 100644 --- a/docs/source/filters/downcase.md +++ b/docs/source/filters/downcase.md @@ -1,5 +1,5 @@ --- -title: downcase +title: '`downcase`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/escape.md b/docs/source/filters/escape.md index 3ca701c9c..81a8fefa9 100644 --- a/docs/source/filters/escape.md +++ b/docs/source/filters/escape.md @@ -1,5 +1,5 @@ --- -title: escape +title: '`escape`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/escape_once.md b/docs/source/filters/escape_once.md index 7b7fe13fc..b7b6ef887 100644 --- a/docs/source/filters/escape_once.md +++ b/docs/source/filters/escape_once.md @@ -1,5 +1,5 @@ --- -title: escape_once +title: '`escape_once`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/find.md b/docs/source/filters/find.md index 3d2a00c7d..02afef240 100644 --- a/docs/source/filters/find.md +++ b/docs/source/filters/find.md @@ -1,5 +1,5 @@ --- -title: find +title: '`find`' --- {% since %}v10.11.0{% endsince %} diff --git a/docs/source/filters/find_exp.md b/docs/source/filters/find_exp.md index c56a18bef..8fe92b7a1 100644 --- a/docs/source/filters/find_exp.md +++ b/docs/source/filters/find_exp.md @@ -1,5 +1,5 @@ --- -title: find_exp +title: '`find_exp`' --- {% since %}v10.11.0{% endsince %} diff --git a/docs/source/filters/find_index.md b/docs/source/filters/find_index.md index 7819097b0..5377caeb8 100644 --- a/docs/source/filters/find_index.md +++ b/docs/source/filters/find_index.md @@ -1,5 +1,5 @@ --- -title: find_index +title: '`find_index`' --- {% since %}v10.21.0{% endsince %} diff --git a/docs/source/filters/find_index_exp.md b/docs/source/filters/find_index_exp.md index 1f9a40ded..5080fc4aa 100644 --- a/docs/source/filters/find_index_exp.md +++ b/docs/source/filters/find_index_exp.md @@ -1,5 +1,5 @@ --- -title: find_index_exp +title: '`find_index_exp`' --- {% since %}v10.21.0{% endsince %} diff --git a/docs/source/filters/first.md b/docs/source/filters/first.md index 5e9db34ae..a4cc117f0 100644 --- a/docs/source/filters/first.md +++ b/docs/source/filters/first.md @@ -1,5 +1,5 @@ --- -title: first +title: '`first`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/floor.md b/docs/source/filters/floor.md index 26660574f..7dcfa919d 100644 --- a/docs/source/filters/floor.md +++ b/docs/source/filters/floor.md @@ -1,5 +1,5 @@ --- -title: floor +title: '`floor`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/group_by.md b/docs/source/filters/group_by.md index 2540fa1b6..a8cd27668 100644 --- a/docs/source/filters/group_by.md +++ b/docs/source/filters/group_by.md @@ -1,5 +1,5 @@ --- -title: group_by +title: '`group_by`' --- {% since %}v10.11.0{% endsince %} diff --git a/docs/source/filters/group_by_exp.md b/docs/source/filters/group_by_exp.md index bd4bb481c..82decde89 100644 --- a/docs/source/filters/group_by_exp.md +++ b/docs/source/filters/group_by_exp.md @@ -1,5 +1,5 @@ --- -title: group_by_exp +title: '`group_by_exp`' --- {% since %}v10.11.0{% endsince %} diff --git a/docs/source/filters/has.md b/docs/source/filters/has.md index 27daf634f..e720e4d7d 100644 --- a/docs/source/filters/has.md +++ b/docs/source/filters/has.md @@ -1,5 +1,5 @@ --- -title: has +title: '`has`' --- {% since %}v10.21.0{% endsince %} diff --git a/docs/source/filters/has_exp.md b/docs/source/filters/has_exp.md index 379f67231..4b96e6184 100644 --- a/docs/source/filters/has_exp.md +++ b/docs/source/filters/has_exp.md @@ -1,5 +1,5 @@ --- -title: has_exp +title: '`has_exp`' --- {% since %}v10.21.0{% endsince %} diff --git a/docs/source/filters/hmac_sha256.md b/docs/source/filters/hmac_sha256.md index 24e00140e..f1ee90678 100644 --- a/docs/source/filters/hmac_sha256.md +++ b/docs/source/filters/hmac_sha256.md @@ -1,5 +1,5 @@ --- -title: hmac_sha256 +title: '`hmac_sha256`' --- {% since %}vNEXT{% endsince %} diff --git a/docs/source/filters/inspect.md b/docs/source/filters/inspect.md index 7abc85619..2679a73a5 100644 --- a/docs/source/filters/inspect.md +++ b/docs/source/filters/inspect.md @@ -1,5 +1,5 @@ --- -title: inspect +title: '`inspect`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/join.md b/docs/source/filters/join.md index 11074ead2..a377c0a4f 100644 --- a/docs/source/filters/join.md +++ b/docs/source/filters/join.md @@ -1,5 +1,5 @@ --- -title: join +title: '`join`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/json.md b/docs/source/filters/json.md index 196909c7b..0366f68fe 100644 --- a/docs/source/filters/json.md +++ b/docs/source/filters/json.md @@ -1,5 +1,5 @@ --- -title: json +title: '`json`' --- {% since %}v9.10.0{% endsince %} diff --git a/docs/source/filters/jsonify.md b/docs/source/filters/jsonify.md index dd2ca819d..7f2df037b 100644 --- a/docs/source/filters/jsonify.md +++ b/docs/source/filters/jsonify.md @@ -1,5 +1,5 @@ --- -title: jsonify +title: '`jsonify`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/last.md b/docs/source/filters/last.md index 98f7d91f8..bae7dc516 100644 --- a/docs/source/filters/last.md +++ b/docs/source/filters/last.md @@ -1,5 +1,5 @@ --- -title: last +title: '`last`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/lstrip.md b/docs/source/filters/lstrip.md index f24dc3a09..5e63002dc 100644 --- a/docs/source/filters/lstrip.md +++ b/docs/source/filters/lstrip.md @@ -1,5 +1,5 @@ --- -title: lstrip +title: '`lstrip`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/map.md b/docs/source/filters/map.md index 6f7092f72..b06b7d973 100644 --- a/docs/source/filters/map.md +++ b/docs/source/filters/map.md @@ -1,5 +1,5 @@ --- -title: map +title: '`map`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/minus.md b/docs/source/filters/minus.md index f163a55de..a8d0f06c4 100644 --- a/docs/source/filters/minus.md +++ b/docs/source/filters/minus.md @@ -1,5 +1,5 @@ --- -title: minus +title: '`minus`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/modulo.md b/docs/source/filters/modulo.md index 40d22d8a2..eccb4085d 100644 --- a/docs/source/filters/modulo.md +++ b/docs/source/filters/modulo.md @@ -1,5 +1,5 @@ --- -title: modulo +title: '`modulo`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/newline_to_br.md b/docs/source/filters/newline_to_br.md index 852598f52..199f66a21 100644 --- a/docs/source/filters/newline_to_br.md +++ b/docs/source/filters/newline_to_br.md @@ -1,5 +1,5 @@ --- -title: newline_to_br +title: '`newline_to_br`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/normalize_whitespace.md b/docs/source/filters/normalize_whitespace.md index bafc290b2..02dfaeabc 100644 --- a/docs/source/filters/normalize_whitespace.md +++ b/docs/source/filters/normalize_whitespace.md @@ -1,5 +1,5 @@ --- -title: normalize_whitespace +title: '`normalize_whitespace`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/number_of_words.md b/docs/source/filters/number_of_words.md index 46b39275a..a26bc4b39 100644 --- a/docs/source/filters/number_of_words.md +++ b/docs/source/filters/number_of_words.md @@ -1,5 +1,5 @@ --- -title: number_of_words +title: '`number_of_words`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/overview.md b/docs/source/filters/overview.md index 342fab0c5..032535643 100644 --- a/docs/source/filters/overview.md +++ b/docs/source/filters/overview.md @@ -9,13 +9,13 @@ There's 40+ filters supported by LiquidJS. These filters can be categorized into Categories | Filters --- | --- -Math | plus, minus, modulo, times, floor, ceil, round, divided_by, abs, at_least, at_most -String | append, prepend, capitalize, upcase, downcase, strip, lstrip, rstrip, strip_newlines, split, replace, replace_first, replace_last,remove, remove_first, remove_last, truncate, truncatewords, normalize_whitespace, number_of_words, array_to_sentence_string -HTML/URI | escape, escape_once, url_encode, url_decode, strip_html, newline_to_br, xml_escape, cgi_escape, uri_escape, slugify -Array | slice, map, sort, sort_natural, uniq, where, where_exp, group_by, group_by_exp, find, find_exp, first, last, join, reverse, concat, compact, size, push, pop, shift, unshift -Date | date, date_to_xmlschema, date_to_rfc822, date_to_string, date_to_long_string -Misc | default, json, jsonify, inspect, raw, to_integer -Base64 | base64_encode, base64_decode -Crypto | sha256, hmac_sha256 +Math | `plus`, `minus`, `modulo`, `times`, `floor`, `ceil`, `round`, `divided_by`, `abs`, `at_least`, `at_most` +String | `append`, `prepend`, `capitalize`, `upcase`, `downcase`, `strip`, `lstrip`, `rstrip`, `strip_newlines`, `split`, `replace`, `replace_first`, `replace_last`,`remove`, `remove_first`, `remove_last`, `truncate`, `truncatewords`, `normalize_whitespace`, `number_of_words`, `array_to_sentence_string` +HTML/URI | `escape`, `escape_once`, `url_encode`, `url_decode`, `strip_html`, `newline_to_br`, `xml_escape`, `cgi_escape`, `uri_escape`, `slugify` +Array | `slice`, `map`, `sort`, `sort_natural`, `uniq`, `where`, `where_exp`, `group_by`, `group_by_exp`, `find`, `find_exp`, `first`, `last`, `join`, `reverse`, `concat`, `compact`, `size`, `push`, `pop`, `shift`, `unshift` +Date | `date`, `date_to_xmlschema`, `date_to_rfc822`, `date_to_string`, `date_to_long_string` +Misc | `default`, `json`, `jsonify`, `inspect`, `raw`, `to_integer` +Base64 | `base64_encode`, `base64_decode` +Crypto | `sha256`, `hmac_sha256` [shopify/liquid]: https://github.com/Shopify/liquid diff --git a/docs/source/filters/plus.md b/docs/source/filters/plus.md index 7fcc12c7f..9805cfe78 100644 --- a/docs/source/filters/plus.md +++ b/docs/source/filters/plus.md @@ -1,5 +1,5 @@ --- -title: plus +title: '`plus`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/pop.md b/docs/source/filters/pop.md index b55154f98..afe5098a3 100644 --- a/docs/source/filters/pop.md +++ b/docs/source/filters/pop.md @@ -1,5 +1,5 @@ --- -title: pop +title: '`pop`' --- {% since %}v10.11.0{% endsince %} diff --git a/docs/source/filters/prepend.md b/docs/source/filters/prepend.md index 82b0161dc..61e96ce5d 100644 --- a/docs/source/filters/prepend.md +++ b/docs/source/filters/prepend.md @@ -1,5 +1,5 @@ --- -title: prepend +title: '`prepend`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/push.md b/docs/source/filters/push.md index 1844708b8..386e10f7c 100644 --- a/docs/source/filters/push.md +++ b/docs/source/filters/push.md @@ -1,5 +1,5 @@ --- -title: push +title: '`push`' --- {% since %}v10.8.0{% endsince %} diff --git a/docs/source/filters/raw.md b/docs/source/filters/raw.md index 9da53bb79..61e35cd68 100644 --- a/docs/source/filters/raw.md +++ b/docs/source/filters/raw.md @@ -1,5 +1,5 @@ --- -title: raw +title: '`raw`' --- {% since %}v9.37.0{% endsince %} diff --git a/docs/source/filters/reject.md b/docs/source/filters/reject.md index 516d9047f..fcac7551d 100644 --- a/docs/source/filters/reject.md +++ b/docs/source/filters/reject.md @@ -1,5 +1,5 @@ --- -title: reject +title: '`reject`' --- {% since %}v10.21.0{% endsince %} diff --git a/docs/source/filters/reject_exp.md b/docs/source/filters/reject_exp.md index 2f37d8555..360c6f959 100644 --- a/docs/source/filters/reject_exp.md +++ b/docs/source/filters/reject_exp.md @@ -1,5 +1,5 @@ --- -title: reject_exp +title: '`reject_exp`' --- {% since %}v10.21.0{% endsince %} diff --git a/docs/source/filters/remove.md b/docs/source/filters/remove.md index 245128b54..6d55ce09e 100644 --- a/docs/source/filters/remove.md +++ b/docs/source/filters/remove.md @@ -1,5 +1,5 @@ --- -title: remove +title: '`remove`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/remove_first.md b/docs/source/filters/remove_first.md index acfe1b0b9..19fa1ac01 100644 --- a/docs/source/filters/remove_first.md +++ b/docs/source/filters/remove_first.md @@ -1,5 +1,5 @@ --- -title: remove_first +title: '`remove_first`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/remove_last.md b/docs/source/filters/remove_last.md index adb8ed3dd..10fb4a6f2 100644 --- a/docs/source/filters/remove_last.md +++ b/docs/source/filters/remove_last.md @@ -1,5 +1,5 @@ --- -title: remove_last +title: '`remove_last`' --- {% since %}v10.2.0{% endsince %} diff --git a/docs/source/filters/replace.md b/docs/source/filters/replace.md index 00ef7b538..00c40718a 100644 --- a/docs/source/filters/replace.md +++ b/docs/source/filters/replace.md @@ -1,5 +1,5 @@ --- -title: replace +title: '`replace`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/replace_first.md b/docs/source/filters/replace_first.md index f2750d38a..96cb96259 100644 --- a/docs/source/filters/replace_first.md +++ b/docs/source/filters/replace_first.md @@ -1,5 +1,5 @@ --- -title: replace_first +title: '`replace_first`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/replace_last.md b/docs/source/filters/replace_last.md index 4da4a7c5a..fb7d14371 100644 --- a/docs/source/filters/replace_last.md +++ b/docs/source/filters/replace_last.md @@ -1,5 +1,5 @@ --- -title: replace_last +title: '`replace_last`' --- {% since %}v10.2.0{% endsince %} diff --git a/docs/source/filters/reverse.md b/docs/source/filters/reverse.md index a0521941c..afc9ab64e 100644 --- a/docs/source/filters/reverse.md +++ b/docs/source/filters/reverse.md @@ -1,5 +1,5 @@ --- -title: reverse +title: '`reverse`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/round.md b/docs/source/filters/round.md index 5995da50a..0439994de 100644 --- a/docs/source/filters/round.md +++ b/docs/source/filters/round.md @@ -1,5 +1,5 @@ --- -title: round +title: '`round`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/rstrip.md b/docs/source/filters/rstrip.md index f99a506cb..80729b207 100644 --- a/docs/source/filters/rstrip.md +++ b/docs/source/filters/rstrip.md @@ -1,5 +1,5 @@ --- -title: rstrip +title: '`rstrip`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/sha256.md b/docs/source/filters/sha256.md index 659b86355..01b15fd33 100644 --- a/docs/source/filters/sha256.md +++ b/docs/source/filters/sha256.md @@ -1,5 +1,5 @@ --- -title: sha256 +title: '`sha256`' --- {% since %}vNEXT{% endsince %} diff --git a/docs/source/filters/shift.md b/docs/source/filters/shift.md index 63e547562..4f360d3fd 100644 --- a/docs/source/filters/shift.md +++ b/docs/source/filters/shift.md @@ -1,5 +1,5 @@ --- -title: shift +title: '`shift`' --- {% since %}v10.11.0{% endsince %} diff --git a/docs/source/filters/size.md b/docs/source/filters/size.md index 04f71c0e9..600c1f0d4 100644 --- a/docs/source/filters/size.md +++ b/docs/source/filters/size.md @@ -1,5 +1,5 @@ --- -title: size +title: '`size`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/slice.md b/docs/source/filters/slice.md index 4764d86cb..6ad2d734f 100644 --- a/docs/source/filters/slice.md +++ b/docs/source/filters/slice.md @@ -1,5 +1,5 @@ --- -title: slice +title: '`slice`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/slugify.md b/docs/source/filters/slugify.md index afea1d1c4..88ee0c27c 100644 --- a/docs/source/filters/slugify.md +++ b/docs/source/filters/slugify.md @@ -1,5 +1,5 @@ --- -title: slugify +title: '`slugify`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/sort.md b/docs/source/filters/sort.md index 5e69af7ff..31a451138 100644 --- a/docs/source/filters/sort.md +++ b/docs/source/filters/sort.md @@ -1,5 +1,5 @@ --- -title: sort +title: '`sort`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/sort_natural.md b/docs/source/filters/sort_natural.md index 4bece69f3..ab908b0bc 100644 --- a/docs/source/filters/sort_natural.md +++ b/docs/source/filters/sort_natural.md @@ -1,5 +1,5 @@ --- -title: sort_natural +title: '`sort_natural`' --- {% since %}v8.4.0{% endsince %} diff --git a/docs/source/filters/split.md b/docs/source/filters/split.md index f9c048292..b35e241be 100644 --- a/docs/source/filters/split.md +++ b/docs/source/filters/split.md @@ -1,5 +1,5 @@ --- -title: split +title: '`split`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/strip.md b/docs/source/filters/strip.md index 23a16bcc1..e778c8fce 100644 --- a/docs/source/filters/strip.md +++ b/docs/source/filters/strip.md @@ -1,5 +1,5 @@ --- -title: strip +title: '`strip`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/strip_html.md b/docs/source/filters/strip_html.md index 86248716b..571b39dd1 100644 --- a/docs/source/filters/strip_html.md +++ b/docs/source/filters/strip_html.md @@ -1,5 +1,5 @@ --- -title: strip_html +title: '`strip_html`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/strip_newlines.md b/docs/source/filters/strip_newlines.md index a713ea8b6..a1d49d3e1 100644 --- a/docs/source/filters/strip_newlines.md +++ b/docs/source/filters/strip_newlines.md @@ -1,5 +1,5 @@ --- -title: strip_newlines +title: '`strip_newlines`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/sum.md b/docs/source/filters/sum.md index 2d54c3ae9..a4dccacb8 100644 --- a/docs/source/filters/sum.md +++ b/docs/source/filters/sum.md @@ -1,5 +1,5 @@ --- -title: sum +title: '`sum`' --- {% since %}v10.10.0{% endsince %} diff --git a/docs/source/filters/times.md b/docs/source/filters/times.md index 1187e20f2..7495f0afc 100644 --- a/docs/source/filters/times.md +++ b/docs/source/filters/times.md @@ -1,5 +1,5 @@ --- -title: times +title: '`times`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/to_integer.md b/docs/source/filters/to_integer.md index d635f8556..1ea930bdc 100644 --- a/docs/source/filters/to_integer.md +++ b/docs/source/filters/to_integer.md @@ -1,5 +1,5 @@ --- -title: to_integer +title: '`to_integer`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/truncate.md b/docs/source/filters/truncate.md index a3cf7cb3c..4e7123f5e 100644 --- a/docs/source/filters/truncate.md +++ b/docs/source/filters/truncate.md @@ -1,5 +1,5 @@ --- -title: truncate +title: '`truncate`' --- {% since %}v1.9.1{% endsince %} @@ -36,7 +36,7 @@ Ground control, and so on ## No ellipsis -You can truncate to the exact number of characters specified by the first argument and avoid showing trailing characters by passing a blank string as the second argument: +You can `truncate` to the exact number of characters specified by the first argument and avoid showing trailing characters by passing a blank string as the second argument: Input ```liquid diff --git a/docs/source/filters/truncatewords.md b/docs/source/filters/truncatewords.md index 6a98bc114..f35dc3764 100644 --- a/docs/source/filters/truncatewords.md +++ b/docs/source/filters/truncatewords.md @@ -1,5 +1,5 @@ --- -title: truncatewords +title: '`truncatewords`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/uniq.md b/docs/source/filters/uniq.md index e5679daec..d2028be8e 100644 --- a/docs/source/filters/uniq.md +++ b/docs/source/filters/uniq.md @@ -1,5 +1,5 @@ --- -title: uniq +title: '`uniq`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/unshift.md b/docs/source/filters/unshift.md index 77b568c1b..065582678 100644 --- a/docs/source/filters/unshift.md +++ b/docs/source/filters/unshift.md @@ -1,5 +1,5 @@ --- -title: unshift +title: '`unshift`' --- {% since %}v10.11.0{% endsince %} diff --git a/docs/source/filters/upcase.md b/docs/source/filters/upcase.md index b7fe6bfcb..c55959889 100644 --- a/docs/source/filters/upcase.md +++ b/docs/source/filters/upcase.md @@ -1,5 +1,5 @@ --- -title: upcase +title: '`upcase`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/uri_escape.md b/docs/source/filters/uri_escape.md index 6e96c8f85..c2657142d 100644 --- a/docs/source/filters/uri_escape.md +++ b/docs/source/filters/uri_escape.md @@ -1,5 +1,5 @@ --- -title: uri_escape +title: '`uri_escape`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/filters/url_decode.md b/docs/source/filters/url_decode.md index 9b8920215..db0189ba2 100644 --- a/docs/source/filters/url_decode.md +++ b/docs/source/filters/url_decode.md @@ -1,5 +1,5 @@ --- -title: url_decode +title: '`url_decode`' --- {% since %}v6.1.0{% endsince %} diff --git a/docs/source/filters/url_encode.md b/docs/source/filters/url_encode.md index 88b7f31e1..14379d4ce 100644 --- a/docs/source/filters/url_encode.md +++ b/docs/source/filters/url_encode.md @@ -1,5 +1,5 @@ --- -title: url_encode +title: '`url_encode`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/filters/where.md b/docs/source/filters/where.md index d20c7346e..b6843a0da 100644 --- a/docs/source/filters/where.md +++ b/docs/source/filters/where.md @@ -1,5 +1,5 @@ --- -title: where +title: '`where`' --- {% since %}v8.1.0{% endsince %} diff --git a/docs/source/filters/where_exp.md b/docs/source/filters/where_exp.md index 92e09c374..96ba674b5 100644 --- a/docs/source/filters/where_exp.md +++ b/docs/source/filters/where_exp.md @@ -1,5 +1,5 @@ --- -title: where_exp +title: '`where_exp`' --- {% since %}v10.12.0{% endsince %} diff --git a/docs/source/filters/xml_escape.md b/docs/source/filters/xml_escape.md index 33f5f61a6..9dd048ba3 100644 --- a/docs/source/filters/xml_escape.md +++ b/docs/source/filters/xml_escape.md @@ -1,5 +1,5 @@ --- -title: xml_escape +title: '`xml_escape`' --- {% since %}v10.13.0{% endsince %} diff --git a/docs/source/tags/assign.md b/docs/source/tags/assign.md index abe7e57fa..375d583d7 100644 --- a/docs/source/tags/assign.md +++ b/docs/source/tags/assign.md @@ -1,5 +1,5 @@ --- -title: Assign +title: '`assign`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/tags/capture.md b/docs/source/tags/capture.md index d78aa5ecd..373991e7f 100644 --- a/docs/source/tags/capture.md +++ b/docs/source/tags/capture.md @@ -1,5 +1,5 @@ --- -title: capture +title: '`capture`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/tags/case.md b/docs/source/tags/case.md index e5e662222..2bac35493 100644 --- a/docs/source/tags/case.md +++ b/docs/source/tags/case.md @@ -1,5 +1,5 @@ --- -title: case +title: Case --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/tags/cycle.md b/docs/source/tags/cycle.md index 79ccc562a..d180ded92 100644 --- a/docs/source/tags/cycle.md +++ b/docs/source/tags/cycle.md @@ -1,5 +1,5 @@ --- -title: cycle +title: '`cycle`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/tags/decrement.md b/docs/source/tags/decrement.md index fdcfce9c3..0a2591fd2 100644 --- a/docs/source/tags/decrement.md +++ b/docs/source/tags/decrement.md @@ -1,5 +1,5 @@ --- -title: Decrement +title: '`decrement`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/tags/include.md b/docs/source/tags/include.md index e79b41576..3019bb3d7 100644 --- a/docs/source/tags/include.md +++ b/docs/source/tags/include.md @@ -1,5 +1,5 @@ --- -title: Include +title: '`include`' --- {% since %}v1.9.1{% endsince %} @@ -70,11 +70,11 @@ This way, you don't need to escape `"` in the filename expression. {% include prefix/{{name | append: ".html"}} %} ``` -## Jekyll include +## Jekyll `include` {% since %}v9.33.0{% endsince %} -[jekyllInclude][jekyllInclude] is used to enable Jekyll-like include syntax. Defaults to `false`, when set to `true`: +[jekyllInclude][jekyllInclude] is used to enable Jekyll-like `include` syntax. Defaults to `false`, when set to `true`: - Filename will be static: `dynamicPartials` now defaults to `false` (instead of `true`). And you can set `dynamicPartials` back to `true`. - Use `=` instead of `:` to separate parameter key-values. diff --git a/docs/source/tags/increment.md b/docs/source/tags/increment.md index 6e8b7e416..b34537b11 100644 --- a/docs/source/tags/increment.md +++ b/docs/source/tags/increment.md @@ -1,5 +1,5 @@ --- -title: Increment +title: '`increment`' --- {% since %}v1.9.1{% endsince %} diff --git a/docs/source/tags/inline_comment.md b/docs/source/tags/inline_comment.md index e40f0eb41..da3b26af1 100644 --- a/docs/source/tags/inline_comment.md +++ b/docs/source/tags/inline_comment.md @@ -1,5 +1,5 @@ --- -title: "# (inline comment)" +title: '`#`' --- {% since %}v9.38.0{% endsince %} diff --git a/docs/source/tags/layout.md b/docs/source/tags/layout.md index 70487d203..96f635867 100644 --- a/docs/source/tags/layout.md +++ b/docs/source/tags/layout.md @@ -1,5 +1,5 @@ --- -title: Layout +title: '`layout`' --- {% since %}v1.9.1{% endsince %} @@ -31,12 +31,12 @@ If [extname][extname] option is set, the `.liquid` extension becomes optional: ``` {% note info Scoping %} -When a partial template is rendered by layout, its template have access for its caller's variables but not vice versa. Variables defined in layout will be popped out before control returning to its caller. +When a partial template is rendered by the `layout` tag, its template have access for its caller's variables but not vice versa. Variables defined in `layout` will be popped out before control returning to its caller. {% endnote %} ## Multiple Blocks -The layout file can contain multiple blocks, each with a specified name. The following snippets yield same result as in the above example. +The `layout` file can contain multiple blocks, each with a specified name. The following snippets yield same result as in the above example. ```liquid // default-layout.liquid @@ -53,7 +53,7 @@ The layout file can contain multiple blocks, each with a specified name. The fol ## Default Block Contents -In the above layout files, blocks has empty contents. But it's not necessarily be empty, in which case, the block contents in layout files will be used as default templates. The following snippets are also equivalent to the above examples: +In the above `layout` files, blocks has empty contents. But it's not necessarily be empty, in which case, the block contents in `layout` files will be used as default templates. The following snippets are also equivalent to the above examples: ```liquid // default-layout.liquid @@ -68,7 +68,7 @@ In the above layout files, blocks has empty contents. But it's not necessarily b ## Passing Variables -Variables defined in current template can be passed to a the layout template by listing them as parameters on the `layout` tag: +Variables defined in current template can be passed to a the `layout` template by listing them as parameters on the `layout` tag: ```liquid {% assign my_variable = 'apples' %} diff --git a/docs/source/tags/overview.md b/docs/source/tags/overview.md index e57c2d52f..6db70377a 100644 --- a/docs/source/tags/overview.md +++ b/docs/source/tags/overview.md @@ -9,10 +9,10 @@ There're a dozen of tags supported by LiquidJS, with all tags in [shopify/liquid Category | Purpose | Tags --- | --- | --- -Iteration | iterate over a collection | for, cycle, tablerow -Control Flow | control the execution branch of template rendering | if, unless, elsif, else, case, when -Variable | define and alter variables | assign, increment, decrement, capture, echo -File | include another template or extend a layout template | render, include, layout -Language | temporarily disable LiquidJS syntax | # (inline comment), raw, comment, liquid +Iteration | iterate over a collection | `for`, `cycle`, `tablerow` +Control Flow | control the execution branch of template rendering | `if`, `unless`, `elsif`, `else`, `case`, `when` +Variable | define and alter variables | `assign`, `increment`, `decrement`, `capture`, `echo` +File | include another template or extend a layout template | `render`, `include`, `layout` +Language | temporarily disable LiquidJS syntax | `#`, `raw`, `comment`, `liquid` [shopify/liquid]: https://github.com/Shopify/liquid diff --git a/docs/source/tags/render.md b/docs/source/tags/render.md index 374723e07..65c8793c3 100644 --- a/docs/source/tags/render.md +++ b/docs/source/tags/render.md @@ -1,5 +1,5 @@ --- -title: Render +title: '`render`' --- {% since %}v9.2.0{% endsince %} @@ -32,7 +32,7 @@ When a partial template is rendered, the code inside it can't access its parent' ## Passing Variables -Variables defined in parent's scope can be passed to a the partial template by listing them as parameters on the render tag: +Variables defined in parent's scope can be passed to a the partial template by listing them as parameters on the `render` tag: ```liquid {% assign my_variable = 'apples' %} diff --git a/docs/source/tags/tablerow.md b/docs/source/tags/tablerow.md index f33a8ca09..f13c29d41 100644 --- a/docs/source/tags/tablerow.md +++ b/docs/source/tags/tablerow.md @@ -1,5 +1,5 @@ --- -title: Table Row +title: Tablerow --- {% since %}v1.9.1{% endsince %} @@ -88,7 +88,7 @@ Output ### limit -Exits the tablerow after a specific index. +Exits the `tablerow` after a specific index. ```liquid {% tablerow product in collection.products cols:2 limit:3 %} @@ -98,7 +98,7 @@ Exits the tablerow after a specific index. ### offset -Starts the tablerow after a specific index. +Starts the `tablerow` after a specific index. ```liquid {% tablerow product in collection.products cols:2 offset:3 %} diff --git a/docs/themes/navy/layout/partial/head.swig b/docs/themes/navy/layout/partial/head.swig index 2f245b2a5..ce443bb30 100644 --- a/docs/themes/navy/layout/partial/head.swig +++ b/docs/themes/navy/layout/partial/head.swig @@ -35,6 +35,7 @@