hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.22k stars 4.82k forks source link

Hexo fails to handle complex html pages #1705

Closed qiuwei closed 8 years ago

qiuwei commented 8 years ago

I use pdf2htmlEX to generate an HTML page of my cv and put it into source/resume/index.html. I disable the processing in _config,yml by adding resume/* to skip_render.

However,

hexo g

gives weird fatal errors caused by this html file.(The error disappears if I remove this file or rename it to index without the filetype extension)

01:17:12.764 DEBUG Hexo version: 3.1.1
01:17:12.772 DEBUG Working directory: /media/Program_Data/Project/fun/qiuwei.github.com/
01:17:13.058 DEBUG Config loaded: /media/Program_Data/Project/fun/qiuwei.github.com/_config.yml
01:17:13.079 DEBUG Script loaded: themes/landscape/scripts/fancybox.js
01:17:13.102 DEBUG Plugin loaded: hexo-deployer-git
01:17:13.109 DEBUG Plugin loaded: hexo-generator-archive
01:17:13.112 DEBUG Plugin loaded: hexo-generator-category
01:17:13.116 DEBUG Plugin loaded: hexo-generator-index
01:17:13.119 DEBUG Plugin loaded: hexo-generator-tag
01:17:13.128 DEBUG Plugin loaded: hexo-renderer-ejs
01:17:13.256 DEBUG Plugin loaded: hexo-renderer-marked
01:17:13.517 DEBUG Plugin loaded: hexo-renderer-stylus
01:17:13.670 DEBUG Plugin loaded: hexo-server
01:17:13.672 DEBUG Loading database.
01:17:13.795 DEBUG Unchanged: source/CNAME
01:17:13.795 DEBUG Unchanged: source/_posts/Mac-like-Umlaut-Composition-Under-Archlinux.md
01:17:13.795 DEBUG Unchanged: source/_posts/hello-world.md
01:17:13.796 DEBUG Unchanged: source/about/index.md
01:17:13.796 DEBUG Updated: source/resume/debug.log
01:17:13.801 DEBUG Unchanged: source/resume/index.html
01:17:13.805 DEBUG Processed: CNAME
01:17:13.808 DEBUG Processed: resume/index.html
01:17:13.809 DEBUG Processed: resume/debug.log
01:17:13.810 DEBUG Processed: about/index.md
01:17:13.812 DEBUG Processed: _posts/hello-world.md
01:17:13.813 DEBUG Processed: _posts/Mac-like-Umlaut-Composition-Under-Archlinux.md
01:17:13.864 DEBUG Unchanged: themes/landscape/Gruntfile.js
01:17:13.865 DEBUG Unchanged: themes/landscape/LICENSE
01:17:13.865 DEBUG Unchanged: themes/landscape/README.md
01:17:13.865 DEBUG Unchanged: themes/landscape/_config.yml
01:17:13.865 DEBUG Unchanged: themes/landscape/languages/default.yml
01:17:13.865 DEBUG Unchanged: themes/landscape/languages/zh-CN.yml
01:17:13.865 DEBUG Unchanged: themes/landscape/languages/zh-TW.yml
01:17:13.867 DEBUG Unchanged: themes/landscape/layout/_partial/after-footer.ejs
01:17:13.867 DEBUG Unchanged: themes/landscape/layout/_partial/archive-post.ejs
01:17:13.867 DEBUG Unchanged: themes/landscape/layout/_partial/archive.ejs
01:17:13.867 DEBUG Unchanged: themes/landscape/layout/_partial/article.ejs
01:17:13.868 DEBUG Unchanged: themes/landscape/layout/_partial/footer.ejs
01:17:13.869 DEBUG Unchanged: themes/landscape/layout/_partial/google-analytics.ejs
01:17:13.870 DEBUG Unchanged: themes/landscape/layout/_partial/head.ejs
01:17:13.871 DEBUG Unchanged: themes/landscape/layout/_partial/header.ejs
01:17:13.872 DEBUG Unchanged: themes/landscape/layout/_partial/mobile-nav.ejs
01:17:13.872 DEBUG Unchanged: themes/landscape/layout/_partial/post/category.ejs
01:17:13.873 DEBUG Unchanged: themes/landscape/layout/_partial/post/date.ejs
01:17:13.873 DEBUG Unchanged: themes/landscape/layout/_partial/post/gallery.ejs
01:17:13.874 DEBUG Unchanged: themes/landscape/layout/_partial/post/nav.ejs
01:17:13.874 DEBUG Unchanged: themes/landscape/layout/_partial/post/tag.ejs
01:17:13.874 DEBUG Unchanged: themes/landscape/layout/_partial/sidebar.ejs
01:17:13.874 DEBUG Unchanged: themes/landscape/layout/_widget/archive.ejs
01:17:13.874 DEBUG Unchanged: themes/landscape/layout/_widget/category.ejs
01:17:13.875 DEBUG Unchanged: themes/landscape/layout/_widget/recent_posts.ejs
01:17:13.875 DEBUG Unchanged: themes/landscape/layout/_partial/post/title.ejs
01:17:13.875 DEBUG Unchanged: themes/landscape/layout/_widget/tag.ejs
01:17:13.875 DEBUG Unchanged: themes/landscape/layout/_widget/tagcloud.ejs
01:17:13.875 DEBUG Unchanged: themes/landscape/layout/archive.ejs
01:17:13.875 DEBUG Unchanged: themes/landscape/layout/category.ejs
01:17:13.876 DEBUG Unchanged: themes/landscape/layout/index.ejs
01:17:13.876 DEBUG Unchanged: themes/landscape/layout/layout.ejs
01:17:13.876 DEBUG Unchanged: themes/landscape/layout/page.ejs
01:17:13.882 DEBUG Unchanged: themes/landscape/layout/post.ejs
01:17:13.882 DEBUG Unchanged: themes/landscape/layout/tag.ejs
01:17:13.883 DEBUG Unchanged: themes/landscape/package.json
01:17:13.883 DEBUG Unchanged: themes/landscape/scripts/fancybox.js
01:17:13.884 DEBUG Unchanged: themes/landscape/source/css/_extend.styl
01:17:13.885 DEBUG Unchanged: themes/landscape/source/css/_partial/archive.styl
01:17:13.886 DEBUG Unchanged: themes/landscape/source/css/_partial/article.styl
01:17:13.886 DEBUG Unchanged: themes/landscape/source/css/_partial/comment.styl
01:17:13.886 DEBUG Unchanged: themes/landscape/source/css/_partial/footer.styl
01:17:13.886 DEBUG Unchanged: themes/landscape/source/css/_partial/header.styl
01:17:13.887 DEBUG Unchanged: themes/landscape/source/css/_partial/highlight.styl
01:17:13.887 DEBUG Unchanged: themes/landscape/source/css/_partial/mobile.styl
01:17:13.887 DEBUG Unchanged: themes/landscape/source/css/_partial/sidebar-aside.styl
01:17:13.888 DEBUG Unchanged: themes/landscape/source/css/_partial/sidebar-bottom.styl
01:17:13.888 DEBUG Unchanged: themes/landscape/source/css/_partial/sidebar.styl
01:17:13.888 DEBUG Unchanged: themes/landscape/source/css/_util/grid.styl
01:17:13.888 DEBUG Unchanged: themes/landscape/source/css/_util/mixin.styl
01:17:13.888 DEBUG Unchanged: themes/landscape/source/css/fonts/fontawesome-webfont.eot
01:17:13.888 DEBUG Unchanged: themes/landscape/source/css/_variables.styl
01:17:13.888 DEBUG Unchanged: themes/landscape/source/fancybox/fancybox_loading@2x.gif
01:17:13.888 DEBUG Unchanged: themes/landscape/source/fancybox/blank.gif
01:17:13.888 DEBUG Unchanged: themes/landscape/source/css/fonts/fontawesome-webfont.woff
01:17:13.889 DEBUG Unchanged: themes/landscape/source/css/fonts/FontAwesome.otf
01:17:13.889 DEBUG Unchanged: themes/landscape/source/fancybox/fancybox_loading.gif
01:17:13.889 DEBUG Unchanged: themes/landscape/source/fancybox/fancybox_overlay.png
01:17:13.889 DEBUG Unchanged: themes/landscape/source/css/style.styl
01:17:13.889 DEBUG Unchanged: themes/landscape/source/fancybox/fancybox_sprite.png
01:17:13.889 DEBUG Unchanged: themes/landscape/source/fancybox/fancybox_sprite@2x.png
01:17:13.889 DEBUG Unchanged: themes/landscape/source/fancybox/helpers/fancybox_buttons.png
01:17:13.889 DEBUG Unchanged: themes/landscape/source/fancybox/helpers/jquery.fancybox-buttons.css
01:17:13.890 DEBUG Unchanged: themes/landscape/source/fancybox/helpers/jquery.fancybox-buttons.js
01:17:13.890 DEBUG Unchanged: themes/landscape/source/fancybox/helpers/jquery.fancybox-media.js
01:17:13.890 DEBUG Unchanged: themes/landscape/source/fancybox/helpers/jquery.fancybox-thumbs.css
01:17:13.890 DEBUG Unchanged: themes/landscape/source/fancybox/helpers/jquery.fancybox-thumbs.js
01:17:13.890 DEBUG Unchanged: themes/landscape/source/fancybox/jquery.fancybox.css
01:17:13.890 DEBUG Unchanged: themes/landscape/source/fancybox/jquery.fancybox.js
01:17:13.890 DEBUG Unchanged: themes/landscape/source/js/script.js
01:17:13.890 DEBUG Unchanged: themes/landscape/source/fancybox/jquery.fancybox.pack.js
01:17:13.891 DEBUG Unchanged: themes/landscape/source/css/fonts/fontawesome-webfont.ttf
01:17:13.892 DEBUG Unchanged: themes/landscape/source/css/fonts/fontawesome-webfont.svg
01:17:13.892 DEBUG Unchanged: themes/landscape/source/css/images/banner.jpg
01:17:13.894 DEBUG Processed: source/css/images/banner.jpg
01:17:13.894 DEBUG Processed: source/css/fonts/fontawesome-webfont.svg
01:17:13.895 DEBUG Processed: source/css/fonts/fontawesome-webfont.ttf
01:17:13.895 DEBUG Processed: source/fancybox/jquery.fancybox.pack.js
01:17:13.896 DEBUG Processed: source/js/script.js
01:17:13.897 DEBUG Processed: source/fancybox/jquery.fancybox.js
01:17:13.897 DEBUG Processed: source/fancybox/jquery.fancybox.css
01:17:13.898 DEBUG Processed: source/fancybox/helpers/jquery.fancybox-thumbs.js
01:17:13.898 DEBUG Processed: source/fancybox/helpers/jquery.fancybox-thumbs.css
01:17:13.898 DEBUG Processed: source/fancybox/helpers/jquery.fancybox-media.js
01:17:13.899 DEBUG Processed: source/fancybox/helpers/jquery.fancybox-buttons.js
01:17:13.901 DEBUG Processed: source/fancybox/helpers/jquery.fancybox-buttons.css
01:17:13.901 DEBUG Processed: source/fancybox/helpers/fancybox_buttons.png
01:17:13.902 DEBUG Processed: source/fancybox/fancybox_sprite@2x.png
01:17:13.902 DEBUG Processed: source/fancybox/fancybox_sprite.png
01:17:13.903 DEBUG Processed: source/fancybox/fancybox_overlay.png
01:17:13.905 DEBUG Processed: source/css/style.styl
01:17:13.906 DEBUG Processed: source/fancybox/fancybox_loading.gif
01:17:13.906 DEBUG Processed: source/css/fonts/FontAwesome.otf
01:17:13.907 DEBUG Processed: source/fancybox/fancybox_loading@2x.gif
01:17:13.908 DEBUG Processed: source/fancybox/blank.gif
01:17:13.908 DEBUG Processed: source/css/fonts/fontawesome-webfont.woff
01:17:13.909 DEBUG Processed: source/css/fonts/fontawesome-webfont.eot
01:17:13.912 DEBUG Processed: layout/tag.ejs
01:17:13.914 DEBUG Processed: layout/post.ejs
01:17:13.915 DEBUG Processed: layout/page.ejs
01:17:13.916 DEBUG Processed: layout/layout.ejs
01:17:13.917 DEBUG Processed: layout/index.ejs
01:17:13.918 DEBUG Processed: layout/category.ejs
01:17:13.918 DEBUG Processed: layout/archive.ejs
01:17:13.920 DEBUG Processed: layout/_widget/tagcloud.ejs
01:17:13.922 DEBUG Processed: layout/_widget/tag.ejs
01:17:13.925 DEBUG Processed: layout/_partial/post/title.ejs
01:17:13.925 DEBUG Processed: layout/_widget/recent_posts.ejs
01:17:13.926 DEBUG Processed: layout/_widget/category.ejs
01:17:13.927 DEBUG Processed: layout/_widget/archive.ejs
01:17:13.928 DEBUG Processed: layout/_partial/sidebar.ejs
01:17:13.928 DEBUG Processed: layout/_partial/post/tag.ejs
01:17:13.929 DEBUG Processed: layout/_partial/post/nav.ejs
01:17:13.930 DEBUG Processed: layout/_partial/post/gallery.ejs
01:17:13.931 DEBUG Processed: layout/_partial/post/date.ejs
01:17:13.931 DEBUG Processed: layout/_partial/post/category.ejs
01:17:13.932 DEBUG Processed: layout/_partial/mobile-nav.ejs
01:17:13.932 DEBUG Processed: layout/_partial/header.ejs
01:17:13.933 DEBUG Processed: layout/_partial/head.ejs
01:17:13.933 DEBUG Processed: layout/_partial/google-analytics.ejs
01:17:13.934 DEBUG Processed: layout/_partial/footer.ejs
01:17:13.935 DEBUG Processed: layout/_partial/article.ejs
01:17:13.935 DEBUG Processed: layout/_partial/archive.ejs
01:17:13.935 DEBUG Processed: layout/_partial/archive-post.ejs
01:17:13.936 DEBUG Processed: layout/_partial/after-footer.ejs
01:17:13.938 DEBUG Processed: languages/zh-TW.yml
01:17:13.939 DEBUG Processed: languages/zh-CN.yml
01:17:13.942 DEBUG Processed: languages/default.yml
01:17:13.944 DEBUG Theme config loaded.
01:17:13.945 DEBUG Processed: _config.yml
01:17:14.453 FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: expected end of comment, got end of file
    at Tokenizer.nextToken (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/lexer.js:282:23)
    at Object.extend.nextToken (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:32:27)
    at Object.extend.peekToken (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:44:43)
    at Object.extend.parseNodes (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:1124:38)
    at Object.extend.parseAsRoot (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:1177:42)
    at Object.module.exports.parse (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:1199:18)
    at Object.module.exports.compile (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/compiler.js:1118:48)
    at Obj.extend._compile (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:444:35)
    at Obj.extend.compile (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:433:18)
    at null.<anonymous> (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:378:22)
    at Object.exports.withPrettyErrors (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/lib.js:24:16)
    at Obj.extend.render (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:374:20)
    at Obj.extend.renderString (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:261:21)
    at /media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/extend/tag.js:56:9
    at tryCatcher (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._resolveFromResolver (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:480:31)
    at new Promise (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:70:37)
    at Tag.render (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/extend/tag.js:55:10)
    at Object.tagFilter [as onRenderEnd] (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/hexo/post.js:253:16)
    at /media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/hexo/render.js:55:19
    at tryCatcher (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:507:31)
    at Promise._settlePromiseAt (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:581:18)
    at Promise._settlePromises (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:697:14)
    at Async._drainQueue (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
01:17:14.478 DEBUG Database saved
01:17:14.478 FATAL Error: expected end of comment, got end of file
    at Tokenizer.nextToken (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/lexer.js:282:23)
    at Object.extend.nextToken (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:32:27)
    at Object.extend.peekToken (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:44:43)
    at Object.extend.parseNodes (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:1124:38)
    at Object.extend.parseAsRoot (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:1177:42)
    at Object.module.exports.parse (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/parser.js:1199:18)
    at Object.module.exports.compile (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/compiler.js:1118:48)
    at Obj.extend._compile (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:444:35)
    at Obj.extend.compile (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:433:18)
    at null.<anonymous> (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:378:22)
    at Object.exports.withPrettyErrors (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/lib.js:24:16)
    at Obj.extend.render (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:374:20)
    at Obj.extend.renderString (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/nunjucks/src/environment.js:261:21)
    at /media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/extend/tag.js:56:9
    at tryCatcher (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._resolveFromResolver (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:480:31)
    at new Promise (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:70:37)
    at Tag.render (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/extend/tag.js:55:10)
    at Object.tagFilter [as onRenderEnd] (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/hexo/post.js:253:16)
    at /media/Program_Data/Project/fun/qiuwei.github.com/node_modules/hexo/lib/hexo/render.js:55:19
    at tryCatcher (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:507:31)
    at Promise._settlePromiseAt (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:581:18)
    at Promise._settlePromises (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/promise.js:697:14)
    at Async._drainQueue (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues alias xclip="xclip -selection c"(/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/media/Program_Data/Project/fun/qiuwei.github.com/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

However, everything works fine if I copy the html file to the public directory directly. The html page can be found at http://wei.qiu.es/resume/

Xuanwo commented 8 years ago

use resume/** have a try ?

qiuwei commented 8 years ago

No luck. Hexo still gives the same weird error.

I think hexo is still trying to parse the html page, even though all I want is simply copy the html file unchanged to public directory.

Xuanwo commented 8 years ago

try this :

include:
  - .htaccess

exclude:
  - tmp/**/*

In Hexo 3.2-beta

qiuwei commented 8 years ago

I've tried this.

exclude indeed excludes processing of files, but it doesn't copy the files to public.

The semantics of exclude and skip_render is supposed to be different, right?

Xuanwo commented 8 years ago

looks like the problem of nunjucks, and I think we can have a better way for this.

Xuanwo commented 8 years ago

@qiuwei Due to the latest commit, you can use the github version to have a try.

qiuwei commented 8 years ago

@Xuanwo It's fixed:)

Thanks for your awesome work!

Xuanwo commented 8 years ago

@qiuwei you should thank @tommy351 , :smile: , anyway, enjoy your life with Hexo.

Xuanwo commented 8 years ago

Closed for solved.