posts in the sidebar to open the link error, modify the links - Hexo station (E)

Here Insert Picture Description
When the mouse is moved posts, links visit is 域名/archives/%7C%7C%20archive/seen behind the excess, the problem is to delete the extra characters behind

Extra characters to solve

posts ofclass="site-state-item site-state-posts"

Open 博客根目录/themes/next/layout/_macro/sidebar.swig, the value of the search class, and quickly locate the error location.

Before modification:

 {% if config.archive_dir != '/' and site.posts.length > 0 %}
              <div class="site-state-item site-state-posts">
              {% if theme.menu.archives %}
                <a href="{{ url_for(theme.menu.archives).split('||')[0] | trim }}">
              {% else %}
                <a href="{{ url_for(config.archive_dir) }}">
              {% endif %}
                  <span class="site-state-item-count">{{ site.posts.length }}</span>
                  <span class="site-state-item-name">{{ __('state.posts') }}</span>
                </a>
              </div>
 {% endif %}

after modification:

{% if config.archive_dir != '/' and site.posts.length > 0 %}
              <div class="site-state-item site-state-posts">
                <a href="{{ url_for(config.archive_dir) }}">
                  <span class="site-state-item-count">{{ site.posts.length }}</span>
                  <span class="site-state-item-name">{{ __('state.posts') }}</span>
                </a>
              </div>
{% endif %}

The middle of the judge deleted, retains the contents of the following else to solve the problem

He published 190 original articles · won praise 153 · views 90000 +

Guess you like

Origin blog.csdn.net/qq_36852780/article/details/104680152