~xdavidwu/xdavidwu.link

3d65bd2427355b90d5eed17b2ffeebea6ef601df — Maximilian Held 10 years ago 8b65bf0
Make twitter cards accept hotlinked images
1 files changed, 8 insertions(+), 1 deletions(-)

M _includes/_head.html
M _includes/_head.html => _includes/_head.html +8 -1
@@ 4,7 4,14 @@
<meta name="keywords" content="{{ page.tags | join: ', ' }}">
{% if site.owner.twitter %}<!-- Twitter Cards -->
{% 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">
<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 %}">