$ hexo init INFO Cloning hexo-starter https://github.com/hexojs/hexo-starter.git INFO Install dependencies warning hexo-renderer-stylus > stylus > css-parse > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecat ed warning hexo-renderer-stylus > stylus > css-parse > css > source-map-resolve > urix@0.1.0: Please see https://github.com /lydell/urix#deprecated warning hexo-renderer-stylus > stylus > css-parse > css > source-map-resolve > resolve-url@0.2.1: https://github.com/lyd ell/resolve-url#deprecated warning Your current version of Yarn is out of date. The latest version is "1.22.15", while you're on "1.22.5". INFO Start blogging with Hexo!
还原所有的包
1 2 3 4 5 6 7 8 9 10
$ yarn yarn install v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages...
$ hexo g INFO Validating config INFO Start processing INFO Files loaded in 212 ms (node:1616) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) (node:1616) Warning: Accessing non-existent property 'column' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'column' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency INFO Generated: archives/index.html INFO Generated: archives/2021/index.html INFO Generated: index.html INFO Generated: archives/2021/11/index.html INFO Generated: fancybox/jquery.fancybox.min.css INFO Generated: js/script.js INFO Generated: css/fonts/FontAwesome.otf INFO Generated: css/style.css INFO Generated: fancybox/jquery.fancybox.min.js INFO Generated: js/jquery-3.4.1.min.js INFO Generated: css/fonts/fontawesome-webfont.eot INFO Generated: css/images/banner.jpg INFO Generated: css/fonts/fontawesome-webfont.woff INFO Generated: css/fonts/fontawesome-webfont.ttf INFO Generated: 2021/11/16/hello-world/index.html INFO Generated: css/fonts/fontawesome-webfont.woff2 INFO Generated: css/fonts/fontawesome-webfont.svg INFO 17 files generated in 584 ms
启动本地的测试服务器
1
hexo s
过程如以下所示:
1 2 3 4
$ hexo s INFO Validating config INFO Start processing INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
$ yarn add hexo-deployer-git yarn add v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages...
success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ hexo-deployer-git@3.0.0 info All dependencies └─ hexo-deployer-git@3.0.0 Done in 1.87s.
$ hexo g INFO Validating config INFO Start processing INFO Files loaded in 212 ms (node:1616) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) (node:1616) Warning: Accessing non-existent property 'column' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'column' of module exports inside circular dependency (node:1616) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency INFO Generated: archives/index.html INFO Generated: archives/2021/index.html INFO Generated: index.html INFO Generated: archives/2021/11/index.html INFO Generated: fancybox/jquery.fancybox.min.css INFO Generated: js/script.js INFO Generated: css/fonts/FontAwesome.otf INFO Generated: css/style.css INFO Generated: fancybox/jquery.fancybox.min.js INFO Generated: js/jquery-3.4.1.min.js INFO Generated: css/fonts/fontawesome-webfont.eot INFO Generated: css/images/banner.jpg INFO Generated: css/fonts/fontawesome-webfont.woff INFO Generated: css/fonts/fontawesome-webfont.ttf INFO Generated: 2021/11/16/hello-world/index.html INFO Generated: css/fonts/fontawesome-webfont.woff2 INFO Generated: css/fonts/fontawesome-webfont.svg INFO 17 files generated in 584 ms
$ hexo d INFO Validating config INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... warning: LF will be replaced by CRLF in 2021/11/16/hello-world/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2021/11/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2021/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in css/fonts/fontawesome-webfont.svg. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in css/style.css. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in fancybox/jquery.fancybox.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/jquery-3.4.1.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/script.js. The file will have its original line endings in your working directory [master (root-commit) ffab492] Site updated: 2021-11-16 16:31:26 17 files changed, 5202 insertions(+) create mode 100644 2021/11/16/hello-world/index.html create mode 100644 archives/2021/11/index.html create mode 100644 archives/2021/index.html create mode 100644 archives/index.html create mode 100644 css/fonts/FontAwesome.otf create mode 100644 css/fonts/fontawesome-webfont.eot create mode 100644 css/fonts/fontawesome-webfont.svg create mode 100644 css/fonts/fontawesome-webfont.ttf create mode 100644 css/fonts/fontawesome-webfont.woff create mode 100644 css/fonts/fontawesome-webfont.woff2 create mode 100644 css/images/banner.jpg create mode 100644 css/style.css create mode 100644 fancybox/jquery.fancybox.min.css create mode 100644 fancybox/jquery.fancybox.min.js create mode 100644 index.html create mode 100644 js/jquery-3.4.1.min.js create mode 100644 js/script.js Enumerating objects: 31, done. Counting objects: 100% (31/31), done. Delta compression using up to 4 threads Compressing objects: 100% (25/25), done. Writing objects: 100% (31/31), 881.69 KiB | 2.44 MiB/s, done. Total 31 (delta 4), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (4/4), done. To github.com:hujiyi/hujiyi.github.io.git + bff8ce1...ffab492 HEAD -> master (forced update) Branch 'master'set up to track remote branch 'master' from 'git@github.com:hujiyi/hujiyi.github.io.git'. INFO Deploy done: git
$ yarn add hexo-renderer-pug hexo-renderer-stylus yarn add v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages...
3.8.4 =================================================================== INFO Start processing INFO Files loaded in 3.37 s INFO Generated: 2021/11/16/hello-world/index.html INFO Generated: archives/2021/11/index.html INFO Generated: archives/2021/index.html INFO Generated: archives/index.html INFO Generated: index.html INFO 5 files generated in 127 ms
测试运行:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$ hexo s INFO Validating config INFO ===================================================================
3.8.4 =================================================================== INFO Start processing INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
3.8.4 =================================================================== INFO Created: D:\sources\hexo-repos\hujiyi.github.io\source\categories\index.md
$ yarn add hexo-generator-search yarn add v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages...
success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ hexo-generator-search@2.4.3 info All dependencies └─ hexo-generator-search@2.4.3 Done in 2.66s.
编辑 _config.butterfly.yml
1 2 3
# Local search local_search: enable: true# 改为 true
# Comments System # --------------------------------------
comments: # Up to two comments system, the first will be shown as default # Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo use: - Gitalk # - Valine # - Disqus text: true# Display the comment name next to the button # lazyload: The comment system will be load when comment element enters the browser's viewport. # If you set it to true, the comment count will be invalid lazyload: true count: true# Display comment count in post's top_img card_post_count: true# Display comment count in Home Page