Browse Source

add info about twitter cards..

main
John-Mark Gurney 3 years ago
parent
commit
3a02e775bb
2 changed files with 10 additions and 0 deletions
  1. +9
    -0
      BLOG.md
  2. +1
    -0
      layout/base.j2

+ 9
- 0
BLOG.md View File

@@ -29,3 +29,12 @@ parent level via:
some lines some lines
```` ````
``` ```

If you want to check twitter cards, use the url: https://cards-dev.twitter.com/validator

The following additional meta data maybe added:
twittertitle: Use this instead of title
image: URL of an image to show along with the post
imagealt: Alt text for the image

[twitter card reference](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup)

+ 1
- 0
layout/base.j2 View File

@@ -33,6 +33,7 @@
{% endif %} {% endif %}
<meta property="og:description" content="{{ resource.meta.description }}" /> <meta property="og:description" content="{{ resource.meta.description }}" />
{% if resource.meta.image %} <meta property="og:image" content="{{ resource.meta.image }}" />{% endif %} {% if resource.meta.image %} <meta property="og:image" content="{{ resource.meta.image }}" />{% endif %}
{% if site.context.tweet_via %} <meta property="twitter:site:id" content="{{ site.context.tweet_via }}" /> {% endif %}
{% if resource.meta.imagealt %} <meta name="twitter:image:alt" content="{{ resource.meta.imagealt }}" />{% endif %} {% if resource.meta.imagealt %} <meta name="twitter:image:alt" content="{{ resource.meta.imagealt }}" />{% endif %}
{% if resource.meta.twitterlabel1 %} <meta name="twitter:label1" content="{{ resource.meta.twitterlabel1 }}" />{% endif %} {% if resource.meta.twitterlabel1 %} <meta name="twitter:label1" content="{{ resource.meta.twitterlabel1 }}" />{% endif %}
{% if resource.meta.twitterlabel2 %} <meta name="twitter:label2" content="{{ resource.meta.twitterlabel2 }}" />{% endif %} {% if resource.meta.twitterlabel2 %} <meta name="twitter:label2" content="{{ resource.meta.twitterlabel2 }}" />{% endif %}


Loading…
Cancel
Save