FAQ Database Discussion Community


Custom yaml syntax

ruby,yaml,jekyll,liquid
Im using Jekyll and liquid syntax and would like to add a custom background colour and thumbnail image for each of my projects on my homepage. How can I achieve this using YAML frontmatter? liquid syntax outputting projects {% for post in site.categories['project'] %} <div class="project"> <h3 class="project__title">{{ post.title }}</h3>...

Shopfy accessing all products from a collection on the product page

collections,shopify,product,liquid
I'm using Shopify as my eCommerce platform. My customer has some products that are related to each other. But don't think of a typical related products system, basically these products have parts, and those individual parts can be reordered separate from the product itself. The client wants to list all...

How to know if an URL is relative or absolute in Jekyll?

jekyll,liquid,github-pages
I'm trying to do the following in Jekyll: I have an URL; This URL can be relative ("/media/image.jpg") or absolute "http://example.com/image.jpg"; If the URL is relative I have to append to its beginning my site domain ("http://my-site/media/image.jpg"). If don't, nothing changes. Sadly I have no clue yet on how to...

Jekyll and Liquid for-loop

html5,for-loop,navigation,jekyll,liquid
I want to create a little side navigation vor on-page navigation. The site contains multiple images one above the other, the navigation is inside every single image and is linking to the individual id's. I am using jekyll with the liquid templating engine. To not hard code every single element...

How to concatenate the value of iterator inside liquid tag (Jekyll)

