Liquid not rendering on seperate pages - jekyll

I've recently been having this problem where includes on separate pages that are not loading correctly.
This is my downloads.html:
---
layout: default
---
{% if site.downloads %}
<div class="my-6">{% include downloads.html %}</div>
{% else %}
<h2>Downloads</h2>
<p>There are no downloads at the time. Come back later!</p>
{% endif %}
But what all that shows are:
Here is my _layouts/default.html:
{% include header.html %}
{% if site.layout == 'stacked' %}
<div class="container-lg py-6 p-responsive text-center">
{% include masthead.html metadata=false %}
<div class="container-md f4 text-left border rounded-2 bg-white p-3 p-sm-5 mt-6">
<p class="f5">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:#0366d6 aria-label:Home %}Home</p>
<h1 class="f00-light lh-condensed mb-5">{{ page.title }}</h1>
{{ content }}
</div>
</div>
{% else %}
<div class="d-md-flex min-height-full {% unless site.style == 'dark' %}border-md-bottom{% endunless %}">
<div class="flex-self-stretch {% if site.style == 'dark' %}bg-gray-dark{% else %}border-md-right border-gray-light bg-white{% endif %} col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
{% include masthead.html metadata=true %}
</div>
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7 border-top border-md-top-0 bg-gray-light" {% if site.style == 'dark' %}style="background-color: #2f363d !important"{% endif %}>
<div class="mx-auto" style="max-width: 900px;">
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %}">
<p class="f5">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Home %}Home</p>
<h1 class="f00-light lh-condensed mb-5">{{ page.title }}</h1>
{{ content }}
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% include footer.html %}
Here is my _includes/downloads.html:
<h2 {% if site.style == 'dark' %}class="text-white"{% endif %}>Downloads</h2>
<p class="f4 mb-4 {% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %}">Most of my downloads/others on GitHub.</p>
<div class="d-flex flex-wrap gutter-condensed mb-4">
{% for download in site.downloads %}
<div class="col-6 col-md-12 col-lg-6 col-xl-4 mb-3">
{% include download-card.html %}
</div>
{% endfor %}
</div>
Here is my _includes/download-card.html:
{% if download.download_url %}
<a href="{{ download.download_url }}" class="github-component position-relative hover-grow height-full no-underline d-flex flex-column flex-justify-center text-center border border-gray-light rounded-1 bg-white p-5">
{% if download.image_url %}
<img src="{{ download.image_url }}" width="64" height="64" class="mx-auto rounded-1 mb-3" alt="{{ download.name }}">
{% else %}
<div
class="bg-blue-light f4 text-gray-light text-bold rounded-1 flex-shrink-0 text-center mx-auto mb-3"
style="width:64px; height:64px; line-height:64px;"
>
#
</div>
{% endif %}
<p class="f3 lh-condensed text-center link-gray-dark mb-0 mt-1">{{ download.name }}</p>
{% if download.description %}
<p class="f5 text-gray text-center mb-0 mt-1">{{ download.description }}</p>
{% endif %}
</a>
{% endif %}
And here is my _config.yml:
layout: sidebar
style: dark
plugins:
- jekyll-octicons
- jekyll-github-metadata
- jemoji
permalink: /:year/:month/:day/:title/
defaults:
- scope:
path: ""
type: "posts"
values:
layout: "post"
downloads:
- name: Test
description: This is just a test item
image_url: https://raw.githubusercontent.com/github/explore/6c6508f34230f0ac0d49e847a326429eefbfc030/topics/css/css.png
download_url: https://example.com
It renders perfectly fine on my home layout:
{% include header.html %}
{% if site.layout == 'stacked' %}
<div class="container-lg py-6 p-responsive text-center">
{% include masthead.html metadata=true %}
<div {% if site.style == 'dark' %}class="text-white"{% endif %}>
{{ content }}
</div>
{% if site.topics %}
<div class="my-6">
{% include interests.html %}
</div>
{% endif %}
{% unless posts_total == 0 %}
<div class="my-6">
{% include thoughts.html %}
</div>
{% endunless %}
</div>
{% else %}
<div class="d-md-flex min-height-full {% unless site.style == 'dark' %}border-md-bottom{% endunless %}">
<div class="flex-self-stretch {% if site.style == 'dark' %}bg-gray-dark{% else %}border-md-right border-gray-light bg-white{% endif %} col-md-5 col-lg-4 col-xl-3 px-4 px-md-6 px-lg-7 py-6">
{% include masthead.html metadata=true %}
</div>
<div class="col-md-7 col-lg-8 col-xl-9 px-4 py-6 px-lg-7 border-top border-md-top-0 bg-gray-light" {% if site.style == 'dark' %}style="background-color: #2f363d !important"{% endif %}>
<div class="mx-auto" style="max-width: 900px;">
{% unless content == "" %}
<div class="f4 {% if site.style == 'dark' %}text-white{% endif %} mb-6">
{{ content }}
</div>
{% endunless %}
{% if site.topics %}
{% include interests.html %}
{% endif %}
{% unless posts_total == 0 %}
{% include thoughts.html %}
{% endunless %}
</div>
</div>
</div>
{% endif %}
{% include footer.html %}
Thanks if you can help. I really don't know why this is happening.

Related

Change the layout of a section from slider to grid layout on mobile

I have a section that contains a slider with 5 objects in. Looks good on bigger devices, however it would be better displayed as a grid on mobile. how would I go about this but keep the slider for bigger screens. Heres the section with the slider:
<section class="{{ class_name }}" data-id={{ customer.id }} data-glide-mob data-glide-mob-small data-glider-config='{
"type": "slider",
"perView": 5,
"rewind": true,
"bound": true,
"peek": {
"before": 0,
"after": 0
},
"gap": 20,
"breakpoints": {
"768": {
"perView": 3.5,
"peek": {
"before": 0,
"after": 0
}
},
"500": {
"perView": 3,
"peek": {
"before": 0,
"after": 0
}
}
}
}'
>
{% if linklist.links.size > 0 %}
{% if linklist_header %}
<h4 class="heading-4">{{linklist_header}}</h4>
{% endif %}
<div class="glides__slides" data-glide-el="track">
<ul class="flex justify-center">
{% for link in linklist.links %}
<li>
<a href="{{ link.url }}" class="relative icon-background flex align-center justify-center">
<div class="link-icon">
{% assign landing_page = settings.alp_url | default: '/pages/account' %}
{% if link.url == landing_page %}
{% render 'icon-account-background' %}
{% elsif link.url == '/account' %}
{% render 'icon-orders-background' %}
{% elsif link.url == '/account/addresses' %}
{% render 'icon-addresses-background' %}
{% endif %}
</div>
<div class="active-background svg-product-icon-box"></div>
</a>
{{ link.title }}
</li>
{% endfor %}
<li>
<a href="/account/login#recover" data-change-password class="relative icon-background flex align-center justify-center">
<div class="link-icon">
{% render 'icon-change-password-background' %}
</div>
<div class="active-background svg-product-icon-box"></div>
</a>
{{ 'customer.account.change_password' | t }}
</li>
<!-- Begin Recharge code -->
<li>
<a href="/tools/recurring/login/" class="relative icon-background flex align-center justify-center">
<div class="link-icon">
{% render 'icon-subscriptions-background' %}
</div>
<div class="active-background svg-product-icon-box"></div>
</a>
{{ 'customer.account.manage_subs' | t }}
</li>
<!-- End Recharge code -->
</ul>
</div>
<div class="flex flex-column align-center gap-medium account-menu-bullets">
<div class="glide-bullets flex center justify-center margin-t-30" data-glide-el="controls[nav]">
{% for link in linklist.links %}
<button class="slider__bullet glide__bullet" data-glide-dir="={{ forloop.index | minus: 1 }}"></button>
{% endfor %}
</div>
<div class="glide__arrows flex justify-center align-center gap-small" data-glide-el="controls">
<button class="glide__arrow glide__arrow--left" data-glide-dir="<" data-glide-btn>
<span class="svg-disable" data-glide-arrow-left >
{% render 'svg-arrow-left' %}
</span>
</button>
<button class="glide__arrow glide__arrow--right" data-glide-dir=">" data-glide-btn>
<span data-glide-arrow-right>
{% render 'svg-arrow-right' %}
</span>
</button>
</div>
</div>
{% endif %}
</section>
If you need different code let me know and i will send it over

Building a dropdown filter

