liquid

Accessing _data in Jekyll (loop in loop)

风流意气都作罢 提交于 2019-12-30 19:24:33
问题 Given this YAML: - maincategory: title: "Projects" subcategory: title: "General" item: title: "Alpha" item: title: "Beta" - maincategory: title: "Support" subcategory: title: "General" item: title: "Something" item: title: "Else" How would one iterate over this data if the Jekyll _data file is called entries.yml? So far I've gotten here but I'm not sure whether I should keep referencing the site.data oject in sub-loops. Also not sure whether this is even possible. {% for entry in site.data

Jekyll, Liquid, Random numbers

a 夏天 提交于 2019-12-30 02:17:18
问题 I would like to have a set of links <li> <h2>Random Articles</h2> <ul> <li><a href="#">Old article 1</a></li> <li><a href="#">Old article 1</a></li> <li><a href="#">Old article 1</a></li> </ul> </li> But I want to generate the links from a random selection of my posts. I'm using jekyll and liquid to generate the site. I must use built in parts of jekyll as I'm hosting on github. I'm not really sure where to start on this. Google searches on the topic are fruitless. 回答1: I had a similar desire

Jekyll display posts by category

我的未来我决定 提交于 2019-12-28 07:41:28
问题 scratching my head over this - help much appreciated. I want to display a list of all my Jekyll posts, organised by category. I know Line 3 isn't correct but I can't figure out what it should be. Any ideas? Thanks! {% for category in site.categories %} <h3>{{ category | first }}</h3> {% for post in page.categories.category %} {{ post.title }}<br> {% endfor %} {% endfor %} 回答1: Got it! Needed an intermediate posts loop before listing out individual posts <ul> {% for category in site.categories

Jekyll display posts by category

烂漫一生 提交于 2019-12-28 07:41:11
问题 scratching my head over this - help much appreciated. I want to display a list of all my Jekyll posts, organised by category. I know Line 3 isn't correct but I can't figure out what it should be. Any ideas? Thanks! {% for category in site.categories %} <h3>{{ category | first }}</h3> {% for post in page.categories.category %} {{ post.title }}<br> {% endfor %} {% endfor %} 回答1: Got it! Needed an intermediate posts loop before listing out individual posts <ul> {% for category in site.categories

Using asset_url within a .js.liquid file

蹲街弑〆低调 提交于 2019-12-25 11:34:38
问题 I'm coding a Shopify theme and I need to use Google Maps with custom pointers in one of my templates. I am having trouble with the asset_url working within a Javascript file so I can link correctly to my new pointer/marker graphics. Any pointers on what I'm doing wrong? I tried both of the following and neither worked: var image = { url: "url({{ 'gr_gm-pointer.png' | asset_url }})" ...etc }; and var image = { url: url({{ 'gr_gm-pointer.png' | asset_url }}) ...etc }; I'm a novice at both

How to edit content on pages for Collection Tags in Shopify

爷,独闯天下 提交于 2019-12-25 08:17:25
问题 When creating Collections in Shopify I can easily add Tags to them, which are then displayed on the Collections pages (in most of the themes I've used so far). The Collections page will typically show all the Tags for any Product within that Collection. If you click the Tag it will go to a new page. I'm trying to find a way to edit those pages - it does not appear that this ability is built into Shopify, so I'm looking for the best solution. There are easily over a hundred tags on this site

Copying generated files from a Jekyll plugin to a site resource folder

自作多情 提交于 2019-12-25 03:07:41
问题 I'm developing a plugin in Jekyll that inserts a new Liquid Tag (a block tag) named latex . It's purpose is to insert a block of LaTeX source code inside a post source file this way: ... post file contents ... {% latex density=300 usepackages=pstricks-all, %} \pspicture(5,5) \psframe(0,0)(5,5) \psline(0,0)(5,5) \psline(0,5)(5,0) \endpspicture {% endlatex %} ... post file contents ... The output post will contain a <img> tag instead of the Liquid Tag block once compiled and the LaTeX source

Why does liquid {%SEO%} tag not get integrated into head? instead it shows in body

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 01:40:08
问题 For some unknown reason any LIQUID syntax used inside <head> ends up in the <body> What I have done? 1) I cloned a template and build my own layout with JEKYLL static site generator. 2) I installed all gems (check gemlist: 'jekyll-seo-tag' 'liquid 4.0' ) 3) I configured config.yml 4) I added {%SEO%} to <head> Minimal <head> <meta charset="utf-8"> <meta name="author" content="Gino Ludikhuyze"> <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines

how in jekyll, for categories.html write a logic for posts in specific category using pagination?

左心房为你撑大大i 提交于 2019-12-24 20:43:08
问题 I have posts with post.thumb and without post.thumb, and i want to show only posts with post.thumb in structure below without using limit and offset for posts. I have a categories.html with next structure: <section class="type-one"> {% for post in pagination.posts limit:1 Offset:0 %} <div class="col-md-7"> {% include FirstPostInCategoryNews.html %} </div> {% endfor %} <div class="col-md-5 two_items_incide"> {% for post in pagination.posts limit:2 Offset:1 %} {% include

How to paginate Jekyll's data items using Liquid

会有一股神秘感。 提交于 2019-12-24 17:14:39
问题 Hi I'm trying to access elements from the previous and next arrays. To be exact I want to access the previous and next url of pages. This is what I have done so far.Thanks! {% assign page_venue = site.data.venues-array | where: "venueID", page.venue | first % //This outputs the current url {{venue.url}} This is part of the yml file: venueID: Red-Radish name: Red Radish url: redradish building: 65 neighborhood: University Union venueID: Poly-Deli name: Poly Deli url: polydeli building: 19