liquid

Enabling Liquid templating syntax highlight in webStorm/phpStorm

旧时模样 提交于 2019-12-13 11:32:27
问题 I wonder if someone managed to enable the Liquid templating engine syntax highlighting in WebStorm IDE, I work a lot on Shopify stores and really like using Webstorm for that purpose. Did anyone managed to get this working? I found some resources regarding this issue on JetBrain's forum though it didn't quite got me anywhere, there is one dude who suggested using 'tmBundle' and that might work if you do some dark magic. The thread is: RUBY-7210 and the official plugin request: JetBrain's

How to add collection.liquid to an existing page?

回眸只為那壹抹淺笑 提交于 2019-12-13 06:51:01
问题 In Shopify, I'm trying to take the template collection.liquid and render it in another page, just like embedding it. But i'm not sure how to accomplish that. {% paginate collection.products by 50 %} {% include 'breadcrumb' %} {% if settings.show_sort_by and collection.products_count > 1 %} {% include 'collection-sort' %} {% endif %} {% if current_tags.size > 0 %} <h1>{{ current_tags.first }}</h1> {% else %} {% endif %} {% if collection.description.size > 0 %} <!--START HERO--> <!--END HERO-->

How can I get the cart's shipping address in the cart.liquid file?

笑着哭i 提交于 2019-12-13 03:51:36
问题 I'm trying to change the tax and shipping method prompt based on the user's current shipping address. Obviously, they are not yet at checkout so have not had the opportunity to input their shipping address. Is there anything else I can check at this stage to find out which country they are from? {% if shipping_address.country_code = 'CA' %} <p class="cart-message meta">INCLUDING TAX AND SHIPPING (U.S. AND CANADA)</p> {% else %} <p class="cart-message meta">{{ 'cart.general.tax_and_shipping' |

How to exclude .css .json .xml .txt from site.pages in Jekyll? [duplicate]

霸气de小男生 提交于 2019-12-13 03:14:56
问题 This question already has an answer here : Excluding a “spook” pages from <marquee> line made from Jekyll list of page (1 answer) Closed last year . I am generate page rate "Indexmod" with following formula stored in include directory {% assign number_of_words = content | strip_html | number_of_words %} {% assign social = page.facebook | plus: page.instagram | plus: page.youtube | plus: page.vimeo | plus: page.vkontakte | plus: page.twitter | plus: page.tumblr | plus: page.youtube %} {%

How to make .liquid file work in Rails 3

时间秒杀一切 提交于 2019-12-12 20:10:46
问题 I am using Rails 3.0.9 . I am trying to use liquid and I am getting an error. Here is my Gemfile source 'http://rubygems.org' gem 'rails', '3.0.9' gem 'sqlite3' gem 'liquid' Here is an initializer class LiquidView PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template _response url _request _cookies variables_added _flash params _headers request cookies ignore_missing_templates flash _params logger before_filter_chain_aborted headers

Jekyll define fonts in config.yml

我的未来我决定 提交于 2019-12-12 18:18:15
问题 I'm trying to define font variables in my jekyll template's _config.yml so that I can use liquid in my css and change all type styles directy from config. Somehow it's not rendering, is this even possible? This is what I have in my _config: fonts: primary: Roboto Slab secondary: Helvetica And css: body { font-family: '{{ site.fonts.primary }}',{{ site.fonts.secondary }},Arial,sans-serif; } 回答1: You have to provide YAML front matter in order for Jekyll to process Liquid tags in the css file: -

Show product quantity in cart in products div with ajax

社会主义新天地 提交于 2019-12-12 16:54:37
问题 I'm using the default Supply theme for my Shopify store and I've enabled Ajaxify Cart option. I've customised the theme so that if a customers add Product X to the cart, reloads and hovers over the product (on the collections page) it shows that Product X is added 1 time to the cart. This is the liquid code that shows the quantity of Product X in the cart: <!-- Snippet from product-grid-item.liquid --> {% assign count = 0 %} {% for item in cart.items %} {% if product.id == item.product.id %}

How to call the `handleize` Liquid filter from Jekyll plugin?

Deadly 提交于 2019-12-12 14:52:48
问题 I must be off my game today because I can't even see where the handleize filter is even defined. It's in the Shopify documentation, and it works when I use it in my templates. However I can't see the source code for it, so I can't find out how to call it from my plugin. Also note that while these two questions are similar, the answers do not apply here because handleize is not defined in either of the source modules mentioned. If it matters, I'm using Jekyll 2.1.1 and Liquid 2.6.1. 回答1: For

Liquid Markup Map Filter Example

我是研究僧i 提交于 2019-12-12 12:09:53
问题 May I have a generic example of how the Liquid map filter works? There doesn't appear to be documentation for this. The map filter is to "map/collect an array on a given property" - but how do you determine the property? This example exists - Liquid Template Map Filter - but it seems specific to a single use case. How does map work generally? I understand that the output to be filtered is array, but what is the parameter for map? For example: {{ page.tags | map: 'name' }} What is name? Is it

Sorting Jekyll posts by modification date instead of posted date?

泪湿孤枕 提交于 2019-12-12 09:52:55
问题 For someone that updates posts very often it's necessary to have posts sorted from new to old based on last modification date instead of Jekyll's default sort by posted date. There seems to be no easy way of accomplishing this. I've read and tested pretty much all methods out there. Here's what worked (partially as expected): Used this gem https://github.com/gjtorikian/jekyll-last-modified-at but now I have to manually enter last_modified_at in each post's front-matter in order for Jekyll to