ruby,for-loop,yaml,jekyll,liquid
I am looping through a Yaml object and need to append the value of 'i' to the address the proper object. <div class="chapter"> {% for i in (1..7) %} <strong class="title">{{ page.chapters.title + i }}</strong> <ul> {% for topic in page.chapters.ch + i %} <li> {{ topic }} </li> {%...

Jekyll - How can I make avoid a paragraph to be added on a YAML frontmatter markdownify item

ruby,jekyll,liquid,github-pages
Okay... I have a project where I'm using Jekyll for a podcast project. And I chose to list the hosts in the shownotes by a YAML Front Matter item: hosts: - Name A - Name B - Name C Using this piece of code <li> <strong>Hosts:</strong> <ul> {% for host...

Get a list of collections for all products in current Shopify collection

shopify,liquid
We have a primary collection of t-shirts for the product type of clothing (product type is just in case, so, nobody would bring it up). And all of them are also in a few other collections like "linen t-shirts", "silk t-shirts" etc. Let's say i'm on the page of t-shirts...

Is it possible to combine variables a jeykll if statement?

jekyll,liquid
Is it possible to combine both site.url and page.url in a jeykll template if statement, for example (it doesn't work this way though): {% if comment.path == {{ site.url }}{{ page.url}} %} ...

Variable within liquid if statement when calling shopify settings

shopify,liquid
I thought this would be simple to solve but I am trying to put a variable within a liquid statement. I have my variable {{ loop_index }} and I want it to be within this statement : {% if settings.dropdown-[loop_index]-select %} I tried putting [...] round it but that didn't...

sorting of collection does not work

jekyll,liquid
I have encountered a strange behaviour when I try to sort a collection. When I sort a collection with name "collection_name" by {% assign collection = site.collection_name | sort:"weight" %} there is no problem. All collections are available in site.collections and the same collection can be accessed via {% assign...

Why are code tags being inserted by liquid/jekyll and how do I remove them?

jekyll,liquid
I want to create a list of recent authors for a blog I'm developing using Jekyll. I'm taking the list of recent authors and looking up each item in a yml data sheet I've set up that lists each author and their bio, name and email etc. I'm able to...

Shopify cycle iteration to simplify

loops,logic,shopify,liquid
I am trying to use the cycle in shopify to add a class to the first 4 divs, then a new class to the second 4 divs, then a new class to the 3rd group of divs. Instead of typing like this {% cycle '<div class="1">', '<div class="1">', '<div class="1">',...

Shopify: how to add a class depending on collection

collections,filtering,shopify,liquid
On a clients homepage they want 'all the products' listed with a load more button at the bottom. There are four categories and each has a different color associated. I want to pull in all the products by date listed order and apply a class to the product depending on...

Jekyll: Using liquid tags in .md files

html,markdown,jekyll,liquid
I am working on a project using Jekyll. Looking online, it seems that it is possible to use liquid tags in a markdown file. For some reason, the liquid tags are not working in my markdown files. I want to use the liquid "capture" tag to store text in a...

Liquid parsing date incorrectly

ruby-on-rails,parsing,date,liquid
I have a file standard_en.html with the following code: <td class="title">Date of Birth</td> <td colspan="2"> {{ meta/birth_date | date: "%m/%d/%Y" }} </td> This is outputting 08/18/1970, which is the wrong date. If I replace the liquid line with just {{ meta }} it outputs:...

Multiple Paragraph Tags Being Outputted in Jekyll

html,jekyll,liquid
I can't work out why, but for some reason there are multiple empty paragraph tags being outputted on my page. My template looks like this: <article class="post-item sm-col sm-col-12 md-col md-col-5 {{ thecycle }}"> <header> <h3><a href="{{ post.url }}">{{ post.title }}</a></h3> </header> <p>{{ post.excerpt }}<p> <footer> <p class="date"><time pubdate datetime="{{...

How do I change the title-Attribut in Shopify's liquid?

html,shopify,liquid
Can someone explain me how do I change the title-Attribut here. liquid code <ul class="material-nav"> {% for tag in collection.all_tags %} {% if current_tags contains tag %} <li class="active"> {{ tag | capitalize | link_to_tag: tag }} </li> {% else %} <li> {{ tag | capitalize | link_to_tag: tag }}...

Edge-case using ng-model in angularjs forms

javascript,html,angularjs,forms,liquid
I have an annoying edge case that I'm dealing with and would love some help. The situation: I'm working on an angular app that is a 'theme' for a donation platform; the donation platform allows us to host theme files (images, stylesheets, javascript, html markup, etc.) the platform uses liquid...

Markdown compiling images with paragraph tags

markdown,jekyll,liquid,github-pages
This is just a simple problem but it's one that I can't find on Google to solve this. Basically what is happening is that I have a Jekyll website, and I'm using kramdown for the markdown compiling. When I add an image to a markdown file like below: ![Image Alt...

Shopify vendor if statement

shopify,liquid
A shopify liquid question: If no vendor is available, then shopify adds the shop name as the default vendor. I'd like those instances to be blank. I'm trying to create an if statement which hides the vendor if there is no vendor or if it equals the default vendor name....

Shopify liquid get related blog posts

html,shopify,liquid,templating
In shopify I am using liquid templating to get blog posts which are related to products by their tags, like so: <ul> {% for article in blogs.blog.articles %} {% if article.tags contains product.handle %} <li><a href="{{ article.url }}"><p>{{ article.title }}</p></a></li> {% endif %} {% endfor %} </ul> However, if there...

business catalyst unable to output webapp description with liquid

liquid,business-catalyst
I am using liquid to cycle through all the items of a webapp and output the various fields. This works fine but for some reason I cannot output the description field. The following code is a simplified version of what I am using: {module_webapps id="26025" collection="tutors" filter="all" template=""} {% for...

Dynamically add and filter images in Jekyll for github pages?

jekyll,liquid,github-pages
I am trying out Jekyll to help someone who's not all that technical maintain their own static site. I would like to be able to have a images directory in the app's root /images containing images following a naming convention: post_one_1.jpg, post_one_2.jpg, post_two_1.jpg, post_two_2.jpg ... etc. I would then like...

How to iterate through the top 3 posts from the last two weeks in liquid/jekyll?

jekyll,liquid
Let me add some context: i'm trying to automate my boring reports to management using jekyll! I'd like to write a post for every activity i do and, every week, ship the compiled report with the "top 3 highlights" from this week and from last week. My shot at it,...

{{ content }} Liquid tag not showing blog posts

html,tags,jekyll,shopify,liquid
Link to repo: https://github.com/AlvSovereign/AlvSovereign.github.io Hi all I am a beginner using jekyll and new to web development, so please be patient with me. I am coding my portfolio site, with a link to my blog. The fully processed portfolio site sits in _site/index.html which contains a link to the blog...

Is there way in Shopify to categorize “Collections” in lists?

collections,tags,shopify,product,liquid
Say I want to show 2 different collection lists(just the titles with links to their relative pages) on 2 different pages in Shopify; is there a way in Shopify that can be done? As far as I can see, either I show all "Collections" on a page or none at...

Is there a way for concatenate two strings and then process the result inside the Output tags not as a string?

shopify,liquid
Here's what I am trying to accomplish: <ul class="site-nav__dropdown"> {% for childlink in linklists[child_list_handle].links %} this - {% assign color_from_settings = 'settings.collection_color_' | append: forloop.index %} used here - <li{% if childlink.active %} class="site-nav--active" {% else %} style="background-color: {{ color_from_settings }}" {% endif %}> <a href="{{ childlink.url }}" class="site-nav__link">{{ childlink.title...

shopify liquid: plus shipping cost not working

shopify,liquid
I want to multiply the subtotal price by 21% and then add the shipping costs. Because the shipping costs are variable I use the following code. {{ order.subtotal_price | times:1.21 | plus:shipping_method.price | money }} But the shipping costs aren't added. The example code in the documentation states you can...

Merge two sources into one feed.xml

jekyll,liquid
My Jekyll side uses the default feed.xml. I would like to change that because I have site.posts and site.screencasts. Both have the needed attributes to be shown in feed.xml. The default runs this loop: {% for post in site.posts limit:10 %} ... {% endfor %} Is there a way to...

Why is the site.categories array not being output in Jekyll?

jekyll,liquid,jekyll-extensions
I'm building pages (not posts) in Jekyll. One page defines 2 categories in the front-matter as follows: categories: [document, new] And then in a layout I'm trying to output the categories object/array, but nothing is being output: <h1>Array: {{ site.categories }}</h1> Why wouldn't this output an array as expected?...