hexo-theme-icarus/Plugins/Share/icarus用户指南-分享按钮/index.html

257 lines
42 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!doctype html>
<html lang="zh"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><title>Icarus用户指南 - 分享按钮 - Icarus</title><link rel="manifest" href="/hexo-theme-icarus/manifest.json"><meta name="theme-color" content="#f7f7f7"><meta name="application-name" content="Icaurs - Hexo Theme"><meta name="msapplication-TileImage" content="/img/favicon.svg"><meta name="msapplication-TileColor" content="#f7f7f7"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="Icaurs - Hexo Theme"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="description" content="本文介绍Icarus 5支持的分享按钮的安装配置。 本文同时提供以下语言的翻译English。"><meta property="og:type" content="blog"><meta property="og:title" content="Icarus用户指南 - 分享按钮"><meta property="og:url" content="http://ppoffice.github.io/hexo-theme-icarus/Plugins/Share/icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-%E5%88%86%E4%BA%AB%E6%8C%89%E9%92%AE/"><meta property="og:site_name" content="Icarus"><meta property="og:description" content="本文介绍Icarus 5支持的分享按钮的安装配置。 本文同时提供以下语言的翻译English。"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-select-tool.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-select-tool-type.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-customize-share.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-get-code.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addtoany-select-platform.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addtoany-get-code.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/sharethis-choose-button-type.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/sharethis-choose-platform.png"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/sharethis-get-code.png"><meta property="article:published_time" content="2016-01-01T00:00:00.000Z"><meta property="article:author" content="PPOffice"><meta property="article:tag" content="Icarus用户指南"><meta property="twitter:card" content="summary"><meta property="twitter:image:src" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-select-tool.png"><script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"http://ppoffice.github.io/hexo-theme-icarus/Plugins/Share/icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-%E5%88%86%E4%BA%AB%E6%8C%89%E9%92%AE/"},"headline":"Icarus用户指南 - 分享按钮","image":["http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-select-tool.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-select-tool-type.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-customize-share.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addthis-get-code.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addtoany-select-platform.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/addtoany-get-code.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/sharethis-choose-button-type.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/sharethis-choose-platform.png","http://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/sharethis-get-code.png"],"datePublished":"2016-01-01T00:00:00.000Z","author":{"@type":"Person","name":"PPOffice"},"publisher":{"@type":"Organization","name":"Icarus","logo":{"@type":"ImageObject","url":"http://ppoffice.github.io/img/logo.svg"}},"description":"本文介绍Icarus 5支持的分享按钮的安装配置。 本文同时提供以下语言的翻译English。"}</script><link rel="canonical" href="http://ppoffice.github.io/hexo-theme-icarus/Plugins/Share/icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-%E5%88%86%E4%BA%AB%E6%8C%89%E9%92%AE/"><link rel="icon" href="/hexo-theme-icarus/img/favicon.svg"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/font-awesome/6.0.0/css/all.min.css"><link data-pjax rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/highlight.js/11.7.0/styles/atom-one-light.min.css"><link rel="stylesheet" href="https://fonts.loli.net/css2?family=Ubuntu:wght@400;600&amp;family=Source+Code+Pro"><link data-pjax rel="stylesheet" href="/hexo-theme-icarus/css/default.css"><style>body>.footer,body>.navbar,body>.section{opacity:0}</style><!--!--><!--!--><!--!--><!--!--><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/cookieconsent/3.1.1/cookieconsent.min.css"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/lightgallery/1.10.0/css/lightgallery.min.css"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/justifiedGallery/3.8.1/css/justifiedGallery.min.css"><script src="https://www.googletagmanager.com/gtag/js?id=UA-72437521-5" async></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-72437521-5');</script><!--!--><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.css"><style>.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#3273dc;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px}</style><script src="https://cdnjs.loli.net/ajax/libs/pace/1.2.4/pace.min.js"></script><!--!--><!--!--><!-- hexo injector head_end start --><script>
(function () {
function switchTab() {
if (!location.hash) {
return;
}
const id = '#' + CSS.escape(location.hash.substring(1));
const $tabMenu = document.querySelector(`.tabs a[href="${id}"]`);
if (!$tabMenu) {
return;
}
const $tabMenuContainer = $tabMenu.parentElement.parentElement;
Array.from($tabMenuContainer.children).forEach($menu => $menu.classList.remove('is-active'));
Array.from($tabMenuContainer.querySelectorAll('a'))
.map($menu => document.getElementById($menu.getAttribute("href").substring(1)))
.forEach($content => $content.classList.add('is-hidden'));
if ($tabMenu) {
$tabMenu.parentElement.classList.add('is-active');
}
const $activeTab = document.querySelector(id);
if ($activeTab) {
$activeTab.classList.remove('is-hidden');
}
}
switchTab();
window.addEventListener('hashchange', switchTab, false);
})();
</script><!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.3.0">
<style>.not-gallery-item { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .not-gallery-item > span { position: relative; z-index: 10; } .not-gallery-item img, .not-gallery-item .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .not-gallery-item img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .not-gallery-item-fallback { color: inherit; } .not-gallery-item-fallback img { opacity: 0 !important; }</style>
<link rel="alternate" href="/hexo-theme-icarus/atom.xml" title="Icarus" type="application/atom+xml">
</head><body class="is-2-column"><nav class="navbar navbar-main"><div class="container navbar-container"><div class="navbar-brand justify-content-center"><a class="navbar-item navbar-logo" href="/hexo-theme-icarus/"><img src="/hexo-theme-icarus/img/logo.svg" alt="Icarus" height="28"></a></div><div class="navbar-menu"><div class="navbar-start"><a class="navbar-item" href="/hexo-theme-icarus/">Home</a><a class="navbar-item" href="/hexo-theme-icarus/archives">Archives</a><a class="navbar-item" href="/hexo-theme-icarus/categories">Categories</a><a class="navbar-item" href="/hexo-theme-icarus/tags">Tags</a><a class="navbar-item" href="/hexo-theme-icarus/about">About</a></div><div class="navbar-end"><a class="navbar-item" target="_blank" rel="noopener" title="Discuss on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus/discussions"><i class="fas fa-comments"></i></a><a class="navbar-item" target="_blank" rel="noopener" title="Download on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus"><i class="fab fa-github"></i></a><a class="navbar-item is-hidden-tablet catalogue" title="目录" href="javascript:;"><i class="fas fa-list-ul"></i></a><a class="navbar-item search" title="搜索" href="javascript:;"><i class="fas fa-search"></i></a></div></div></div></nav><section class="section"><div class="container"><div class="columns"><div class="column order-2 column-main is-8-tablet is-8-desktop is-8-widescreen"><div class="card"><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item"><time dateTime="2016-01-01T00:00:00.000Z" title="1/1/2016, 12:00:00 AM">2016-01-01</time>发表</span><span class="level-item"><a class="link-muted" href="/hexo-theme-icarus/categories/Plugins/">Plugins</a><span> / </span><a class="link-muted" href="/hexo-theme-icarus/categories/Plugins/Share/">Share</a></span><span class="level-item">10 分钟读完 (大约1460个字)</span></div></div><h1 class="title is-3 is-size-4-mobile">Icarus用户指南 - 分享按钮</h1><div class="content"><p>本文介绍Icarus 5支持的分享按钮的安装配置。</p>
<article class="message message-immersive is-primary">
<div class="message-body">
<i class="fas fa-globe-americas mr-2"></i>本文同时提供以下语言的翻译:<a href="/hexo-theme-icarus/Plugins/Share/icarus-user-guide-share-buttons/">English</a>
</div>
</article>
<span id="more"></span>
<article class="message message-immersive is-primary">
<div class="message-body">
<i class="fas fa-info-circle mr-2"></i>下面的分享按钮由<a target="_blank" rel="noopener" href="https://github.com/ppoffice/hexo-component-inferno">ppoffice/hexo-component-inferno</a>提供,完整的支持按钮列表和配置详情以其为准。
</div>
</article>
<style>
.content ol:not([type]) {
list-style-type: simp-chinese-informal;
}
</style>
<h2 id="AddThis"><a href="#AddThis" class="headerlink" title="AddThis"></a>AddThis</h2><article class="message message-immersive is-danger">
<div class="message-body">
<i class="fas fa-exclamation-triangle mr-2"></i>此分享按钮可能会被部分广告拦截浏览器扩展拦截,请酌情使用。
</div>
</article>
<article class="message message-immersive is-danger">
<div class="message-body">
<i class="fas fa-exclamation-triangle mr-2"></i>AddThis分享按钮服务已下线建议使用其他分享按钮服务作为替代。
</div>
</article>
<div>
<strong>安装指南</strong>
<a class="tag is-success" style="margin-left:.8em" href="/hexo-theme-icarus/uncategorized/addthis-share-buttons/">在线预览</a>
</div>
<ol>
<li><p>注册<a target="_blank" rel="noopener" href="https://www.addthis.com/">AddThis</a>
在提交注册表单后的“选择工具”(Select a Tool)页面选择“分享按钮”(Share Buttons)。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/addthis-select-tool.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="选择工具 - AddThis" alt="选择工具 - AddThis">
<br>
</li>
<li><p>在“选择工具类型”(Select a Tool Type)界面选择样式和按钮,点击“继续”(Continue)。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/addthis-select-tool-type.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="选择工具类型 Type - AddThis" alt="选择工具类型 Type - AddThis">
<br>
</li>
<li><p>在下一页面中进一步自定义分享按钮,完成时点击“激活工具”(Activate Tool)按钮。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/addthis-customize-share.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="自定义分享按钮 - AddThis" alt="自定义分享按钮 - AddThis">
<br>
</li>
<li><p>在”获取代码“(Get The Code)页面找到HTML代码复制<code>src</code>属性值中的URL地址并填入分享按钮配置中。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/addthis-get-code.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="获取代码 - AddThis" alt="获取代码 - AddThis">
<br>
<p>例如下面AddThis代码中的URL</p>
<figure class="highlight html"><figcaption><span>AddThis代码</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- Go to www.addthis.com/dashboard to customize your tools --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxxxxxx"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure>
<p> 对应如下的主题配置:</p>
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">share:</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">addthis</span></span><br><span class="line"> <span class="attr">install_url:</span> <span class="string">//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxxxxxx</span></span><br></pre></td></tr></tbody></table></figure></li>
</ol>
<h2 id="AddToAny"><a href="#AddToAny" class="headerlink" title="AddToAny"></a>AddToAny</h2><div>
<strong>安装指南</strong>
<a class="tag is-success" style="margin-left:.8em" href="/hexo-theme-icarus/uncategorized/addtoany-share-buttons/">在线预览</a>
</div>
<ol>
<li><p>你可以启用AddToAny而无需注册用户。
仅需将下面的代码放到你的主题配置中:</p>
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">share:</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">addtoany</span></span><br></pre></td></tr></tbody></table></figure></li>
</ol>
<p>如果你想自定义分享按钮,请采用如下步骤:</p>
<ol>
<li><p>访问<a target="_blank" rel="noopener" href="https://www.addtoany.com/">AddToAny</a>官网并点击“获取分享按钮”(Get the Share Button)。</p>
</li>
<li><p>然后,选择“任意网站”(Any Website)并完成按钮的配置。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/addtoany-select-platform.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="选择平台 - AddToAny" alt="选择平台 - AddToAny">
<br>
</li>
<li><p>完成后点击“获取按钮代码”(Get Button Code)。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/addtoany-get-code.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="获取代码 - AddToAny" alt="获取代码 - AddToAny">
<br>
</li>
<li><p>由于分享按钮是由<a target="_blank" rel="noopener" href="https://github.com/ppoffice/hexo-component-inferno">ppoffice/hexo-component-inferno</a>
提供你需要将AddToAny的布局文件<a target="_blank" rel="noopener" href="https://github.com/ppoffice/hexo-component-inferno/blob/0.2.2/src/view/share/addtoany.jsx">src/view/share/addtoany.jsx</a>从这个仓库中复制到<code>&lt;icarus_directory&gt;/layout/share/addtoany.jsx</code>
然后,替换<code>addtoany.jsx</code>中AddToAny代码并修正文件头部的包引用。</p>
<p>例如,假设下面的代码是你从上一步获得的代码:</p>
<figure class="highlight html"><figcaption><span>AddToAny代码 &gt;folded</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- AddToAny BEGIN --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"a2a_kit a2a_kit_size_32 a2a_default_style"</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">class</span>=<span class="string">"a2a_dd"</span> <span class="attr">href</span>=<span class="string">"https://www.addtoany.com/share"</span>&gt;</span><span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">class</span>=<span class="string">"a2a_button_facebook"</span>&gt;</span><span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">class</span>=<span class="string">"a2a_button_twitter"</span>&gt;</span><span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">class</span>=<span class="string">"a2a_button_email"</span>&gt;</span><span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">async</span> <span class="attr">src</span>=<span class="string">"https://static.addtoany.com/menu/page.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line"><span class="comment">&lt;!-- AddToAny END --&gt;</span></span><br></pre></td></tr></tbody></table></figure>
<p> 那么你需要对<code>addtoany.jsx</code>做出如下修改:</p>
<figure class="highlight diff"><figcaption><span>&lt;icarus_directory&gt;/layout/share/addtoany.jsx &gt;folded</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">const { Component, Fragment } = require('inferno');</span><br><span class="line"><span class="deletion">- const { cacheComponent } = require('../../util/cache');</span></span><br><span class="line"><span class="addition">+ const { cacheComponent } = require('hexo-component-inferno/lib/util/cache');</span></span><br><span class="line"></span><br><span class="line">...中间省略部分代码...</span><br><span class="line"></span><br><span class="line">class AddToAny extends Component {</span><br><span class="line"> render() {</span><br><span class="line"> return &lt;Fragment&gt;</span><br><span class="line"><span class="deletion">- &lt;div class="a2a_kit a2a_kit_size_32 a2a_default_style"&gt;</span></span><br><span class="line"><span class="deletion">- &lt;a class="a2a_dd" href="https://www.addtoany.com/share"&gt;&lt;/a&gt;</span></span><br><span class="line"><span class="deletion">- &lt;a class="a2a_button_facebook"&gt;&lt;/a&gt;</span></span><br><span class="line"><span class="deletion">- &lt;a class="a2a_button_twitter"&gt;&lt;/a&gt;</span></span><br><span class="line"><span class="deletion">- &lt;a class="a2a_button_telegram"&gt;&lt;/a&gt;</span></span><br><span class="line"><span class="deletion">- &lt;a class="a2a_button_whatsapp"&gt;&lt;/a&gt;</span></span><br><span class="line"><span class="deletion">- &lt;a class="a2a_button_reddit"&gt;&lt;/a&gt;</span></span><br><span class="line"><span class="deletion">- &lt;/div&gt;</span></span><br><span class="line"><span class="addition">+ 刚刚获取的AddToAny HTML代码替换到这里</span></span><br><span class="line"> &lt;script src="https://static.addtoany.com/menu/page.js" defer={true}&gt;&lt;/script&gt;</span><br><span class="line"> &lt;/Fragment&gt;;</span><br><span class="line"> }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line">...下面省略部分代码...</span><br></pre></td></tr></tbody></table></figure></li>
</ol>
<h2 id="百度分享"><a href="#百度分享" class="headerlink" title="百度分享"></a>百度分享</h2><article class="message message-immersive is-danger">
<div class="message-body">
<i class="fas fa-exclamation-triangle mr-2"></i>此分享按钮可能会被部分广告拦截浏览器扩展拦截,请酌情使用。
</div>
</article>
<article class="message message-immersive is-danger">
<div class="message-body">
<i class="fas fa-exclamation-triangle mr-2"></i>百度分享按钮服务似乎已下线,建议使用其他分享按钮服务作为替代。
</div>
</article>
<p><strong>安装指南</strong></p>
<ol>
<li><p>你可以启用百度分享按钮而无需注册用户。
直接将下面的代码添加到你的主题配置中:</p>
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">share:</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">bdshare</span></span><br></pre></td></tr></tbody></table></figure></li>
</ol>
<h2 id="Share-js"><a href="#Share-js" class="headerlink" title="Share.js"></a>Share.js</h2><article class="message message-immersive is-danger">
<div class="message-body">
<i class="fas fa-exclamation-triangle mr-2"></i>Share.js服务已停止维护建议使用其他分享按钮服务作为替代。
</div>
</article>
<div>
<strong>安装指南</strong>
<a class="tag is-success" style="margin-left:.8em" href="/hexo-theme-icarus/uncategorized/share-js-share-buttons/">在线预览</a>
</div>
<ol>
<li><p>你可以启用Share.js分享按钮而无需用户注册。
直接将下面代码添加到主题配置中:</p>
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">share:</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">sharejs</span></span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>(可选)请参照<a href="#AddToAny">AddToAny</a>部分的个性化步骤与<a target="_blank" rel="noopener" href="https://github.com/overtrue/share.js">share.js主页</a>
来了解更多关于自定义分享按钮的信息。</p>
</li>
</ol>
<h2 id="ShareThis"><a href="#ShareThis" class="headerlink" title="ShareThis"></a>ShareThis</h2><div>
<strong>安装指南</strong>
<a class="tag is-success" style="margin-left:.8em" href="/hexo-theme-icarus/uncategorized/sharethis-share-buttons/">在线预览</a>
</div>
<ol>
<li><p>访问<a target="_blank" rel="noopener" href="https://sharethis.com/">ShareThis</a>并点击页面上的“从分享按钮开始”(Start with Share Buttons)按钮。</p>
</li>
<li><p>在“选择分享按钮类型”(Choose type of sharing button)页面选择你需要的按钮类型。
不要启用”GDPR规范工具“否则可能会导致一些问题。
你也可以点击“自定义你的分享按钮”(Customize your share buttons)链接来进行按钮的进一步配置。
完成后点击“下一步”(Next)。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/sharethis-choose-button-type.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="选择按钮类型 - ShareThis" alt="选择按钮类型 - ShareThis">
<br>
</li>
<li><p>在”选择你的CMS平台“(Choose your CMS platform)页面选择”HTML“并点击”下一步“(Next)。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/sharethis-choose-platform.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="选择平台 - ShareThis" alt="选择平台 - ShareThis">
<br>
</li>
<li><p>在“注册并获取代码”(Register and get the code!)页面输入邮箱和密码完成ShareThis的注册。</p>
</li>
<li><p>最后从HTML代码段中复制<code>src</code>中的URL地址到分享按钮配置中。</p>
<img src="/hexo-theme-icarus/gallery/screenshots/sharethis-get-code.png" class="box px-0 py-0 ml-auto mr-auto" width="360" title="获取代码 - ShareThis" alt="获取代码 - ShareThis">
<br>
<p>例如下面的ShareThis代码</p>
<figure class="highlight html"><figcaption><span>AddThis代码</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">"text/javascript"</span> <span class="attr">src</span>=<span class="string">"https://platform-api.sharethis.com/js/sharethis.js#property=xxxxxxxxxxxxx&amp;product=inline-share-buttons"</span> <span class="attr">async</span>=<span class="string">"async"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure>
<p> 对应下面的主题配置:</p>
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">share:</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">sharethis</span></span><br><span class="line"> <span class="attr">install_url:</span> <span class="string">https://platform-api.sharethis.com/js/sharethis.js#property=xxxxxxxxxxxxx&amp;product=inline-share-buttons</span></span><br></pre></td></tr></tbody></table></figure></li>
</ol>
<article class="message message-immersive is-warning">
<div class="message-body">
<i class="fas fa-question-circle mr-2"></i>文章内容有误?请点击<a target="_blank" rel="noopener" href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/zh-CN/Share-Buttons.md">此处</a>提交修改。
</div>
</article>
</div><div class="article-licensing box"><div class="licensing-title"><p>Icarus用户指南 - 分享按钮</p><p><a href="http://ppoffice.github.io/hexo-theme-icarus/Plugins/Share/icarus用户指南-分享按钮/">http://ppoffice.github.io/hexo-theme-icarus/Plugins/Share/icarus用户指南-分享按钮/</a></p></div><div class="licensing-meta level is-mobile"><div class="level-left"><div class="level-item is-narrow"><div><h6>作者</h6><p>PPOffice</p></div></div><div class="level-item is-narrow"><div><h6>发布于</h6><p>2016-01-01</p></div></div><div class="level-item is-narrow"><div><h6>许可协议</h6><p><a class="icons" rel="noopener" target="_blank" title="Creative Commons" href="https://creativecommons.org/"><i class="icon fab fa-creative-commons"></i></a><a class="" rel="noopener" target="_blank" title="CC BY-NC-SA 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a></p></div></div></div></div></div><div class="article-tags is-size-7 mb-4"><span class="mr-2">#</span><a class="link-muted mr-2" rel="tag" href="/hexo-theme-icarus/tags/Icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97/">Icarus用户指南</a></div><div class="sharethis-inline-share-buttons"></div><script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5e8fc96750876c7d" defer></script></article></div><!--!--><nav class="post-navigation mt-4 level is-mobile"><div class="level-start"><a class="article-nav-prev level level-item link-muted" href="/hexo-theme-icarus/Plugins/Other/icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-%E5%85%B6%E4%BB%96%E6%8F%92%E4%BB%B6/"><i class="level-item fas fa-chevron-left"></i><span class="level-item">Icarus用户指南 - 其他插件</span></a></div><div class="level-end"><a class="article-nav-next level level-item link-muted" href="/hexo-theme-icarus/Plugins/Analytics/icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-%E7%BD%91%E7%AB%99%E5%88%86%E6%9E%90%E6%8F%92%E4%BB%B6/"><span class="level-item">Icarus用户指南 - 网站分析插件</span><i class="level-item fas fa-chevron-right"></i></a></div></nav><!--!--></div><div class="column column-left is-4-tablet is-4-desktop is-4-widescreen order-1 is-sticky"><div class="card widget" data-type="profile"><div class="card-content"><nav class="level"><div class="level-item has-text-centered flex-shrink-1"><div><figure class="image is-128x128 mx-auto mb-2"><img class="avatar" src="/hexo-theme-icarus/img/avatar.png" alt="PPOffice"></figure><p class="title is-size-4 is-block" style="line-height:inherit;">PPOffice</p><p class="is-size-6 is-block">Web Developer</p><p class="is-size-6 is-flex justify-content-center"><i class="fas fa-map-marker-alt mr-1"></i><span>Earth, Solar System</span></p></div></div></nav><nav class="level is-mobile"><div class="level-item has-text-centered is-marginless"><div><p class="heading">文章</p><a href="/hexo-theme-icarus/archives/"><p class="title">43</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">分类</p><a href="/hexo-theme-icarus/categories/"><p class="title">9</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">标签</p><a href="/hexo-theme-icarus/tags/"><p class="title">4</p></a></div></div></nav><div class="level"><a class="level-item button is-primary is-rounded" href="https://github.com/ppoffice" target="_blank" rel="me noopener">关注我</a></div><div class="level is-mobile is-multiline"><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Github" href="https://github.com/ppoffice"><i class="fab fa-github"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Facebook" href="https://facebook.com"><i class="fab fa-facebook"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Twitter" href="https://twitter.com"><i class="fab fa-twitter"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Dribbble" href="https://dribbble.com"><i class="fab fa-dribbble"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="RSS" href="/hexo-theme-icarus/"><i class="fas fa-rss"></i></a></div></div></div><div class="card widget" id="toc" data-type="toc"><div class="card-content"><div class="menu"><h3 class="menu-label">目录</h3><ul class="menu-list"><li><a class="level is-mobile" href="#AddThis"><span class="level-left"><span class="level-item">1</span><span class="level-item">AddThis</span></span></a></li><li><a class="level is-mobile" href="#AddToAny"><span class="level-left"><span class="level-item">2</span><span class="level-item">AddToAny</span></span></a></li><li><a class="level is-mobile" href="#百度分享"><span class="level-left"><span class="level-item">3</span><span class="level-item">百度分享</span></span></a></li><li><a class="level is-mobile" href="#Share-js"><span class="level-left"><span class="level-item">4</span><span class="level-item">Share.js</span></span></a></li><li><a class="level is-mobile" href="#ShareThis"><span class="level-left"><span class="level-item">5</span><span class="level-item">ShareThis</span></span></a></li></ul></div></div><style>#toc .menu-list > li > a.is-active + .menu-list { display: block; }#toc .menu-list > li > a + .menu-list { display: none; }</style><script src="/hexo-theme-icarus/js/toc.js" defer></script></div><div class="card widget" data-type="categories"><div class="card-content"><div class="menu"><h3 class="menu-label">分类</h3><ul class="menu-list"><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Configuration/"><span class="level-start"><span class="level-item">Configuration</span></span><span class="level-end"><span class="level-item tag">4</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/"><span class="level-start"><span class="level-item">Plugins</span></span><span class="level-end"><span class="level-item tag">12</span></span></a><ul><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Analytics/"><span class="level-start"><span class="level-item">Analytics</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Comment/"><span class="level-start"><span class="level-item">Comment</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Donation/"><span class="level-start"><span class="level-item">Donation</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Other/"><span class="level-start"><span class="level-item">Other</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Search/"><span class="level-start"><span class="level-item">Search</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Share/"><span class="level-start"><span class="level-item">Share</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li></ul></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Widgets/"><span class="level-start"><span class="level-item">Widgets</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li></ul></div></div></div><div class="card widget" data-type="tags"><div class="card-content"><div class="menu"><h3 class="menu-label">标签</h3><div class="field is-grouped is-grouped-multiline"><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Demo/"><span class="tag">Demo</span><span class="tag">19</span></a></div><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Getting-Started/"><span class="tag">Getting Started</span><span class="tag">4</span></a></div><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Icarus-User-Guide/"><span class="tag">Icarus User Guide</span><span class="tag">12</span></a></div><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97/"><span class="tag">Icarus用户指南</span><span class="tag">12</span></a></div></div></div></div></div></div><!--!--></div></div></section><footer class="footer"><div class="container"><div class="level"><div class="level-start"><a class="footer-logo is-block mb-2" href="/hexo-theme-icarus/"><img src="/hexo-theme-icarus/img/logo.svg" alt="Icarus" height="28"></a><p class="is-size-7"><span>&copy; 2025 PPOffice</span>  Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> &amp; <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a></p></div><div class="level-end"><div class="field has-addons"><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Creative Commons" href="https://creativecommons.org/"><i class="fab fa-creative-commons"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Discuss on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus/discussions"><i class="fas fa-comments"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Download on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus"><i class="fab fa-github"></i></a></p></div></div></div></div></footer><script src="https://cdnjs.loli.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script src="https://cdnjs.loli.net/ajax/libs/moment.js/2.22.2/moment-with-locales.min.js"></script><script src="https://cdnjs.loli.net/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" defer></script><script>moment.locale("zh-cn");</script><script>var IcarusThemeSettings = {
article: {
highlight: {
clipboard: true,
fold: 'unfolded'
}
}
};</script><script data-pjax src="/hexo-theme-icarus/js/column.js"></script><script src="/hexo-theme-icarus/js/animation.js"></script><a id="back-to-top" title="回到顶端" href="javascript:;"><i class="fas fa-chevron-up"></i></a><script data-pjax src="/hexo-theme-icarus/js/back_to_top.js" defer></script><!--!--><!--!--><!--!--><script src="https://cdnjs.loli.net/ajax/libs/cookieconsent/3.1.1/cookieconsent.min.js" defer></script><script>window.addEventListener("load", () => {
window.cookieconsent.initialise({
type: "info",
theme: "edgeless",
static: false,
position: "bottom-left",
content: {
message: "此网站使用Cookie来改善您的体验。",
dismiss: "知道了!",
allow: "允许使用Cookie",
deny: "拒绝",
link: "了解更多",
policy: "Cookie政策",
href: "https://www.cookiesandyou.com/",
},
palette: {
popup: {
background: "#edeff5",
text: "#838391"
},
button: {
background: "#4b81e8"
},
},
});
});</script><script src="https://cdnjs.loli.net/ajax/libs/lightgallery/1.10.0/js/lightgallery.min.js" defer></script><script src="https://cdnjs.loli.net/ajax/libs/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js" defer></script><script>window.addEventListener("load", () => {
if (typeof $.fn.lightGallery === 'function') {
$('.article').lightGallery({ selector: '.gallery-item' });
}
if (typeof $.fn.justifiedGallery === 'function') {
if ($('.justified-gallery > p > .gallery-item').length) {
$('.justified-gallery > p > .gallery-item').unwrap();
}
$('.justified-gallery').justifiedGallery();
}
});</script><!--!--><!--!--><div id="outdated"><h6>Your browser is out-of-date!</h6><p>Update your browser to view this website correctly.&amp;npsb;<a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update my browser now </a></p><p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">×</a></p></div><script src="https://cdnjs.loli.net/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.js" defer></script><script>window.addEventListener("load", function () {
outdatedBrowser({
bgColor: '#f25648',
color: '#ffffff',
lowerThan: 'object-fit' // display on IE11 or below
});
});</script><!--!--><!--!--><!--!--><script data-pjax src="/hexo-theme-icarus/js/main.js" defer></script><div class="searchbox"><div class="searchbox-container"><div class="searchbox-header"><div class="searchbox-input-container"><input class="searchbox-input" type="text" placeholder="想要查找什么..."></div><a class="searchbox-close" href="javascript:;">×</a></div><div class="searchbox-body"></div></div></div><script data-pjax src="/hexo-theme-icarus/js/insight.js" defer></script><script data-pjax>document.addEventListener('DOMContentLoaded', function () {
loadInsight({"contentUrl":"/hexo-theme-icarus/content.json"}, {"hint":"想要查找什么...","untitled":"(无标题)","posts":"文章","pages":"页面","categories":"分类","tags":"标签"});
});</script></body></html>