LiquidJS

教程标签过滤器演示API
GitHub
概述absappendarray_to_sentence_stringat_leastat_mostcapitalizeceilcgi_escapecompactconcatdatedate_to_long_stringdate_to_rfc822date_to_stringdate_to_xmlschemadefaultdivided_bydowncaseescapeescape_oncefindfind_expfind_indexfind_index_expfirstfloorgroup_bygroup_by_exphashas_expinspectjoinjsonjsonifylastlstripmapminusmodulonewline_to_brnormalize_whitespacenumber_of_wordspluspoppushprependrawrejectreject_expremoveremove_firstremove_lastreplacereplace_firstreplace_lastreverseroundrstripshiftsizesliceslugifysortsort_naturalsplitstripstrip_htmlstrip_newlinessumtimesto_integertruncatetruncatewordsuniqunshiftupcaseuri_escapeurl_decodeurl_encodewherewhere_expxml_escape

json

v9.10.0

通过 JSON.stringify() 把值转换为字符串,多用于调试用途。

输入

{% assign arr = "foo bar coo" | split: " " %}
{{ arr | json }}

输出

["foo","bar","coo"]

格式化

v10.11.0

可以指定一个 space 参数来格式化 JSON。

输入

{% assign arr = "foo bar coo" | split: " " %}
{{ arr | json: 4 }}

输出

[
    "foo",
    "bar",
    "coo"
]
上次更新:2025-04-03 上一页下一页
目录
  1. 格式化
回到顶部
© 2025 Harttle
本文档通过 CC BY 4.0 授权。
    教程标签过滤器演示API
概述absappendarray_to_sentence_stringat_leastat_mostcapitalizeceilcgi_escapecompactconcatdatedate_to_long_stringdate_to_rfc822date_to_stringdate_to_xmlschemadefaultdivided_bydowncaseescapeescape_oncefindfind_expfind_indexfind_index_expfirstfloorgroup_bygroup_by_exphashas_expinspectjoinjsonjsonifylastlstripmapminusmodulonewline_to_brnormalize_whitespacenumber_of_wordspluspoppushprependrawrejectreject_expremoveremove_firstremove_lastreplacereplace_firstreplace_lastreverseroundrstripshiftsizesliceslugifysortsort_naturalsplitstripstrip_htmlstrip_newlinessumtimesto_integertruncatetruncatewordsuniqunshiftupcaseuri_escapeurl_decodeurl_encodewherewhere_expxml_escape