make twitter cards accept hotlinked images
This commit is contained in:
parent
3d65bd2427
commit
32e84a39eb
3 changed files with 43 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
||||||
title: Site Title
|
title: Site Title
|
||||||
description: Describe your website.
|
description: Describe your website.
|
||||||
# Your site's domain goes here. Leave localhost server or blank when working locally.
|
# Your site's domain goes here. Leave localhost server or blank when working locally.
|
||||||
url: #http://localhost:4000
|
url: http://localhost:4000
|
||||||
|
|
||||||
# Owner/author information
|
# Owner/author information
|
||||||
owner:
|
owner:
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<img src="{{ site.url }}/images/{{ site.owner.avatar }}" class="bio-photo" alt="{{ site.owner.name }} bio photo"></a>
|
{% if site.owner.avatar contains 'http://' %}
|
||||||
|
<img src="{{ site.owner.avatar }}" class="bio-photo" alt="{{ site.owner.name }} bio photo"></a>
|
||||||
|
{% elsif site.owner.avatar contains 'https://' %}
|
||||||
|
<img src="{{ site.owner.avatar }}" class="bio-photo" alt="{{ site.owner.name }} bio photo"></a>
|
||||||
|
{% else %}
|
||||||
|
<img src="{{ site.url }}/images/{{ site.owner.avatar }}" class="bio-photo" alt="{{ site.owner.name }} bio photo"></a>
|
||||||
|
{% endif %}
|
||||||
<h3>{{ site.owner.name }}</h3>
|
<h3>{{ site.owner.name }}</h3>
|
||||||
<p>{{ site.owner.bio }}</p>
|
<p>{{ site.owner.bio }}</p>
|
||||||
{% if site.owner.twitter %}<a href="http://twitter.com/{{ site.owner.twitter }}" class="author-social" target="_blank"><i class="icon-twitter"></i> Twitter</a>{% endif %}
|
{% if site.owner.twitter %}<a href="http://twitter.com/{{ site.owner.twitter }}" class="author-social" target="_blank"><i class="icon-twitter"></i> Twitter</a>{% endif %}
|
||||||
|
|
|
@ -3,20 +3,43 @@
|
||||||
<meta name="description" content="{{ page.description }}">
|
<meta name="description" content="{{ page.description }}">
|
||||||
<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:image" content=
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
{% if page.image.feature contains 'http://' %}
|
<meta name="twitter:image" content=
|
||||||
"{{ page.image.feature }}"
|
{% if page.image.feature contains 'http://' %}
|
||||||
{% elsif page.image.feature contains 'https://' %}
|
"{{ page.image.feature }}"
|
||||||
"{{ page.image.feature }}"
|
{% elsif page.image.feature contains 'https://' %}
|
||||||
|
"{{ page.image.feature }}"
|
||||||
|
{% else %}
|
||||||
|
"{{ site.url }}/images/{{ page.image.feature }}"
|
||||||
|
{% endif %}
|
||||||
|
>
|
||||||
{% else %}
|
{% else %}
|
||||||
"{{ site.url }}/images/{{ page.image.feature }}">
|
<meta name="twitter:card" content="summary">
|
||||||
|
<meta name="twitter:image" content=
|
||||||
|
{% if page.image.thumb %}
|
||||||
|
{% if page.image.thumb contains 'http://' %}
|
||||||
|
"{{ page.image.thumb }}"
|
||||||
|
{% elsif page.image.thumb contains 'https://' %}
|
||||||
|
"{{ page.image.thumb }}"
|
||||||
|
{% else %}
|
||||||
|
"{{ site.url }}/images/{{ page.image.thumb }}"
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% if site.logo contains 'http://' %}
|
||||||
|
"{{ site.logo }}"
|
||||||
|
{% elsif site.logo contains 'https://' %}
|
||||||
|
"{{ site.logo }}"
|
||||||
|
{% else %}
|
||||||
|
"{{ site.url }}/images/{{ site.logo }}"
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}<meta name="twitter:card" content="summary">
|
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% 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:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
|
||||||
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
|
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">
|
||||||
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
|
{% endif %}
|
||||||
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">{% endif %}
|
|
||||||
|
|
||||||
<!-- Open Graph -->
|
<!-- Open Graph -->
|
||||||
<meta property="og:locale" content="en_US">
|
<meta property="og:locale" content="en_US">
|
||||||
|
|
Loading…
Add table
Reference in a new issue