hexo next主题添加网易云播放器后页面显示错误

发布于 2022-09-11 21:53:29 字数 3411 浏览 29 评论 0

如图,添加播放器后页面上只显示播放器,侧边栏和文章部分都不显示

clipboard.png

代码如下
sidebar.swig

{% macro render(display_toc) %}
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      {%- set display_toc = theme.toc.enable and display_toc %}
      {%- if display_toc %}
        {%- set next_toc_number = page.toc_number | default(theme.toc.number) %}
        {%- set next_toc_max_depth = page.toc_max_depth | default(theme.toc.max_depth) | default(6) %}
        {%- set toc = toc(page.content, { "class": "nav", list_number: next_toc_number, max_depth: next_toc_max_depth }) %}
        {%- set display_toc = toc.length > 1 and display_toc %}
      {%- endif %}

      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc" data-target="post-toc-wrap">
          {{ __('sidebar.toc') }}
        </li>
        <li class="sidebar-nav-overview" data-target="site-overview-wrap">
          {{ __('sidebar.overview') }}
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
        {%- if display_toc %}
          <div class="post-toc">
            <div class="post-toc-content">{{ toc }}</div>
          </div>
        {%- endif %}
      </div>
      <!--/noindex-->


      <div class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          {{ partial('_partials/sidebar/site-overview.swig', {}, {cache: theme.cache.enable}) }}

          {{- next_inject('sidebar') }}
        </div>
      </div>

      {%- if theme.back2top.enable and theme.back2top.sidebar %}
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>
      {%- endif %}

    </div>

  </aside>
  <div>
    <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="450" src="//music.163.com/outchain/player?type=0&id=2949420144&auto=1&height=430"></iframe>
  </div>
  <div id="sidebar-dimmer"></div>
{% endmacro %}

_config.yaml

sidebar:
  # Sidebar Position.
  position: left
  #position: right

  # Manual define the sidebar width. If commented, will be default for:
  # Muse | Mist: 320
  # Pisces | Gemini: 240
  width: 340

  # Sidebar Display (only for Muse | Mist), available values:
  #  - post    expand on posts automatically. Default.
  #  - always  expand for all pages automatically.
  #  - hide    expand only when click on the sidebar toggle icon.
  #  - remove  totally remove sidebar including sidebar toggle.
  display: post

  # Sidebar offset from top menubar in pixels (only for Pisces | Gemini).
  offset: 12
  # Enable sidebar on narrow view (only for Muse | Mist).
  onmobile: false

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文