Hexo装live2D宠物Next主题的访问记数不显示
Hexo 开启Live2D宠物后 Next 主题中的访问计数会不显示,可能是样式表中的参数冲突,需要对计数脚本中以下内容进行一些修改
<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="site-uv" title="{{ __('footer.total_visitors') }}">
<span class="site-pv" title="{{ __('footer.total_views') }}">
原脚本内容
{%- if theme.busuanzi_count.enable %}
<div class="busuanzi-count">
<script{{ pjax }} async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
{%- if theme.busuanzi_count.total_visitors %}
<span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
<span class="post-meta-item-icon">
<i class="{{ theme.busuanzi_count.total_visitors_icon }}"></i>
</span>
<span class="site-uv" title="{{ __('footer.total_visitors') }}">
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
{%- endif %}
{%- if theme.busuanzi_count.total_visitors and theme.busuanzi_count.total_views %}
<span class="post-meta-divider">|</span>
{%- endif %}
{%- if theme.busuanzi_count.total_views %}
<span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
<span class="post-meta-item-icon">
<i class="{{ theme.busuanzi_count.total_views_icon }}"></i>
</span>
<span class="site-pv" title="{{ __('footer.total_views') }}">
<span id="busuanzi_value_site_pv"></span>
</span>
</span>
{%- endif %}
</div>
{%- endif %}
修改后的内容
{%- if theme.busuanzi_count.enable %}
<div class="busuanzi-count">
<script {{ pjax }} async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
{%- if theme.busuanzi_count.total_visitors %}
<span>
<span class="post-meta-item-icon">
<i class="{{ theme.busuanzi_count.total_visitors_icon }}"></i>
</span>
<span>总访客 <span id="busuanzi_value_site_uv"></span> 人</span>
</span>
</span>
{%- endif %}
{%- if theme.busuanzi_count.total_visitors and theme.busuanzi_count.total_views %}
<span class="post-meta-divider">|</span>
{%- endif %}
{%- if theme.busuanzi_count.total_views %}
<span class="post-meta-item" >
<span class="post-meta-item-icon">
<i class="{{ theme.busuanzi_count.total_views_icon }}"></i>
</span>
<span>访问总量 <span id="busuanzi_value_site_pv"></span> 次</span>
</span>
{%- endif %}
</div>
{%- endif %}
我自己定义的内容
{%- if theme.busuanzi_count.enable %}
<div class="busuanzi-count">
<script{{ pjax }} async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
{%- if theme.busuanzi_count.total_visitors %}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="{{ theme.busuanzi_count.total_visitors_icon }}"></i>
</span>
<span>第 <span id="busuanzi_value_site_uv"></span> 位朋友</span>
</span>
</span>
{%- endif %}
{%- if theme.busuanzi_count.total_visitors and theme.busuanzi_count.total_views %}
<span class="post-meta-divider">|</span>
{%- endif %}
{%- if theme.busuanzi_count.total_views %}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="{{ theme.busuanzi_count.total_views_icon }}"></i>
</span>
<span>经 <span id="busuanzi_value_site_pv"></span> 回眸与你相遇</span>
</span>
{%- endif %}
</div>
{%- endif %}