mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Support AddToAny share (#633)
This commit is contained in:
parent
c8b84567cc
commit
318adc0227
@ -741,9 +741,12 @@ isso: # <data_isso>
|
||||
# See: https://theme-next.js.org/docs/third-party-services/post-widgets
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# AddThis Share. See: https://www.addthis.com
|
||||
# Go to https://www.addthis.com/dashboard to customize your tools.
|
||||
add_this_id:
|
||||
# AddToAny Share. See: https://www.addtoany.com
|
||||
addtoany:
|
||||
enable: false
|
||||
buttons:
|
||||
- facebook
|
||||
- twitter
|
||||
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
@ -3,3 +3,12 @@
|
||||
<script src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{ theme.add_this_id }}" async="async"></script>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{%- if theme.addtoany.enable %}
|
||||
<div class="social-like a2a_kit a2a_kit_size_32 a2a_default_style">
|
||||
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
|
||||
{%- for button in theme.addtoany.buttons %}
|
||||
<a class="a2a_button_{{ button }}"></a>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
3
layout/_third-party/addtoany.njk
vendored
Normal file
3
layout/_third-party/addtoany.njk
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{%- if theme.addtoany.enable %}
|
||||
{{ next_js('third-party/addtoany.js') }}
|
||||
{%- endif %}
|
||||
2
layout/_third-party/index.njk
vendored
2
layout/_third-party/index.njk
vendored
@ -16,5 +16,5 @@
|
||||
{%- include 'tags/mermaid.njk' -%}
|
||||
|
||||
{%- include 'fancybox.njk' -%}
|
||||
|
||||
{%- include 'pace.njk' -%}
|
||||
{%- include 'addtoany.njk' -%}
|
||||
|
||||
@ -3,5 +3,9 @@
|
||||
font-size: $font-size-small;
|
||||
margin-top: 1em;
|
||||
padding-top: 1em;
|
||||
text-align: center;
|
||||
flex-wrap();
|
||||
|
||||
a {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
8
source/js/third-party/addtoany.js
vendored
Normal file
8
source/js/third-party/addtoany.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/* global NexT */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
NexT.utils.getScript('https://static.addtoany.com/menu/page.js', { condition: window.a2a })
|
||||
.then(() => {
|
||||
window.a2a.init();
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user