Last active
December 29, 2016 16:01
-
-
Save DanRader/5dd3985ce37bf0cf1f5d9f147d1c906d to your computer and use it in GitHub Desktop.
Jekyll Custom SEO tagging that works better with Siteleaf. This is really similar to the Jekyll SEO tag plugin except it lets you override the og image with a custom image if you have one. If there isn't a custom image, it takes whatever image is on the page.
This file contains hidden or 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
| <title>{{ page.title }} - {{site.title}}</title> | |
| <meta property="og:title" content="{{ page.title }}" /> | |
| <meta name="description" content="{{ page.excerpt | strip_html }}"/> | |
| <meta property="og:description" content="{{ page.excerpt | strip_html }}"/> | |
| <link rel="canonical" href="{{site.url}}{{page.url}}" /> | |
| <meta property="og:url" content="{{site.url}}{{page.url}}" /> | |
| <meta property="og:site_name" content="{{site.title}}" /> | |
| {% if page.og-image %} | |
| <meta property="og:image" content="{{ site.url }}{{ page.og-image }}" /> | |
| {% else %} | |
| <meta property="og:image" content="{{ site.url }}{{ page.image }}" /> | |
| {% endif %} | |
| <meta property="og:type" content="article" /> | |
| <meta property="article:published_time" content="{{ page.date }}" /> | |
| <script type="application/ld+json"> | |
| {"@context": "http://schema.org", | |
| "@type": "BlogPosting", | |
| "headline": "{{ page.title }}", | |
| "image": "{{ site.url }}{{ page.image }}", | |
| "datePublished": "{{ page.date }}", | |
| "description": "{{ page.excerpt | strip_html }}", | |
| "url": "{{site.url}}{{page.url}}"}</script> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With this set up, you're able to use Siteleafs smart field names so your user can use the 'file fields' and have a more visual selector.