Skip to content
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

主页面的上一页和下一页按钮显示出错 #162

Open
FenghuJi opened this issue Dec 17, 2019 · 5 comments
Open

主页面的上一页和下一页按钮显示出错 #162

FenghuJi opened this issue Dec 17, 2019 · 5 comments

Comments

@FenghuJi
Copy link

FenghuJi commented Dec 17, 2019

在应用了fexo主题后,在主页面的上一页和下一页的导航界面,箭头渲染不出来。显示如下:
image
查看网页源代码后,我的导航处的代码为


<div class="pagination">
   <nav class="page-nav">
   <span class="page-number current">1</span><a class="page-number" href="/archives/page/2/">2</a><a class="extend next" rel="next" href="/archives/page/2/">&lt;i class&#x3D;&quot;icon-angle-right&quot;&gt;&lt;&#x2F;i&gt;</a>
   </nav>
   </div>

而博主您的博客查看网页源代码在导航处代码为:


<div class="pagination">
--
   <nav class="page-nav">
   <span class="page-number current">1</span><a class="page-number" href="/archives/page/2/">2</a><a class="page-number" href="/archives/page/3/">3</a><a class="extend next" rel="next" href="/archives/page/2/"><i class="icon-angle-right"></i></a>
   </nav>
   </div>

同样的,左箭头也是出现这样的情况,但只出现在博客主界面的归档页面。文章页面则没有这种问题。查看其相关的.ejs文件代码为:

<% if (page.total > 1){ %>
  <div class="pagination">
    <nav class="page-nav">
      <%- paginator({
        prev_text: '<i class="icon-angle-left"></i>',
        next_text: '<i class="icon-angle-right"></i>',
        mid_size: 1
      }) %>
    </nav>
  </div>
<% } %>

用的是您的master分支代码,和您别的分支的代码相同,所以十分困惑是否在这里最近的master分支进行了改动,我不太懂前端,想问问您这种情况的原因是什么。
hexo 版本为4.1.1,在两台电脑上均出现这种情况。检查页面参照您的博客修改html代码后可以正确显示。因为网页在本地调试,不能直接发链接给您,期待您的回复。

@colleen2joe
Copy link

我也出现了相同的情况,按钮显示出错,期待作者大人的回复QAQ

@colleen2joe
Copy link

我认为是图标名称的问题,没有正确导向到icon。我修改了_partial/component/pagination.ejs文件,将prev_text: '',
next_text: '',两句删除了,然后呈现这样的效果,暂时没那么难看了
image

@ghost
Copy link

ghost commented Jan 31, 2020

吃瓜坐等作者解决这问题。我的应急方案是改为:

prev_text: '<',
next_text: '>',

虽然渲染不出来,但是原生的"<"和">"天生就是一个icon,即便效果是一样的,但是还是希望作者能解决这个微不足道的小问题。谢谢!

@ykqmain
Copy link
Contributor

ykqmain commented Feb 10, 2020

初步猜测是hexo插件问题,或者是缺少插件,或者是版本(过高/过低)不兼容。

可以尝试一下这个办法,行动之前切记备份整个博客文件夹

博客根目录名称为Blog

删除根目录下package.jsonpackage-lock.json文件,以及整个node_modules文件夹。

新建文件package.json,写入:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.7.1"
  },
  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-deployer-git": "^0.3.1",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-baidu-sitemap": "^0.1.2",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-feed": "^1.2.2",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-sitemap": "^1.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.0",
    "hexo-renderer-marked": "^0.3.0",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-search": "^1.0.4",
    "hexo-server": "^0.2.2"
  }
}

将新建文件package.json移动到Blog根目录,

打开终端,cdBlog文件夹下,

输入命令npm install,等待依赖安装完成。

如果因为网络问题失败,

  • 要么使用淘宝镜像,npm config set registry https://registry.npm.taobao.org
  • 要么科学上网

如果因为权限问题失败,sudo chown -R $(whoami) 文件夹路径

依赖安装完成后,使用hexo s测试效果。

@FenghuJi
@colleen2joe
@ggbdpq

@nekkomoe
Copy link
Contributor

nekkomoe commented Aug 7, 2020

<% if (page.total > 1){ %>

<%- paginator({ prev_text: '', next_text: '', mid_size: 1 }) %>
<% } %> 这个,缺了一条escape: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants