Make twitter cards accept hotlinked images
This commit is contained in:
parent
8b65bf0fac
commit
3d65bd2427
1 changed files with 8 additions and 1 deletions
|
@ -4,7 +4,14 @@
|
||||||
<meta name="keywords" content="{{ page.tags | join: ', ' }}">
|
<meta name="keywords" content="{{ page.tags | join: ', ' }}">
|
||||||
{% if site.owner.twitter %}<!-- Twitter Cards -->
|
{% if site.owner.twitter %}<!-- Twitter Cards -->
|
||||||
{% if page.image.feature %}<meta name="twitter:card" content="summary_large_image">
|
{% if page.image.feature %}<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.feature }}">
|
<meta name="twitter:image" content=
|
||||||
|
{% if page.image.feature contains 'http://' %}
|
||||||
|
"{{ page.image.feature }}"
|
||||||
|
{% elsif page.image.feature contains 'https://' %}
|
||||||
|
"{{ page.image.feature }}"
|
||||||
|
{% else %}
|
||||||
|
"{{ site.url }}/images/{{ page.image.feature }}">
|
||||||
|
{% endif %}
|
||||||
{% else %}<meta name="twitter:card" content="summary">
|
{% else %}<meta name="twitter:card" content="summary">
|
||||||
<meta name="twitter:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/{{ site.logo }}{% endif %}">{% endif %}
|
<meta name="twitter:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/{{ site.logo }}{% endif %}">{% endif %}
|
||||||
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
|
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
|
||||||
|
|
Loading…
Reference in a new issue