Skip to content

Instantly share code, notes, and snippets.

@resistorsoftware
Created June 24, 2011 02:16
Show Gist options
  • Save resistorsoftware/1044095 to your computer and use it in GitHub Desktop.
Save resistorsoftware/1044095 to your computer and use it in GitHub Desktop.
A Liquid Snippet for the Meta-Titler Shopify App
{% capture title %}<title>{{ shop.name }} &#124; {{ page_title }}</title>{% endcapture %}
{% if template == 'product' %}
{% assign mf = product.metafields.meta_data %}
{% unless mf == empty %}
{% for mf in product.metafields.meta_data' %}
{% capture key %}{{ mf | first }}{% endcapture %}
{% if key == 'title' %}
{% capture title %}<title>{{mf | last}}</title>{% endcapture %}
<meta name="title" content="{{mf | last}}" />
{% endif %}
{% if key == 'meta_description' %}
<meta name="description" content="{{mf | last}}" />
{% endif %}
{% if key == 'keywords' %}
<meta name="keywords" content="{{mf | last}}" />
{% endif %}
{% endfor %}
{% endunless %}
{% elsif template == 'page' %}
{% assign mf = page.metafields.meta_data %}
{% unless mf == empty %}
{% for mf in page.metafields.meta_data' %}
{% capture key%}{{ mf | first }}{%endcapture%}
{% if key == 'title' %}
{% capture title %}<title>{{mf | last}}</title>{% endcapture %}
<meta name="title" content="{{mf | last}}" />
{% endif %}
{% if key == 'meta_description' %}
<meta name="description" content="{{mf | last}}" />
{% endif %}
{% if key == 'keywords' %}
<meta name="keywords" content="{{mf | last}}" />
{% endif %}
{% endfor %}
{% endunless %}
{% endif %}
{{title}}
@lukegraham
Copy link

Enviromental Led Lighting Solutions provides led strip lighting, waterproof rgb led strip lights in Australia.We also offer a wide variety of LED flood lights, LED spotlight bulbs, track lighting, LED controllers, color changing, chasing, sequencing with a variety of moving functions, and so much more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment