-
-
Save telesma/9197078ab1e83b2db878 to your computer and use it in GitHub Desktop.
Craft CMS SEO Meta Tags
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
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link rel="icon" type="image/png" href="{{ siteUrl }}favicon.png"> | |
<title>{% if homeTitle is defined %}{{ siteName }} | {{ entry.homeTitle }}{% elseif entry.title is defined %}{{ entry.title }} | {{ siteName }}{% else %}{{ title }} | {{ siteName }}{% endif %}</title> | |
<link rel="stylesheet" href="{{ siteUrl }}assets/css/app.css" /> | |
<script src="{{ siteUrl }}assets/bower_components/modernizr/modernizr.js"></script> | |
<!-- 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.seoFeaturedImage is defined %} | |
{% if entry.seoFeaturedImage is not empty %} | |
<meta property="og:image" content="{% for image in entry.seoFeaturedImage %}{{ 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.seoFeaturedImage is defined %} | |
{% if entry.seoFeaturedImage is not empty %} | |
<meta name="twitter:image:src" content="{% for image in entry.seoFeaturedImage %}{{ image.getUrl('seoSocialShareImage') }}{% endfor %}"> | |
{% endif %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment