kaiiiz / hexo-theme-book Goto Github PK
View Code? Open in Web Editor NEW[No Longer Maintained] A simple, elegant, book-like hexo theme with some useful features.
Home Page: https://kaiiiz.github.io/hexo-theme-book-demo/
License: MIT License
[No Longer Maintained] A simple, elegant, book-like hexo theme with some useful features.
Home Page: https://kaiiiz.github.io/hexo-theme-book-demo/
License: MIT License
Hi @kaiiiz this is a great theme! I noticed that you recommended to check out Hugo and I'm wondering if you had a chance to migrate this theme to support Hugo.
增加访问统计功能,能帮助作者了解书籍的受欢迎程度,建议增加此功能。
Thank you for your great theme.
I noticed the following code in _config.yml in demo.
- name: markdown-it-container
options: success
- name: markdown-it-container
options: info
- name: markdown-it-container
options: warning
- name: markdown-it-container
options: danger
But the dev branch does not support these blocks now. Would it be supported soon? I am looking forward to it.
I have changed language in _config.yml
into zh
, but hexo still use Japanese fonts.
What's more, the location of punctuation is not correct. For example, all comma should be put at the left-bottom corner, not in the middle, like English.
I am using dev
branch of the theme, commit 28c966.
Thank you for your wonderful theme.
Assuming there is two post: ThisWorksFine.md
and ThisWillNotWorkWith space.md
.
menu.md
:
# section a
## part a
* [ThisWorksFine](/ThisWorksFine)
* [ThisWillNotWork](/ThisWillNotWorkWith space)
* [ThisAlsoNotWork](/ThisWillNotWorkWith\ space)
I am using the last version of dev branch.
it would be better if pagination is supported 🥺
Is there any plan to support PWA?
one can use the existence of the field to replace the enable
flag.
and making the comments
config optional by an outer if
.
when i change theme to book then run hexo g command
yyf@yyf-GP62-2QE:~/superyyf.github.io$ hexo g
INFO Validating config
INFO Start processing
FATAL {
err: TypeError: Cannot read property 'path' of undefined
at Hexo. (/home/yyf/superyyf.github.io/themes/book/scripts/render.js:52:31)
at Hexo.tryCatcher (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/util.js:16:23)
at Hexo. (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/method.js:15:34)
at /home/yyf/superyyf.github.io/node_modules/hexo/lib/extend/filter.js:67:52
at tryCatcher (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/reduce.js:166:18)
at Object.gotAccum (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/reduce.js:155:25)
at Object.tryCatcher (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromiseCtx (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/promise.js:641:10)
at _drainQueueStep (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/async.js:97:12)
at _drainQueue (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/yyf/superyyf.github.io/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:461:21)
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
How to add local search
ERROR {
err: Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
at module.exports (/Users/jackfeng/item/hexo_blog_book/node_modules/_node-sass@4.14.1@node-sass/lib/binding.js:13:13)
at Object. (/Users/jackfeng/item/hexo_blog_book/node_modules/_node-sass@4.14.1@node-sass/lib/index.js:14:35)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/Users/jackfeng/item/hexo_blog_book/node_modules/_hexo-renderer-scss@1.2.0@hexo-renderer-scss/lib/renderer.js:1:14)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at req (/Users/jackfeng/item/hexo_blog_book/node_modules/hexo/lib/hexo/index.js:292:23)
at /Users/jackfeng/item/hexo_blog_book/node_modules/_hexo-renderer-scss@1.2.0@hexo-renderer-scss/index.js:1:81
at /Users/jackfeng/item/hexo_blog_book/node_modules/hexo/lib/hexo/index.js:305:14
at tryCatcher (/Users/jackfeng/item/hexo_blog_book/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/jackfeng/item/hexo_blog_book/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/jackfeng/item/hexo_blog_book/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/jackfeng/item/hexo_blog_book/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/jackfeng/item/hexo_blog_book/node_modules/bluebird/js/release/promise.js:729:18)
} Plugin load failed: %s hexo-renderer-scss
It's very strange that when clicking item the whole menu collapses directly (first image), and in yours item just turns to blue and menu stay unchanged (second image). I doubt some modifications to original theme cause them but after pulling raw theme code these phenomena still exist. And double check path is same as these in menu (e.g. in file system the path is /demo/demo/test.md
and in menu it is #demo ##demo *[test](/demo/demo/test/)
Is there any other settings?
changing $border-color
does not effect table :: https://github.com/kaiiiz/hexo-theme-book/blob/master/source/css/book.scss#L147
I wanted to put new items into the menu, but when I clicked the book, it showed cannot find /deep-learning/first-post. have no idea where to fix this.
I want to delete the time under the avatar, do not find a way, please help me, thank you
hello, i want to know how to use dynamic menu
what is it menu.md config
thx
like this example:
Please update the night mode.
I'd like a side or bottom toggle.
Or config background setting ok.
FATAL {
err: TypeError: Cannot read property 'path' of undefined
at Hexo.<anonymous> (/data/data/com.termux/files/home/py.loafing.cn/themes/book/scripts/render.js:52:31)
at Hexo.tryCatcher (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/util.js:16:23)
at Hexo.<anonymous> (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/method.js:15:34)
at /data/data/com.termux/files/home/py.loafing.cn/node_modules/hexo/lib/extend/filter.js:67:52
at tryCatcher (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/reduce.js:166:18)
at Object.gotAccum (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/reduce.js:155:25)
at Object.tryCatcher (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromiseCtx (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/promise.js:641:10)
at _drainQueueStep (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/async.js:97:12)
at _drainQueue (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/data/data/com.termux/files/home/py.loafing.cn/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:456:21) } Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
err: TypeError: Cannot read property 'path' of undefined
I noticed the following error while building the init site with v3.0.0:
$ hexo clean
INFO Validating config
INFO Deleted database.
INFO Deleted public folder.
$ hexo generate
INFO Validating config
INFO Start processing
FATAL {
err: TypeError: Cannot read property 'path' of undefined
at Hexo.<anonymous> (/home/chn/Desktop/hexo/themes/book/scripts/render.js:52:31)
at Hexo.tryCatcher (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Hexo.<anonymous> (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/method.js:15:34)
at /home/chn/Desktop/hexo/node_modules/hexo/lib/extend/filter.js:67:52
at tryCatcher (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/reduce.js:166:18)
at Object.gotAccum (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/reduce.js:155:25)
at Object.tryCatcher (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromiseCtx (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/promise.js:641:10)
at _drainQueueStep (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/async.js:97:12)
at _drainQueue (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/chn/Desktop/hexo/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:461:21)
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
But v2.1.0 works well.
I tried to figure out why. I found that after removing the following code in scripts/render.js
at line 51, v3.0.0 works.
hexo.extend.filter.register('after_generate', function () {
hexo.route.remove(home_file.path);
hexo.route.remove(menu_file.path);
});
Thanks for your awesome theme, and I've found horizontal length of posts is too wide to read in desktop full screen, how to narrow it in this condition?
Hope there re some plans to solve it
我新增了一个根据菜单分页的代码但是我还修改了其他的代码
我搞不懂这个pull request 如何提交单个文件
我只能把根据菜单分页的代码放在这里
/* global hexo */
'use strict';
hexo.extend.generator.register('post', function (locals) {
var posts = locals.posts.toArray();
var pattern = /(?<=\(\/).*?(?=\))/g;
var titlePattern = /(?<=\[).*(?=\])/g;
var menu = hexo.theme.config.menu_page;
var pages = hexo.locals.get('pages')
var match;
var matchTitle;
pages.forEach(function(page){
if(page.source === menu) {
match= page.raw.match(pattern);
matchTitle = page.raw.match(titlePattern);
if(match.length!=matchTitle.length){
throw TypeError("两个匹配的不相同",match,matchTitle);
}
}
})
return locals.posts.map(function (post, i) {
post.hasNext=post.hasPrev = true;
var current =match.indexOf(post.slug);
if(current!=-1){
post.nextPath = match[current+1]||null;
post.nextTitle = matchTitle[current+1]||null;
post.prevPath = match[current-1]||null;
post.prevTitle = match[current-1]||null;
}
if(i===0)post.hasPrev = false;
if(i===locals.posts.length-1) post.hasNext = false;
return {
path: post.path,
data: post,
layout: 'post'
};
});
});
hi, you kai, is there any guide to use this theme to github page, I have tried but failed, you can check my repo here: https://github.com/CSLearningPath/CSLearningPath.github.io
the warning message is :
You are attempting to use a Jekyll theme, "themes/hexo-theme-book", which is not supported by GitHub Pages. Please visit https://pages.github.com/themes/ for a list of supported themes. If you are using the "theme" configuration variable for something other than a Jekyll theme, we recommend you rename this variable throughout your site. For more information, see https://docs.github.com/github/working-with-github-pages/adding-a-theme-to-your-github-pages-site-using-jekyll.
any help?
The example website of author works well, but i get this problem. How can I fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.