Skip to content

Instantly share code, notes, and snippets.

@cacheleocode
Created January 29, 2015 21:40
Show Gist options
  • Select an option

  • Save cacheleocode/30682df2817b536f4712 to your computer and use it in GitHub Desktop.

Select an option

Save cacheleocode/30682df2817b536f4712 to your computer and use it in GitHub Desktop.
Pinterest article code
{% if LANG == 'en' or LANG == 'ja' %} {# pinterest only translates to english and japanese #}
<script type="text/javascript" async defer data-pin-lang="{{ LANG }}" data-pin-color="red" data-pin-height="28" data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script>
{% else %} {# pinterest without the need to translate #}
<script type="text/javascript" async defer data-pin-shape="round" data-pin-height="32" data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script>
{% endif %}
<script type="text/javascript">
$(document).ready(function() {
// disable pinterest hover on all images
$("img").attr("data-pin-no-hover", true);
// remove disabling attribute on preferred images
$("#article-header .image img, #article-header #hero img").removeAttr("data-pin-no-hover");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment