-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于旧版本的插件 needmoreshare2 #667
Labels
Comments
Thanks for opening this issue, maintainers will get back to you as soon as possible! |
再附上 module.exports = function(config, injects) {
injects.head.raw('needmoreshare', `<link rel="stylesheet" href="${config.cdn.css}">`);
if (config.postbottom.enable) {
injects.head.raw('needmoreshare-postbottom', `<style>
#needsharebutton-postbottom {
cursor: pointer;
height: 26px;
margin-top: 10px;
margin-left: 50%;
position: relative;
}
#needsharebutton-postbottom .btn {
border: 1px solid $btn-default-border-color;
border-radius: 3px;
display: initial;
padding: 1px 4px;
}
</style>`);
injects.postBodyEnd.raw('needmoreshare-postbottom', `<div class="post-widgets">
<div id="needsharebutton-postbottom">
<span class="btn">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</span>
</div>
</div>`);
}
if (config.float.enable) {
injects.head.raw('needmoreshare-float', `<style>
#needsharebutton-float {
bottom: 88px;
cursor: pointer;
left: -8px;
position: fixed;
z-index: 9999;
}
#needsharebutton-float .btn {
border: 1px solid $btn-default-border-color;
border-radius: 4px;
padding: 0 10px 0 14px;
}
</style>`);
injects.bodyEnd.raw('needmoreshare-float', `<div id="needsharebutton-float">
<span class="btn">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</span>
</div>`);
}
injects.bodyEnd.raw('needmoreshare', `
<script src="${config.cdn.js}"></script>
<script>
{%- if config.needmoreshare.postbottom.enable %}
pbOptions = {};
{%- for k,v in config.needmoreshare.postbottom.options %}
pbOptions.{{ k }} = "{{ v }}";
{%- endfor %}
new needShareButton('#needsharebutton-postbottom', pbOptions);
{%- endif %}
{%- if config.needmoreshare.float.enable %}
flOptions = {};
{%- for k,v in config.needmoreshare.float.options %}
flOptions.{{ k }} = "{{ v }}";
{%- endfor %}
new needShareButton('#needsharebutton-float', flOptions);
{%- endif %}
</script>`);
}; |
需要单独加CSS: .post-widgets {
border-top: 1px solid $gainsboro;
margin-top: 15px;
text-align: center;
} 见 179176e 原版的 need-more-share2 已经很久没更新了: https://github.com/revir/need-more-share2 未来可能不会再适配了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Checklist
Expected behavior
我最近正在将 NexT 版本由 7.8.0 更新到最新的版本。在更新时我发现之前使用的 needmoreshare2 插件会产生显示错误。本来应该位于 bottomCenter 的 share 按钮移到了 bottomLeft。
可能是和新版本的 NexT 版本不适配,但是我真的很喜欢这个插件,比现在这个版本集成的 AddToAny share 好看的多。请问可以将这个插件集成到新版本中,或者告诉我解决的办法吗?
谢谢!
旧版本的 needmoreshare 在这里
这是在主题配置文件
config.yml
中关于 needmoreshare 的配置预期的效果 (在旧版本中正确显示)
Actual behavior
分享按钮出现在了屏幕左侧
Steps to reproduce the behavior
根据上文即可
Other Information
No response
The text was updated successfully, but these errors were encountered: