fix og and twitter cards
This commit is contained in:
parent
71589d7666
commit
ba7b77abfa
@ -1,34 +1,62 @@
|
||||
<meta property="og:site_name" content="LMNW Demo" />
|
||||
|
||||
{% if article is defined %}
|
||||
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}" />
|
||||
<meta property="og:title" content="{{ article.title | replace("\"", """) }}" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:description" content="{{ article.content | striptags | replace("\"", """) | truncate(196, False, '...') }}" />
|
||||
<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}" />
|
||||
<meta property="og:image" content="{{ SITEURL }}/images/{{ article.summaryimage }}" />
|
||||
<meta property="twitter:title" content="{{ article.title | replace("\"", """) }}" />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
<meta property="twitter:description" content="{{ article.content | striptags | replace("\"", """) | truncate(196, False, '...') }}" />
|
||||
|
||||
{% if article.date %}
|
||||
<meta property="article:published_time" content="{{ article.date.isoformat() }}" />
|
||||
{% if article.modified %}
|
||||
<meta property="article:modified_time" content="{{ article.modified.isoformat() }}" />
|
||||
{% else %}
|
||||
<meta property="article:modified_time" content="{{ article.date.isoformat() }}" />
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{ article.title | replace("\"", """) }}" />
|
||||
<meta name="twitter:description" content="{{ article.content | striptags | replace("\"", """) | truncate(196, False, '...') }}" />
|
||||
<meta name="twitter:url" content="{{ SITEURL }}/{{ article.url }}" />
|
||||
<meta name="twitter:label1" content="Written by" />
|
||||
<meta name="twitter:data1" content="Trent Palmer" />
|
||||
<meta name="twitter:site" content="@BoringTrent" />
|
||||
<meta name="twitter:creator" content="@BoringTrent" />
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/images/{{ article.summaryimage }}" />
|
||||
|
||||
{% elif page is defined %}
|
||||
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="{{ SITEURL }}/{{ page.url }}" />
|
||||
<meta property="og:title" content="{{ SITENAME }} - {{ page.title | replace("\"", """) }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:description" content="{{ page.content | striptags | replace("\"", """) | truncate(196, False, '...') }}" />
|
||||
<meta property="og:url" content="{{ SITEURL }}/{{ page.url }}" />
|
||||
<meta property="og:image" content="{{ SITEURL }}/images/LMNW+Logo+only.jpg" />
|
||||
<meta property="twitter:title" content="{{ SITENAME }} - {{ page.title | replace("\"", """) }}" />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
<meta property="twitter:description" content="{{ page.content | striptags | replace("\"", """) | truncate(196, False, '...') }}" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{ SITENAME }} - {{ page.title | replace("\"", """) }}" />
|
||||
<meta name="twitter:description" content="{{ page.content | striptags | replace("\"", """) | truncate(196, False, '...') }}" />
|
||||
<meta name="twitter:url" content="{{ SITEURL }}/{{ page.url }}" />
|
||||
<meta name="twitter:site" content="@BoringTrent" />
|
||||
<meta name="twitter:creator" content="@BoringTrent" />
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/images/LMNW+Logo+only.jpg" />
|
||||
|
||||
{% else %}
|
||||
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="{{ SITEURL }}/{{ output_file }}" />
|
||||
<meta property="og:title" content="{{ SITENAME }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:description" content="A page on Landscape Materials NW" />
|
||||
<meta property="og:url" content="{{ SITEURL }}/{{ output_file }}" />
|
||||
<meta property="og:image" content="{{ SITEURL }}/images/LMNW+Logo+only.jpg" />
|
||||
<meta property="twitter:title" content="{{ SITENAME }}" />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
<meta property="twitter:description" content="A page on Landscape Materials NW" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{ SITENAME }}" />
|
||||
<meta name="twitter:description" content="A page on Landscape Materials NW" />
|
||||
<meta name="twitter:url" content="{{ SITEURL }}/{{ output_file }}" />
|
||||
<meta name="twitter:site" content="@BoringTrent" />
|
||||
<meta name="twitter:creator" content="@BoringTrent" />
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/images/LMNW+Logo+only.jpg" />
|
||||
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user