Skip to content

Commit

Permalink
Merge pull request mmistakes#31 from maxheld83/hotlinked-images
Browse files Browse the repository at this point in the history
Hotlinked images
  • Loading branch information
mmistakes committed Mar 14, 2014
2 parents 9c8c6fc + dfc0358 commit fd0d497
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 24 deletions.
8 changes: 7 additions & 1 deletion _includes/_author-bio.html
Original file line number Diff line number Diff line change
@@ -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>
<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 %}
Expand Down
44 changes: 37 additions & 7 deletions _includes/_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,43 @@
<meta name="description" content="{{ page.description }}">
<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 }}">
{% 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 %}">
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">{% endif %}
{% if page.image.feature %}
<meta name="twitter:card" content="summary_large_image">
<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 %}
{% 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 %}
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
<meta name="twitter:creator" content="@{{ site.owner.twitter }}">
{% endif %}

<!-- Open Graph -->
<meta property="og:locale" content="en_US">
Expand Down
20 changes: 16 additions & 4 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@

{% include _navigation.html %}

{% if page.image.feature %}<div class="image-wrap">
<img src="{{ site.url }}/images/{{ page.image.feature }}" alt="{{ page.title }} feature image">
{% if page.image.credit %}<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>{% endif %}
</div><!-- /.image-wrap -->{% endif %}
{% if page.image.feature %}
<div class="image-wrap">
<img src=
{% 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 %}
alt="{{ page.title }} feature image">
{% if page.image.credit %}
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
{% endif %}
</div><!-- /.image-wrap -->
{% endif %}

<div class="article-author-side">
{% include _author-bio.html %}
Expand Down
20 changes: 16 additions & 4 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@

{% include _navigation.html %}

{% if page.image.feature %}<div class="image-wrap">
<img src="{{ site.url }}/images/{{ page.image.feature }}" alt="{{ page.title }} feature image">
{% if page.image.credit %}<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>{% endif %}
</div><!-- /.image-wrap -->{% endif %}
{% if page.image.feature %}
<div class="image-wrap">
<img src=
{% 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 %}
alt="{{ page.title }} feature image">
{% if page.image.credit %}
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
{% endif %}
</div><!-- /.image-wrap -->
{% endif %}

<div id="main" role="main">
<div class="article-author-side">
Expand Down
20 changes: 16 additions & 4 deletions _layouts/post-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@

{% include _navigation.html %}

{% if page.image.feature %}<div class="image-wrap">
<img src="{{ site.url }}/images/{{ page.image.feature }}" alt="{{ page.title }} feature image" itemprop="primaryImageOfPage">
{% if page.image.credit %}<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>{% endif %}
</div><!-- /.image-wrap -->{% endif %}
{% if page.image.feature %}
<div class="image-wrap">
<img src=
{% 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 %}
alt="{{ page.title }} feature image">
{% if page.image.credit %}
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
{% endif %}
</div><!-- /.image-wrap -->
{% endif %}

<div class="article-author-side">
{% include _author-bio.html %}
Expand Down
20 changes: 16 additions & 4 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@

{% include _navigation.html %}

{% if page.image.feature %}<div class="image-wrap">
<img src="{{ site.url }}/images/{{ page.image.feature }}" alt="{{ page.title }} feature image">
{% if page.image.credit %}<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>{% endif %}
</div><!-- /.image-wrap -->{% endif %}
{% if page.image.feature %}
<div class="image-wrap">
<img src=
{% 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 %}
alt="{{ page.title }} feature image">
{% if page.image.credit %}
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
{% endif %}
</div><!-- /.image-wrap -->
{% endif %}

<div id="main" role="main">
<div class="article-author-side">
Expand Down

0 comments on commit fd0d497

Please sign in to comment.