|
| 1 | +<meta name="author" content="{% if page.author %} {{ page.author }} {% else %} Compiler Research Team {% endif %}" /> |
| 2 | +<meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}" /> |
| 3 | +<meta property="og:title" content="{% if page.title %}{{ page.title | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.title }}{% endif %}" /> |
| 4 | +<meta property="og:description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}" /> |
| 5 | +<meta property="og:locale" content="en_US" /> |
| 6 | +<meta name="twitter:site" content="" /> |
| 7 | +<meta name="twitter:description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}" /> |
| 8 | +<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" /> |
| 9 | + |
| 10 | +{% assign type = "website" %} |
| 11 | +{% if page.layout == "post" %} |
| 12 | + {% assign type = "article" %} |
| 13 | +{% endif %} |
| 14 | + |
| 15 | +<meta property="og:type" content="{{ type }}" /> |
| 16 | +{% if type == "article" %} |
| 17 | + <!-- Article specific OG data --> |
| 18 | + <meta property="article:published_time" content="{{ page.date }}" /> |
| 19 | + {% if page.modified %} |
| 20 | + <meta property="article:modified_time" content="{{ page.modified }}" /> |
| 21 | + {% endif %} |
| 22 | + <meta property="article:author" content="{{ page.author }}" /> |
| 23 | + <meta property="article:publisher" content="Compiler Research Team" /> |
| 24 | + <meta property="article:section" content="{{ page.vertical }}" /> |
| 25 | + {% for tag in page.categories %} |
| 26 | + <meta property="article:tag" content="{{ tag }}" /> |
| 27 | + {% endfor %} |
| 28 | + <meta name="keywords" content="{{ page.categories | join: ', ' }}" /> |
| 29 | + <meta name="twitter:card" content="summary_large_image" /> |
| 30 | + <meta name="twitter:creator" content="" /> |
| 31 | + |
| 32 | + {% if page.ogimagenull %} |
| 33 | + <!-- no og image --> |
| 34 | + {% elsif page.banner_image %} |
| 35 | + <meta property="og:image" content="{{ page.banner_image }}" /> |
| 36 | + <meta name="twitter:image" content="{{ page.banner_image }}" /> |
| 37 | + <meta property="og:image:width" content="600" /> |
| 38 | + <meta property="og:image:height" content="315" /> |
| 39 | + {% elsif page.image %} |
| 40 | + <meta property="og:image" content="{{ page.image }}" /> |
| 41 | + <meta name="twitter:image" content="{{ page.image }}" /> |
| 42 | + {% else %} |
| 43 | + {% endif %} |
| 44 | + |
| 45 | +{% else %} |
| 46 | + <!-- OG data for non-post pages --> |
| 47 | + <meta property="og:type" content="website" /> |
| 48 | + <meta property="og:image" content="" /> |
| 49 | + <meta name="twitter:card" content="summary_large_image" /> |
| 50 | + <meta name="twitter:image" content="" /> |
| 51 | +{% endif %} |
0 commit comments