mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
WIP
This commit is contained in:
@@ -22,7 +22,14 @@ module Liquid
|
|||||||
)
|
)
|
||||||
STRIP_HTML_TAGS = /<.*?>/m
|
STRIP_HTML_TAGS = /<.*?>/m
|
||||||
|
|
||||||
# Return the size of an array or of an string
|
# @public_docs
|
||||||
|
# @title Size
|
||||||
|
# @syntax The syntax
|
||||||
|
# @summary The summary
|
||||||
|
# @type filter
|
||||||
|
# @category My category
|
||||||
|
# @description
|
||||||
|
# Return the size of an array or of an string
|
||||||
def size(input)
|
def size(input)
|
||||||
input.respond_to?(:size) ? input.size : 0
|
input.respond_to?(:size) ? input.size : 0
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# @public_docs
|
||||||
module Liquid
|
module Liquid
|
||||||
# Assign sets a variable in your template.
|
# @public_docs
|
||||||
|
# @title Assign
|
||||||
|
# @syntax The syntax
|
||||||
|
# @summary The summary
|
||||||
|
# @type tag
|
||||||
|
# @description
|
||||||
|
# Assign sets a variable in your template.
|
||||||
#
|
#
|
||||||
# {% assign foo = 'monkey' %}
|
# {% assign foo = 'monkey' %}
|
||||||
#
|
#
|
||||||
# You can then use the variable later in the page.
|
# You can then use the variable later in the page.
|
||||||
#
|
|
||||||
# {{ foo }}
|
|
||||||
#
|
#
|
||||||
|
# {{ foo }}
|
||||||
class Assign < Tag
|
class Assign < Tag
|
||||||
Syntax = /(#{VariableSignature}+)\s*=\s*(.*)\s*/om
|
Syntax = /(#{VariableSignature}+)\s*=\s*(.*)\s*/om
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user