一键分享博客或新闻到Teams好友或频道
在最近的開發(fā)者工具更新中,Teams提供了一個(gè)Share to Teams的能力,就是在你的網(wǎng)頁(yè)上面,放置一個(gè)按鈕,用戶點(diǎn)擊后,就可以很方便地將當(dāng)前網(wǎng)頁(yè)或者你指定的其他網(wǎng)頁(yè),分享到Teams好友或頻道中。
這個(gè)開發(fā)文檔在這里,請(qǐng)參考 https://docs.microsoft.com/en-us/microsoftteams/platform/share-to-teams
這個(gè)功能非常好,歡迎大家試用。另外,我因?yàn)殚L(zhǎng)期有寫博客的習(xí)慣,我也順便改造了一下博客的系統(tǒng),添加了這個(gè)按鈕。
點(diǎn)擊該按鈕后,會(huì)彈出一個(gè)對(duì)話框
在這個(gè)對(duì)話框中,可以選擇分享的目標(biāo),然后還可以添加說(shuō)明文字,然后點(diǎn)擊“共享”按鈕
此時(shí)如果切換到Teams,就可以看到已經(jīng)有一個(gè)消息分享過(guò)來(lái)
看起來(lái)還不錯(cuò)吧,還等什么呢?趕緊在你的網(wǎng)站中添加這個(gè)功能吧。
文末福利
我的博客是在博客園寫的,如果你正好也是在這個(gè)平臺(tái),你可以通過(guò)我寫好的下面的代碼快速添加。
<style> .divblock { padding: 10px; margin-bottom: 10px; margin-top: 10px; margin-right: 10px; border: #c0c0c0 1px dashed; text-align: left; display: table-cell; } </style> <script> document.getElementById("green_channel").setAttribute("class","divblock"); let sharebutton = document.createElement("div"); sharebutton.setAttribute("data-href", window.location.href); sharebutton.setAttribute("class", "divblock teams-share-button"); sharebutton.setAttribute("data-msg-text","分享好文章:"); document.getElementById("blog_post_info").insertBefore(sharebutton, document.getElementById("green_channel")); </script> <script async defer src="https://teams.microsoft.com/share/launcher.js"> </script>請(qǐng)進(jìn)入你的博客管理后臺(tái),進(jìn)入“設(shè)置”頁(yè)面
然后在“博客側(cè)邊欄公告”里面粘貼上面的代碼即可。
總結(jié)
以上是生活随笔為你收集整理的一键分享博客或新闻到Teams好友或频道的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: [ASP.NET Core 3框架揭秘]
- 下一篇: 敏捷回顾会议的套路与实践分享