Skip to content

Commit

Permalink
Add Hacker News as a share option.
Browse files Browse the repository at this point in the history
I've left this disabled by default as it is generally only relevant to technology focused bloggers.
  • Loading branch information
Huddo121 committed Oct 18, 2016
1 parent a6ebf3a commit 67e5477
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ social:
desc: Share to Reddit
share: true

- name: "Hacker News"
icon: hacker-news
username:
url:
desc: Share to Hacker News
share: false

# Social sharing protocols
# These are for automatically generating sharing metadata for FB and Twitter
# OS Protocol is for sharing the source of your site, if you're interested. For more, see osprotocol.com
Expand Down
5 changes: 5 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ <h1 class="title">{{ page.title }}</h1>
<i class="fa fa-{{ social.icon | remove_first: '-square' }}-square fa-lg"></i>
</a>
{% endif %}
{% if social.name == "Hacker News" and social.share == true %}
<a href="//news.ycombinator.com/submitlink" onclick="window.location = '//news.ycombinator.com/submitlink?u=' + encodeURIComponent('{{ full_url }}') + '&t={{page.title}}'; return false">
<i class="fa fa-{{ social.icon | remove_first: '-square' }} fa-lg"></i>
</a>
{% endif %}
{% endfor %}
</section>
{% if site.inter_post_navigation == true %}
Expand Down

0 comments on commit 67e5477

Please sign in to comment.