Skip to content

Instantly share code, notes, and snippets.

@ianshea
Created August 28, 2015 17:34
Show Gist options
  • Save ianshea/63785a3189ca004e5eef to your computer and use it in GitHub Desktop.
Save ianshea/63785a3189ca004e5eef to your computer and use it in GitHub Desktop.
Uxiliary CraftCMS Layout Template
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% if entry is defined %}
<title>{{ entry.metaTitle ? entry.metaTitle : entry.title }} | {{ siteName }}</title>
{% else %}
<title>{{ siteName }}</title>
{% endif %}
{% if entry is defined %}
<meta name="description" content="{{ entry.metaDescription ?: meta.metaDescription }}">
{% else %}
<meta name="description" content="{{ meta.metaDescription }}">
{% endif %}
<link rel="home" href="{{ siteUrl }}" />
<link rel='canonical' href='{{ siteUrl }}' />
{% includeCssFile "/assets/css/bundle.css" %}
{% includeJsFile "/assets/js/bundle.js" %}
</head>
{% set defaultOptions = { bodyClass: 'home' } %}
{% set options = options is defined ? defaultOptions | merge(options) : defaultOptions %}
<body class="{{options.bodyClass}} ">
{% block content %}
<p>If you see me, you haven’t set your <code>{% verbatim %}{% block content %}…{% endblock %}{% endverbatim %}</code> yet.</p>
<p>See Twig’s <a href="http://twig.sensiolabs.org/doc/templates.html#template-inheritance">Template Inheritance</a> documentation for an explanation.</p>
{% endblock %}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment