From fa73dba4e65963e59f104556cc687b63e1a3f5f2 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 7 Dec 2014 11:54:20 -0500 Subject: [PATCH] Route share links through app --- assets/javascripts/templates/notif_tmpl.coffee | 6 ++---- lib/app.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/templates/notif_tmpl.coffee b/assets/javascripts/templates/notif_tmpl.coffee index 9dd5e78f..baad3fd1 100644 --- a/assets/javascripts/templates/notif_tmpl.coffee +++ b/assets/javascripts/templates/notif_tmpl.coffee @@ -25,7 +25,5 @@ app.templates.notifNews = (news) -> app.templates.notifShare = -> textNotif """ Hi there! """, """ Like DevDocs? Help us reach more developers by sharing the link with your friends, on - Twitter, - Facebook, - Reddit, - etc.
Thanks :)""" + Twitter, Facebook, + Reddit, etc.
Thanks :) """ diff --git a/lib/app.rb b/lib/app.rb index 11d493a1..69f13c82 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -141,6 +141,18 @@ class App < Sinatra::Application settings.news_feed end + get '/s/tw' do + redirect 'https://twitter.com/intent/tweet?url=http%3A%2F%2Fdevdocs.io&via=DevDocs&text=All-in-one%2C%20quickly%20searchable%20API%20docs%3A' + end + + get '/s/fb' do + redirect 'https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdevdocs.io' + end + + get '/s/re' do + redirect 'http://www.reddit.com/submit?url=http%3A%2F%2Fdevdocs.io&title=All-in-one%2C%20quickly%20searchable%20API%20docs&resubmit=true' + end + get %r{\A/(\w+)(\-[\w\-]+)?(/)?(.+)?\z} do |doc, type, slash, rest| return 404 unless @doc = settings.docs[doc]