0%

解决live2d和busuanzi不蒜子冲突最新解决方案

说明

  • 按照官网给出的配置后,发现底部和每个文章都不展示统计数据,查询到资料是live2dbusuanzi冲突引起,最终解决方案如下

解决

  • 解决网站底部不展示统计数据,打开\themes\next\layout\_third-party\statistics\busuanzi-counter.swig,将

    1
    2
    3
    4
    5
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
    修改
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;"></span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;"></span>

image-20211014155848022

  • 解决文章标题下不展示统计数据,我看很多人都是修改源busuanzi.pure.mini.js文件,最终我新增了个 style属性就行,打开\themes\next\layout\_macro\post.swig ,新增style属性

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    {%- if not is_index and theme.busuanzi_count.enable and theme.busuanzi_count.post_views %}
    <style>
    #busuanzi_container_page_pv {display:inline !important;margin-left:10px;}
    </style>
    <span class="post-meta-item" title="{{ __('post.views') }}" id="busuanzi_container_page_pv">

    <span class="post-meta-item-icon">
    <i class="{{ theme.busuanzi_count.post_views_icon }}"></i>
    </span>
    <span class="post-meta-item-text">{{ __('post.views') + __('symbol.colon') }}</span>
    <span id="busuanzi_value_page_pv"></span>
    </span>
    {%- endif %}

    image-20211014155808658