Skip to content

Head meta

The below snippet handles:

  • Default / fallback meta description applied to all pages
  • Home page meta title and description inherited from a page titled Home, if it exists
  • Defined SEO Title and SEO Description fields used for Page, Post and Division templates
  • Current division appended to model name on Model template
  • Agency name appended after all titles
  • OpenGraph and Twitter meta tags (an og-image.png image asset is expected)
  • Common favicon markup (expects corresponding assets)
  • noindex meta tag for packages and other defined templates
liquid
{% comment %} Meta title & description {% endcomment %}
{% assign metaDesc = "Default meta description" %}
{% assign pageTitle = page_name %}

{% if meta_title %}
  {% assign metaTitle = meta_title %}
{% endif %}
{% if meta_description %}
  {% assign metaDesc = meta_description %}
{% endif %}
{% if template == 'home' %}
  {% assign hasCustomTitle = false %}
  {% for page in pages %}
    {% if page.url == 'home' %}
      {% if page.meta_title %}
        {% assign pageTitle = page.meta_title %}
        {% assign hasCustomTitle = true %}
      {% endif %}
      {% if page.meta_description %}
        {% assign metaDesc = page.meta_description %}
      {% endif %}
    {% endif %}
  {% endfor %}
  {% if hasCustomTitle == false %}
    {% assign metaTitle = agency.name %}
  {% endif %}
{% elsif template == 'model' %}
  {% assign pageTitle = model.display_name %}
  {% if division %}
    {% assign pageTitle = pageTitle | append: ' | ' | append: division.name %}
  {% endif %}
{% elsif template == 'model_submission' %}
  {% assign pageTitle = "Apply" %}
  {% assign metaDesc = "" %}
{% endif %}
{% unless metaTitle %}
  {% assign metaTitle = pageTitle | append: ' | ' | append: agency.name %}		
{% endunless %}

<title>{{ metaTitle }}</title>
<meta name="description" content="{{ metaDesc }}" />

{% comment %} No index {% endcomment %}
{% assign noIndexTemplates = 'castings,404' | split: ',' %}
{% if package or noIndexTemplates contains template %}
  <meta name="robots" content="noindex">
{% endif %}

{% comment %} Social meta {% endcomment %}
<meta property="og:locale" content="en_US">
<meta property="og:type" content="website">
<meta property="og:title" content="{{ metaTitle }}">
<meta property="og:description" content="{{ metaDesc }}">
<meta property="og:url" content="{{ page_url | replace: 'http:', 'https:' }}">
<meta property="og:site_name" content="{{ agency.name }}">
<meta property="og:image" content="{{ 'og-image.png' | asset_url }}">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:title" content="{{ metaTitle }}">
<meta name="twitter:url" content="{{ page_url | replace: 'http:', 'https:' }}">
<meta name="twitter:card" content="summary">
<meta name="twitter:description" content="{{ metaDesc }}">

{% comment %} Favicon {% endcomment %}
<link rel="icon" type="image/x-icon" href="{{ 'favicon.ico' | asset_url }}">
<link rel="icon" type="image/png" href="{{ 'favicon-16x16.png' | asset_url }}" sizes="16x16">
<link rel="icon" type="image/png" href="{{ 'favicon-32x32.png' | asset_url }}" sizes="32x32">
<link rel="icon" type="image/png" href="{{ 'favicon-96x96.png' | asset_url }}" sizes="96x96">
<link rel="apple-touch-icon" href="{{ 'apple-icon-180x180.png' | asset_url }}" sizes="180x180">