I was wondering if I can have assistance with building a dropdown filter for classes. I was looking at this example: https://codepen.io/luciopaiva/pen/YXYGYE?editors=101 but the difference is that I am using Twig from Advanced Custom Fields Plugin so I cannot manually input the data into the HTML. Here is the HTML I am using. I am trying to make it like this photo. See image here I don't have styling, but this is the logic I am trying to achieve. Basically I am trying to build a relative filter based on what the visitor clicks and have the correct box show below relative to the course. PLEASE HELP!! Thank you!
HTML:
<div class="course-selections filter-section without-background no-left-right">
<div class="customlayout">
{% set category = bloc.training_course_list_compact %}
<h2 class="center-title">{{ category.headline }}</h2>
<div class="inner-class-selection filter-inner-section">
<div class="filter-courses filter-area">
<div class="filter" id="course-solution">
<div class="upper-filter"><h3>Solutions</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% set titleupper = category.title %}
<h4>{{ titleupper|e('wp_kses_post') }}</h4>
{% endfor %}
</div>
</div>
<div class="filter" id="course-type">
<div class="upper-filter"><h3>Class Format</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% for course in category.get_field('courses') %}
{% for classformats in course.get_field('dates') %}
{% set classformat = classformats.class_format %}
{% if classformat == "Lecture" %}
<div class="class-types type-filter lecture"></div>
{% elseif classformat == "Online" %}
<div class="class-types type-filter online"></div>
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
<div class="class-title-type type-filter lecture-type"><h4></h4><span></span>
</div>
<div class="class-title-type type-filter online-type"><h4></h4><span></span>
</div>
</div>
</div>
<div class="filter" id="course-location">
<div class="upper-filter"><h3>Locations</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% for locationcourse in category.get_field('courses') %}
{% for location in locationcourse.get_field('dates') %}
<div class="course-location" data-value="{{ location.location }}"></div>
{% endfor %}
{% endfor %}
{% endfor %}
<div class="class-location type-filter"></div>
</div>
</div>
<div class="filter" id="course-date">
<div class="upper-filter"><h3>Start Date</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% for datecourse in category.get_field('courses') %}
{% for dates in datecourse.get_field('dates') %}
<div class="course-date" data-value="{{ dates.date }}"></div>
{% endfor %}
{% endfor %}
{% endfor %}
<div class="class-date type-filter"></div>
</div>
</div>
</div>
<div class="class-blocks">
{% for category in bloc.training_course_list_compact.course_categories %}
{% set thumbnail = category.thumbnail %}
{% set link = category.link %}
{% set titleupper = category.title %}
{% for course in category.get_field('courses') %}
{% set link = course.link %}
{% set title = course.title %}
<div class="class-block">
<a class="class-block-link" href="{{ link|e('esc_url') }}">
<div class="image">
</div>
<h3>{{ title|e('wp_kses_post') }}</h3>
<h4>{{ titleupper|e('wp_kses_post') }}</h4>
</a>
<a class="course-link" href="{{ link|e('esc_url') }}">Course</a>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
</div>

how to set the whole back ground of col-sm-1 to #F7F7F7

my website uses bootstrap grid system of col-sm-1/col-sm-9/col-sm-2. And I want to the whole background of col-sm-1 to be #F7F7F7. Thing is I want it to be like the far left side of reddit
but when I tried to manipulate my web, I see only the div that has content on col-sm-1 changes its color.
<div class="col-sm-1">
<div class="row-fluid">
<h5 class="tag-name"></h>
</div>
{% if user.is_authenticated %}
{% if following %}
<h5 class="tag-named"><em>follow</em></h5>
<div class="tagging">
<div class="tab-pane{% if active_tab == 'connections' %} active{% endif %}" id="connections">
{% for a in following %}
<li style="padding:0.01em; list-style-type: square;"><a id="following-link" href="{{ a.get_absolute_url }}">{{ a }}</a></li>
<br />
{% endfor %}
</div>
</div>
{% else %}
<p class="tag-named" style="font-size:12px; text-align:left;"><em>enter followingcommunity <i class="fa fa-folder-open"></i>
hello</em></p>
{% endif %}
{% else %}
<p class="tag-named" style="font-size:12px; text-align:left;"><em>now login</em>
</p>
{% endif %}
</div>
please ignore django template language {{}}, as this needs to be done with awesome css.

Why isn't this a tag clickable?

{%if collection.title == "Meat"%}
{% if collection.image %}<div class="collection-image" style="background-image: url('{{ collection.image | img_url: '1024x1024' }}'); max-height:400px; "> {% endif %}
<div class="collection-title text-center" style="padding: 50px 0;">
<h1 class="collection-text--headline title text-center" style="margin-top:30px;">{{ collection.title }}</h1>
{% if collection.description.size > 0 %}
<div class="collection-text--body text-center rte large--three-fifths push--large--one-fifth">
<h4>{{ collection.description }}</h4>
</div>
{% endif %}
</div>
<div class="text-center" style="margin-top: -40px;
padding-bottom: 100px;">
<a href="http://www.greensburymarket.com/collections/all" class="btn btn--large btn--splash uppercase sec-col-button" >Learn More</a>
</div>
{% if collection.image %}<div class="collection-image-overlay"></div>
</div>
{% endif %}
know this is a stupid question but I am stumped. tried moving things around. No idea why this doesnt work

