File tree Expand file tree Collapse file tree
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps/cruncher/templatetags Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from django import template
44from django .conf import settings
55
6+
67register = template .Library ()
78
89
@@ -22,15 +23,15 @@ def title_and_url(obj):
2223@register .filter
2324def share_on_twitter (obj ):
2425 url , title = title_and_url (obj )
25- return "https://twitter.com/intent/tweet?text=" + url_quote (
26- (( title or "" ) + " " + (url or "" )). strip ()
26+ return (
27+ f"https://twitter.com/intent/tweet?url= { url_quote (url ) } &text= { url_quote ( title ) } "
2728 )
2829
2930
3031@register .filter
3132def share_on_linkedin (obj ):
32- url , __ = title_and_url (obj )
33- return f"https://www.linkedin.com/sharing/share-offsite/? url={ url_quote (url )} "
33+ url , title = title_and_url (obj )
34+ return f"https://www.linkedin.com/shareArticle?mini=true& url={ url_quote (url ) } &title= { url_quote ( title )} "
3435
3536
3637@register .filter
You can’t perform that action at this time.
0 commit comments