Skip to content

Instantly share code, notes, and snippets.

@jimrothfork jimrothfork/google-fonts.liquid Secret
Created Nov 25, 2017

Embed
What would you like to do?
{% if settings.type_base_family contains 'Google' %}
{%- assign type_base_parts = settings.type_base_family | split: '_' -%}
{% capture baseGoogleUrl %}{{ type_base_parts[1] }}:400,700{% endcapture %}
{{ '//fonts.googleapis.com/css?family=' | append: baseGoogleUrl | stylesheet_tag }}
{% endif %}
{% if settings.type_header_family contains 'Google' %}
{% unless settings.type_header_family contains type_base_parts[1] and settings.type_header_family contains '700' %}
{%- assign type_header_parts = settings.type_header_family | split: '_' -%}
{% capture headerGoogleUrl %}{{ type_header_parts[1] }}:{{ type_header_parts[2] }}{% endcapture %}
{{ '//fonts.googleapis.com/css?family=' | append: headerGoogleUrl | stylesheet_tag }}
{% endunless %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.