how to make these div blocks on same line?

My newsletters does not want to be on the same line as the other three blocks, it goes on a second line under the blogpost. Can someone tell me how to fix this in a very noob friendly term i am not good at programming.
<div class="footer-wrapper">
<footer>
<div class="row">
<div class="span12 full-border"></div>
<!-- Begin latest blog post -->
{% if settings.footer_blog_post and blogs[settings.footer_blog_post].handle == settings.footer_blog_post and blogs[settings.footer_blog_post].articles.size > 0 %}
{% assign article = blogs[settings.footer_blog_post].articles.first %}
<div class="span4">
<div class="p30">
<h4>{{ settings.footer_blog_post_header }}</h4>
<p class="p10"><strong>{{ article.title | link_to: article.url }}</strong></p>
<p>{{ article.content | strip_html | truncatewords: 30 }}</p>
</div>
</div>
{% endif %}
<!-- End latest blog post -->
<!-- Begin footer navigation -->
<div class="span4 footer-menu">
<h4>{{ settings.footer_linklist_title }}</h4>
<ul class="unstyled">
{% for link in linklists[settings.footer_linklist].links %}
<li>{{ link.title }}</li>
{% endfor %}
</ul>
</div>
<!-- End footer navigation -->
<!-- Begin newsletter/social -->
<div class="clearfix">
{% if settings.enable_social_links %}
<h4>{{ settings.footer_social_title }}</h4>
{% if settings.twitter_link != '' %}Twitter{% endif %}
{% if settings.facebook_link != '' %}Facebook{% endif %}
{% if settings.youtube_link != '' %}YouTube{% endif %}
{% if settings.atom_link != '' %}Blog feed{% endif %}
{% if settings.instagram_link != '' %}Instagram{% endif %}
{% if settings.pinterest_link != '' %}Pinterest{% endif %}
{% if settings.vimeo_link != '' %}Vimeo{% endif %}
{% if settings.tumblr_link != '' %}Tumblr{% endif %}
{% if settings.google_link != '' %}Google+{% endif %}
{% endif %}
</div>
<div class="span4">
{% if settings.footer_display_newsletter %}
<div class="p30">
<h4>{{ settings.footer_newsletter_title }}</h4>
<form action="{{ settings.mailing_list_form_action }}" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank">
<input type="email" value="" placeholder="Email Address" name="EMAIL" id="mail" /><input type="submit" class="btn newsletter" value="Subscribe" name="subscribe" id="subscribe" />
</form>
</div>
{% endif %}
</div>
</div>
<!-- End newsletter/social -->
<!-- Begin copyright -->
<div class="span12 tc copyright">
<p>Copyright © {{ 'now' | date: "%Y" }} {{ shop.name }} <!--| {{ powered_by_link }}--> {% if settings.designed_by %}{% endif %} </p>
<ul class="credit-cards clearfix">
{% if settings.accept_visa %}<li><img src="{{ 'icon-cc-visa.gif' | asset_url }}" alt="Visa" /></li>{% endif %}
{% if settings.accept_mastercard %}<li><img src="{{ 'icon-cc-mastercard.gif' | asset_url }}" alt="MasterCard" /></li>{% endif %}
{% if settings.accept_amex %}<li><img src="{{ 'icon-cc-amex.gif' | asset_url }}" alt="Amex" /></li>{% endif %}
{% if settings.accept_cirrus %}<li><img src="{{ 'icon-cc-cirrus.gif' | asset_url }}" alt="Cirrus" /></li>{% endif %}
{% if settings.accept_delta %}<li><img src="{{ 'icon-cc-delta.gif' | asset_url }}" alt="Delta" /></li>{% endif %}
{% if settings.accept_discover %}<li><img src="{{ 'icon-cc-discover.gif' | asset_url }}" alt="Discover" /></li>{% endif %}
{% if settings.accept_westernunion %}<li><img src="{{ 'icon-cc-westernunion.gif' | asset_url }}" alt="Western Union" /></li>{% endif %}
{% if settings.accept_paypal %}<li><img src="{{ 'icon-cc-paypal.gif' | asset_url }}" alt="PayPal" /></li>{% endif %}
{% if settings.accept_bitcoin %}<li><img src="{{ 'icon-cc-bitcoin.gif' | asset_url }}" alt="Bitcoin" /></li>{% endif %}
</ul> <!-- /.credit-cards -->
</div>
<!-- End copyright -->
</div>
</footer>
apply this for all div style :
{display:inline;
float:left;}