Last active
May 20, 2020 19:27
-
-
Save pathawks/1406355 to your computer and use it in GitHub Desktop.
Open Graph for Jekyll
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
{% if include.content %} | |
<meta property="{{ include.property }}" content="{{ include.content }}" /> | |
{% endif %} |
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
{% capture header %} | |
{% if page.title %} | |
<meta property="og:type" content="article" /> | |
<meta property="og:title" content="{{ page.title }}" /> | |
{% else %} | |
<meta property="og:type" content="website" /> | |
{% endif %} | |
{% include meta.html property="og:site_name" content=site.title %} | |
{% include meta.html property="og:image" content=page.thumbnail %} | |
{% capture page_url %}{{ page.url | replace:'/index.html','/' | append: site.url | append: site.baseurl }}{% endcapture %} | |
{% include meta.html property="og:url" content=page_url %} | |
{% capture page_date %}{{page.date | date_to_xmlschema}}{% endcapture %} | |
{% include meta.html property="article:published_time" content=page_date %} | |
{% if page.author.url %} | |
<meta property="article:author" content="{{ page.author.url }}" /> | |
<link rel="author" href="{{ page.author.url }}" /> | |
{% elsif site.owner_link %} | |
<meta property="article:author" content="{{ site.owner_link }}" /> | |
<link rel="author" href="{{ site.owner_link }}" /> | |
{% endif %} | |
{% endcapture %}{{ header | strip_newlines }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
maybe it would be better to use 'jekyll-seo-tag' plugin?