简体   繁体   English

django 社交分享按钮图标

[英]django social share button icons

I'm trying to add the functionality to share a workout post to social media, and found that the django-social-share package is the best.我正在尝试添加将锻炼帖子分享到社交媒体的功能,并发现 django-social-share 包是最好的。

Everything works, but I'm curious how to add an icon over the link, as it currently looks like一切正常,但我很好奇如何在链接上添加图标,因为它目前看起来像

Post to Facebook!

which is very bland.这是非常平淡的。 I've seen examples of adding CSS, but since the package works like我见过添加 CSS 的示例,但由于该包的工作原理类似于

{% post_to_facebook object_or_url "Post to Facebook!" %}

I'm not sure how you could target that with CSS.我不确定你如何用 CSS 来定位它。 Any help is appreciated.任何帮助表示赞赏。

You can override all templates and then add icon or change the style ..您可以覆盖所有templates ,然后添加icon或更改style ..

All templates Dir.所有模板目录。 must be in this order :必须按此顺序:

Templates
  |__ django_social_share
       |__ templatetags
             |__ post_to_facebook.html
             |__ post_to_twitter.html
             |__ send_email.html
             |__ ......
             |__ ADD ALL TEMPLATES

For Ex.对于前。 post_to_facebook.html: post_to_facebook.html:

<div class="facebook-this">                
    <a href="{{ facebook_url }}" class="{{ link_class }}" target="_blank"><i class="fa fa-facebook-square" aria-hidden="true"></i> Post to Facebook!</a>
</div>

See All Templates Here... 在此处查看所有模板...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM