liquid

SpriteKit Liquid (water)

纵然是瞬间 提交于 2019-12-21 03:51:09
问题 How can I get a small amount of liquid in my spriteKit application? I want that liquid in a container, it will be sealed inside but I want it to be able to move around. Is there a better way to implement this? Maybe an option without SpriteKit? EDIT: I was able to simulate water using this tutorial: http://www.raywenderlich.com/85515/liquidfun-tutorial-1 and this sample project I found: https://github.com/safx/liquidfun-ios-sample BUT it requires me to run 2 physics worlds (1 for box2D and 1

How do I use markdownify in Jekyll to show an excerpt on the index

点点圈 提交于 2019-12-21 03:27:21
问题 I'm looking to show a short excerpt of text from a longer post or page on the index page. I was going to use a custom variable in the Front Matter and grab that, but then I saw the filter for .excerpt I see in the Jekyll docs there's something called {{ page.excerpt | markdownify }} How would I markup the markdown on a page or post in order to use that filter? edit: Or does markdownify take the entire .md document? 回答1: In the post markdown files you need to first set your excerpt, here is an

Jekyll templates using django-like liquid blocks / inheritance

百般思念 提交于 2019-12-20 19:36:55
问题 I'm getting into Jekyll in a big way and would like to use it as a general front-end development platform, but am running up against the limitations of the Liquid templating language, specifically its difference to Django templating. I discovered the liquid-inheritance gem, which adds the all-important Extends and Block syntax from Django. This blog post extends the gem further to suit Jekyll's file system: http://www.sameratiani.com/2011/10/22/get-jekyll-working-with-liquid-inheritance.html

Indenting generated markup in Jekyll/Ruby

一世执手 提交于 2019-12-20 10:47:08
问题 Well this is probably kind of a silly question but I'm wondering if there's any way to have the generated markup in Jekyll to preserve the indentation of the Liquid-tag. World doesn't end if it isn't solvable. I'm just curious since I like my code to look tidy, even if compiled. :) For example I have these two: base.html: <body> <div id="page"> {{content}} </div> </body> index.md: --- layout: base --- <div id="recent_articles"> {% for post in site.posts %} <div class="article_puff"> <img src=

Get next and previous elements out of an array in liquid

血红的双手。 提交于 2019-12-20 10:43:51
问题 Short version: I want to add 1 to a number in a liquid template and use the result as an array index. {% capture plus_one %}{{ 0 | plus: 1 }}{% endcapture %} <div>-Value of plus_one: {{plus_one}}</div> <div>-This works: {{site.posts[1].title}}</div> <div>-This doesn't: {{site.posts[plus_one].title}}</div> Result: -Value of plus_one: 1 -This works: The Zone -This doesn't: Long version: I'm using Jekyll, with no plugins. I want to give the current post a link to the next post that is in the

How do you comment out in Liquid?

青春壹個敷衍的年華 提交于 2019-12-20 10:16:10
问题 What is the correct way to comment out in the Liquid templating language? 回答1: In Liquid you comment out using the {% comment %} and {% endcomment %} tags: {% comment %} This is a comment in Liquid {% endcomment %} It doesn't matter if the comment is inline or a block comment. {% comment %} This is a block comment in Liquid {% endcomment %} 回答2: Liquid allows you to leave un-rendered code inside a Liquid template by using the {% comment %} and {% endcomment %} tags. Input: Anything you put

Passing parameters to inclusion in Liquid templates

拟墨画扇 提交于 2019-12-20 08:24:10
问题 On my Jekyll-powered website I have an inclusion that does something function-like, but I can't figure out how to pass it parameters correctly. When I use {% include ... %} , passing parameters like this.. {% include function.liquid foo="{{ baz.quux }}" %} ..it just passes the literal string {{ baz.quux }} which is, of course, not what I wanted! I want to pass the value of baz.quux . How do I do this? Thanks! 回答1: There are two ways to achieve this. I have tested both approaches against the

How do I make 2 or more horizontal divs stack into a vertical div when the user shrinks the browser window?

痞子三分冷 提交于 2019-12-20 04:24:05
问题 I have 2 divs on same row, each with a width of 50% and a float: left. I would like them to stack one on top of the other if the user is viewing the page from a smart-phone. Right now, the divs remain on the same row even if the browser window is narrowed to 300px or if viewed from a smart-phone. 回答1: Media queries is the way to go. I'd go with a mobile-first approach, and add media queries to scale up the design. I.e, start with the divs not floating, and add float and width when the screen

Liquid and Arithmetic

谁都会走 提交于 2019-12-19 07:51:01
问题 I am working on some pagination and I am wondering if there is a way to tell liquid to only show 5 pages. The output I am looking for is << First 5 6 7 8 9 Last >> The logic I currently have in place works but it is showing all 30 some pages. {% for count in (2..paginator.total_pages) %} {% if count == paginator.page %} <span class="current">{{ count }}</span> {% else %} <a href="/page/{{ count }}/" class="pagenavi-page" title="{{ count }}">{{ count }}</a> {% endif %} {% endfor %} I would

Liquid and Arithmetic

↘锁芯ラ 提交于 2019-12-19 07:50:59
问题 I am working on some pagination and I am wondering if there is a way to tell liquid to only show 5 pages. The output I am looking for is << First 5 6 7 8 9 Last >> The logic I currently have in place works but it is showing all 30 some pages. {% for count in (2..paginator.total_pages) %} {% if count == paginator.page %} <span class="current">{{ count }}</span> {% else %} <a href="/page/{{ count }}/" class="pagenavi-page" title="{{ count }}">{{ count }}</a> {% endif %} {% endfor %} I would