Created
February 1, 2016 05:58
-
-
Save telesma/c49bf0e00d98e529e8e5 to your computer and use it in GitHub Desktop.
Craft CMS Basic Meta Information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- General Page Meta --> | |
{% if entry.seoDescription is defined %} | |
{% if entry.seoDescription is not empty %} | |
<meta name="description" content="{{ entry.seoDescription }}"> | |
{% endif %} | |
{% endif %} | |
{% if entry.seoKeywords is defined %} | |
{% if entry.seoKeywords is not empty %} | |
<meta name="keywords" content="{{ entry.seoKeywords }}"> | |
{% endif %} | |
{% endif %} | |
<!-- Facebook Meta Tags --> | |
{% if entry.title is defined %} | |
<meta property="og:title" content="{{ entry.title }}"> | |
{% endif %} | |
<meta property="og:site_name" content="{{ siteName }}"> | |
<meta property="og:url" content="{{ url(craft.request.path) }}"> | |
{% if entry.seoDescription is defined %} | |
{% if entry.seoDescription is not empty %} | |
<meta property="og:description" content="{{ entry.seoDescription }}"> | |
{% endif %} | |
{% endif %} | |
{% if entry.seoImage is defined %} | |
{% if entry.seoImage is not empty %} | |
<meta property="og:image" content="{% for image in entry.seoImage %}{{ image.getUrl('seoSocialShareImage') }}{% endfor %}"> | |
{% endif %} | |
{% endif %} | |
<meta property="og:type" content="website"> | |
<!-- Twitter Meta Tags --> | |
<meta name="twitter:card" content="summary_large_image"> | |
{% if entry.title is defined %} | |
<meta name="twitter:title" content="{{ entry.title }}"> | |
{% endif %} | |
{% if entry.seoDescription is defined %} | |
{% if entry.seoDescription is not empty %} | |
<meta name="twitter:description" content="{{ entry.seoDescription }}"> | |
{% endif %} | |
{% endif %} | |
{% if entry.seoImage is defined %} | |
{% if entry.seoImage is not empty %} | |
<meta name="twitter:image:src" content="{% for image in entry.seoImage %}{{ image.getUrl('seoSocialShareImage') }}{% endfor %}"> | |
{% endif %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment