Git Product home page Git Product logo

hexo-theme-pinghsu's People

Contributors

cccyb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hexo-theme-pinghsu's Issues

换了主题之后,hexo g 报错

ERROR /Users/urzz/Project/own/other/blog/themes/pinghsu/layout/tag.ejs:8
    6| <%- partial('_partial/page-archive') %>
    7|
 >> 8| <%- partial('_partial/footer') %>

/Users/urzz/Project/own/other/blog/themes/pinghsu/layout/_partial/footer.ejs:26
    24|                     	<p>Theme is <a href="https://github.com/cccyb/hexo-theme-pinghsu" target="_blank">Pinghsu</a> by <a href="<%= config.url %>" target="_blank"><%= config.author %></a></p>
    25| 						<p>Powered by <a href="https://hexo.io/" target="_blank" rel="nofollow">hexo</a></p>
 >> 26|                         <p style="margin-top: 10px">站点总字数:<%= totalcount(site) %></p>
    27|                         <% if (theme.busuanzi) { %>
    28|                         <p><span id="busuanzi_container_site_pv" style='display:none'><%- __('views.text') %> <span id="busuanzi_value_site_pv"></span> <%- __('views.unit') %></span></p>
    29|                         <p><span id="busuanzi_container_site_uv" style='display:none'><%- __('vistors.text') %> <span id="busuanzi_value_site_uv"></span> <%- __('vistors.unit') %></span></p>

totalcount is not defined
ReferenceError: /Users/urzz/Project/own/other/blog/themes/pinghsu/layout/tag.ejs:8
    6| <%- partial('_partial/page-archive') %>
    7|
 >> 8| <%- partial('_partial/footer') %>

/Users/urzz/Project/own/other/blog/themes/pinghsu/layout/_partial/footer.ejs:26
    24|                     	<p>Theme is <a href="https://github.com/cccyb/hexo-theme-pinghsu" target="_blank">Pinghsu</a> by <a href="<%= config.url %>" target="_blank"><%= config.author %></a></p>
    25| 						<p>Powered by <a href="https://hexo.io/" target="_blank" rel="nofollow">hexo</a></p>
 >> 26|                         <p style="margin-top: 10px">站点总字数:<%= totalcount(site) %></p>
    27|                         <% if (theme.busuanzi) { %>
    28|                         <p><span id="busuanzi_container_site_pv" style='display:none'><%- __('views.text') %> <span id="busuanzi_value_site_pv"></span> <%- __('views.unit') %></span></p>
    29|                         <p><span id="busuanzi_container_site_uv" style='display:none'><%- __('vistors.text') %> <span id="busuanzi_value_site_uv"></span> <%- __('vistors.unit') %></span></p>

totalcount is not defined
    at eval (eval at exports.compile (/Users/urzz/Project/own/other/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:1728)
    at eval (eval at exports.compile (/Users/urzz/Project/own/other/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:16456)
    at /Users/urzz/Project/own/other/blog/node_modules/ejs/lib/ejs.js:255:15
    at Theme._View.View._compiledSync.locals [as _compiledSync] (/Users/urzz/Project/own/other/blog/node_modules/hexo/lib/theme/view.js:120:22)
    at Theme._View.View.View.renderSync (/Users/urzz/Project/own/other/blog/node_modules/hexo/lib/theme/view.js:48:23)
    at Object.partial (/Users/urzz/Project/own/other/blog/node_modules/hexo/lib/plugins/helper/partial.js:39:15)
    at Object.wrapper [as partial] (/Users/urzz/Project/own/other/blog/node_modules/lodash/lodash.js:4949:19)
    at eval (eval at exports.compile (/Users/urzz/Project/own/other/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:33:99)
    at eval (eval at exports.compile (/Users/urzz/Project/own/other/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:33:136)
    at /Users/urzz/Project/own/other/blog/node_modules/ejs/lib/ejs.js:255:15
    at Theme._View.View._compiled.locals [as _compiled] (/Users/urzz/Project/own/other/blog/node_modules/hexo/lib/theme/view.js:124:48)
    at Theme._View.View.View.render (/Users/urzz/Project/own/other/blog/node_modules/hexo/lib/theme/view.js:29:15)
    at route.set (/Users/urzz/Project/own/other/blog/node_modules/hexo/lib/hexo/index.js:386:29)
    at tryCatcher (/Users/urzz/Project/own/other/blog/node_modules/bluebird/js/release/util.js:16:23)
    at /Users/urzz/Project/own/other/blog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/Users/urzz/Project/own/other/blog/node_modules/hexo/lib/hexo/router.js:134:3)
    at RouteStream.Readable.read (_stream_readable.js:442:10)
    at resume_ (_stream_readable.js:822:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

3个问题

首先十分感谢你将pinghsu主题移植到hexo,这个主题真的很好看。不过在使用过程中我发现3个问题。

  1. 博客页面右边的超链接无法使用。示例。我自己使用时,中文超链接失效,英文正常。我查了一下好像是和URL编解码有关,页面的中文超链接没有进行解码,但我没学过前端所以不太懂233。我看了另一个博客的处理方法是把超链接全部变成随机数字。我在你的代码里也看到了相关实现。
    id = 'directory' + (Math.random() + '').replace(/\D/, ''),

    elem.id = elem.id || (id + guid++);

    但107行可以看出并没有用上随机数。我把107行改为elem.id = id + guid++; 用chrome调试正常。不过应该也可以直接把中文超链接进行解码。
  2. 我看到你也加入了滚动平滑效果。但是返回页首这个箭头是没有平滑效果的,我也不太懂为什么,是a href="#"没有id吗?不过我的处理方法是再设了一个<a id="top" class="anchor-top"></a>,然后css里面设置top:0px;。向上箭头的超链接改为<a href="#top">就行。
  3. 在设置archive页标题时,如果使用了分页,那么标题就只会统计当前页的博客数。因此这里我觉得改成site.posts.length比较好。
    <p style="padding-left: 15px;color: #313131"><%= __('archives.title', page.posts.length) %></p>
  4. archive.ejs里面没有加入以下分页代码,好像会导致无法正常分页。我看了是在page-archive.ejs里加了。不过好像不起作用。
<% if (page.total > 1) { %>
    <div class="lists-navigator clearfix">
    <%- partial('_partial/pagination') %>
    </div>
    <% } %>

另外,我自己在你的基础上自己也做了个博客,加入了看板娘和站内搜索,修改了一些无效的分享链接,加了一些简单的特效,欢迎参观~

TOC目录错误

有的一级标题变成了二级标题,然后该标题下的二级标题变成三级标题.
TIM截图20200910192825
TIM截图20200910193022
image

关于底部问题

底部白块在移动端包裹不了所有文字
建议在css里.footer-meta标签添加height: 200px;

_ is not defined

ERROR ReferenceError: /Users/damon/weiyun/blog/zao/themes/pinghsu/layout/page.ejs:6
    4| <%- partial('_partial/page-tag') %>
    5| <% } else { %>
 >> 6| <%- partial('_partial/page-custom') %>
    7| <% } %>

/Users/damon/weiyun/blog/zao/themes/pinghsu/layout/_partial/page-custom.ejs:1
 >> 1| <%- partial('_partial/header', {
    2|     title: page.title,
    3|     bgColor: 'bg-white'
    4| }) %>
/Users/damon/weiyun/blog/zao/themes/pinghsu/layout/_partial/header.ejs:78
    76|         </a>
    77|         <div class="navbar-menu">
 >> 78|             <% _.forIn(theme.menu, function(value, key) { %>
    79|             <a href="<%- url_for(value) %>" class="<% if (is_current(value)) { %>current<% } %>"><%= __('menu.' + key) %></a>
    80|             <% }); %>
    81|         </div>

_ is not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.