Permalink
Browse files

Add HackerNews voting button.

  • Loading branch information...
1 parent b2ac9f8 commit 8ae39b2448fdfe984e19d28b349c719e93977861 @lethain committed Nov 26, 2012
Showing with 20 additions and 2 deletions.
  1. +1 −0 static/hn.min.js
  2. +4 −0 static/sisyphus.css
  3. +14 −2 templates/sisyphus/page_detail.html
  4. +1 −0 templates/sisyphus/social.html
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -176,6 +176,10 @@ h1, h2, h3, h4, h5, #hd, #searchbutton, #searchbox {
margin: 10px 20px;
}
+#body .page .social a.hn-share-button {
+ display: none;
+}
+
#body .summary, #body .page .text p, #body .page pre, #body .page li {
margin: 10px 10px 10px 20px;
@@ -4,7 +4,19 @@
{% block title %}{{ page.title }} - {{ block.super }}{% endblock %}
{% if page.startjs %} {% block extrajs %}{{ block.super }}{{ page.startjs|safe }}{% endblock %}{% endif %}
-{% if page.endjs %} {% block extrajsend %}{{ block.super }}{{ page.endjs|safe }}{% endblock %}{% endif %}
+
+{% block extrajsend %}
+{{ block.super }}
+{% if page.endjs %}{{ page.endjs|safe }}{% endif %}
+<script>
+ (function(d, t) {
+ var g = d.createElement(t),
+ s = d.getElementsByTagName(t)[0];
+ g.src = '/static/hn.min.js';
+ s.parentNode.insertBefore(g, s);
+ }(document, 'script'));
+</script>
+{% endblock %}
{% block body %}
<div class="page">
@@ -33,7 +45,7 @@ <h2>{% if not page.published %}<strong>DRAFT - </strong>{% endif %}<a href="/{{
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
-{% endif %}
+{% endif %}
{% endblock %}
@@ -2,4 +2,5 @@
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="{{ twitter_username }}">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<iframe id="fb" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2F{{ domain }}%2F{{ page.slug }}%2F&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=lucida+grande&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>
+<a href="http://news.ycombinator.com/submit" class="hn-share-button" data-title="{{ page.title }}" data-url="http://{{ domain }}/{{ page.slug }}/">Vote on HN</a>
</div>

0 comments on commit 8ae39b2

Please sign in to comment.