levonlin / Tinnypp

This is a theme for hexo and based on the theme Tinny.
14 stars 6 forks source link

关于Tinnypp的一些问题 #5

Closed Aabbyeson closed 8 years ago

Aabbyeson commented 8 years ago

博主你好!看了你的博客,你的主题风格我很喜欢,我很想拿来用。 但发现对于我一个只想更多注重于写博客,不懂前端代码的人来说,发现有好几个问题。

  1. 使用说明里边没有说明blog下要配置_config.yml 的root为 /Tinnypp ,链接才能正常使用。
  2. 首页的头像不能正常显示。
  3. 搜索的地方能不能举个配置的例子,这里上手比较难。
  4. 关于我想要配置的话要怎么弄。
levonlin commented 8 years ago

逐条解释一下吧:

  1. _config.yml里的root字段配置的是你的博客的根目录在主机下的那个目录(比如说示例页用路径levonlin,github.io/Tinnypp访问,就得加上目录名/Tinnypp;而我的博客levonlin,github.io直接放在根目录下,所以root字段用/就可以了),其实_config.yml的英文注释说得很清楚了,这和主题没有关系。
  2. 设置主题的_config.yml的author_img即可,当然你的图片得放对位置
  3. 可参见http://www.jerryfu.net/post/search-engine-for-hexo-with-swiftype.html
  4. 具体说明下呗
Aabbyeson commented 8 years ago

第1个你有可能误解我的意思了,Tinnypp主题下_config.yml设置了 menu: 首页: /Tinnypp 归档: /Tinnypp/archives 如果不在root添加Tinnypp 会造成菜单链接对不上

Aabbyeson commented 8 years ago

第4个是“关于我”/about 的配置没有

Aabbyeson commented 8 years ago

刚刚更新了下Tinnypp, hexo g 各种报错了啊。。 themes\Tinnypp\layout_partial\post\article.ejs:6 4|

5| <%- partial('gallery') %>

6| <% if(table&&(item.toc !== false) && theme.toc.article){ %> 7|

8| 9| <%- toc(item.content) %>

Cannot read property 'article' of undefined at eval (eval at (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo-renderer-ejs\node_modules\ejs\lib\ejs.js:242:14), :30:348) at eval (eval at (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo-renderer-ejs\node_modules\ejs\lib\ejs.js:242:14), :30:797) at null._compiledSync (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo-renderer-ejs\node_modules\ejs\lib\ejs.js:255:15) at View.renderSync (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\lib\theme\view.js:50:21) at Object.partial (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\lib\plugins\helper\partial.js:42:17) at Object.wrapper (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\node_modules\lodash\lodash.js:4436:19) at eval (eval at (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo-renderer-ejs\node_modules\ejs\lib\ejs.js:242:14), :30:35) at eval (eval at (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo-renderer-ejs\node_modules\ejs\lib\ejs.js:242:14), :30:118) at null._compiledSync (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo-renderer-ejs\node_modules\ejs\lib\ejs.js:255:15) at tryCatcher (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\node_modules\bluebird\js\release\util.js:16:23) at null._compiled (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\node_modules\bluebird\js\release\method.js:15:34) at View.render (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\lib\theme\view.js:29:15) at E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\lib\hexo\index.js:387:25 at tryCatcher (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\node_modules\bluebird\js\release\util.js:16:23) at E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\node_modules\bluebird\js\release\method.js:15:34 at RouteStream._read (E:\AabbyesonBlog\AabbyesonBlog\node_modules\hexo\lib\hexo\router.js:134:3) at RouteStream.Readable.read (_streamreadable.js:336:10) at resume (_stream_readable.js:726:12) at nextTickCallbackWith2Args (node.js:442:9) at process._tickCallback (node.js:356:17) Unhandled rejection TypeError: E:\AabbyesonBlog\AabbyesonBlog\themes\Tinnypp\layout\layout.ejs:71 69| 70| <% } else if(page.category!=null||page.tag!=null||page.archive!=null) { %>

71| <%- partial('_partial/head') %> 72| 73|

74| <%- partial('_partial/header') %>

E:\AabbyesonBlog\AabbyesonBlog\themes\Tinnypp\layout_partial\head.ejs:55 53| <% } %> 54|

55| <% if (theme.duoshuo.enable){ %> 56| 57| <% } %> 58| <% if(theme.colorscheme.enable) {%>

levonlin commented 8 years ago

menu字段配置的是首页导航条上的文字和链接指向的页面。比如说你想配置“关于我“页面,首先你得有个页面,可以是markdown或html,放到你博客目录下的source/about目录里;然后再去主题的_config.yml里配置如关于我: /about,就可以给导航条上添加一个链接文字“关于我”、并让该链接指向生成的文件中的about目录。

每个人的喜好不同,所以主题默认的_config.yml里给的只能是个基本范例而已,具体配置还得你自己认真参考里面的注释,注释已经给出很详细的指导了。

总之,搭博客本来就是个很折腾的过程呀:joy:

levonlin commented 8 years ago

至于你说更新后报错,我在我本地重新下了主题,并未发生错误。你可以试试在一个新的目录hexo init一个新博客,再下载主题试试有没有错。

Aabbyeson commented 8 years ago

嗯嗯,好的,谢谢你耐心的回复。:smile:

levonlin commented 8 years ago

我更新了下hexo,发现你出现的错误是由于新旧版本的插件机制不同导致的,新版的hexo中不再需要为_config.yml添加诸如:

    plugins:
    - hexo-generator-feed

如果你添加了就会出错。