Notes
1.0.0
1.0.0
  • Introduction
  • Commands
    • cd
    • df
    • du
    • fc-cahe
    • ifconfig
    • ip
    • ls
    • lsb_release
    • mkdir
    • mksquashfs
    • mount
    • ping
    • pwd
    • rm
    • sar
    • sudo
  • Linux C
    • Preprocessor
    • Keywords
    • Kernel
      • Ftrace
      • Watchdog
  • Python
    • general
      • Decorator
      • Generator
      • Iterator
      • Lambda
    • Download
    • NIC
  • Network
    • Protocol
      • Link layer
      • IP
      • ARP
      • ICMP
    • Proxy
      • Cntlm
      • Proxychains4
      • ShadowSocks
    • Tools
      • iperf
      • tc
      • Wireshark
    • Apps
      • samba
      • tftp
  • Software
    • Atom
    • Chrome
    • Docker
    • Git
    • Gitbook
    • Hexo
    • Nodejs
    • Teraterm
    • Tex
    • Tmux
    • VIM
    • VSCode
  • Database
    • MongoDB
  • Web
    • CSS
    • LNMP
  • Tools
    • common
    • programming
  • Ubuntu
    • Add user
    • AWS EC2
    • FAQ
    • Installer
    • Shell
    • Shell scripts
    • Themes
    • VPS
  • Windows
    • PowerShell
    • CMD
    • FAQ
  • Aphorisms
  • Book List
  • Favorites
  • Appendix
    • ASCII
    • GSM
Powered by GitBook
On this page
  • 安装 Hexo
  • 常用插件
  • 分页功能
  • 常见问题解决方法
  • 执行 hexo d 失败

Was this helpful?

  1. Software

Hexo

安装 Hexo

使用 node.js 中的包管理工具 npm 安装 hexo

npm install hexo-cli -g
hexo init <blog-floder-name>  # e.g. Blog
cd <blog-floder-name>
npm install

常用插件

npm install hexo-server --save
npm install hexo-deployer-git --save

npm install hexo-generator-tag --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-feed --save
npm install hexo-generator-sitemap --save
npm install hexo-generator-index --save
npm install hexo-generator-search --save

npm install hexo-renderer-jade --save
npm install hexo-renderer-ejs --save
npm install hexo-renderer-less --save
npm install hexo-renderer-sass --save
npm install hexo-renderer-stylus --save
npm insatll hexo-renderer-marked --save

分页功能

在保证hexo-generator-index,hexo-generator-tag,hexo-generator-archive已安装的情况下,可以通过修改博客根目录下的_config.yml文件令主页、归档页与标签页使用不同的per_page,保证不同页面的每页内容列表数不相同。

index_generator:
  per_page: 8

archive_generator:
  per_page: 0
  yearly: true
  monthly: false

tag_generator:
  per_page: 0

当per_page为0时,代表不分页。

常见问题解决方法

执行 hexo d 失败

问题描述

$ hexo d
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: EACCES: permission denied, unlink '/home/litreily/Workspace/Blog/.deploy_git/about/index.html'
    at Error (native)

问题分析

从错误消息可以看错,hexo的网站部署指令无法链接到指定文件,有可能是修改博客后部分链接失效导致的,此时可以删除.deploy_git文件夹,然后重新执行hexo d。

解决方法

sudo rm -rf .deploy_git
hexo d
PreviousGitbookNextNodejs

Last updated 5 years ago

Was this helpful?