一键分享博客或新闻到Teams好友或频道
生活随笔
收集整理的這篇文章主要介紹了
一键分享博客或新闻到Teams好友或频道
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
在最近的開發(fā)者工具更新中,Teams提供了一個Share to Teams的能力,就是在你的網(wǎng)頁上面,放置一個按鈕,用戶點擊后,就可以很方便地將當(dāng)前網(wǎng)頁或者你指定的其他網(wǎng)頁,分享到Teams好友或頻道中。
這個開發(fā)文檔在這里,請參考 https://docs.microsoft.com/en-us/microsoftteams/platform/share-to-teams
這個功能非常好,歡迎大家試用。另外,我因為長期有寫博客的習(xí)慣,我也順便改造了一下博客的系統(tǒng),添加了這個按鈕。
點擊該按鈕后,會彈出一個對話框
在這個對話框中,可以選擇分享的目標(biāo),然后還可以添加說明文字,然后點擊“共享”按鈕
此時如果切換到Teams,就可以看到已經(jīng)有一個消息分享過來
看起來還不錯吧,還等什么呢?趕緊在你的網(wǎng)站中添加這個功能吧。
文末福利
我的博客是在博客園寫的,如果你正好也是在這個平臺,你可以通過我寫好的下面的代碼快速添加。
<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>請進(jìn)入你的博客管理后臺,進(jìn)入“設(shè)置”頁面
然后在“博客側(cè)邊欄公告”里面粘貼上面的代碼即可。
總結(jié)
以上是生活随笔為你收集整理的一键分享博客或新闻到Teams好友或频道的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [ASP.NET Core 3框架揭秘]
- 下一篇: 敏捷回顾会议的套路与实践分享