Part 3: Errors when customizing the theme
Early this morning I was adding social links, google analytics and site map to my blog. After I edited the two config files, I made a hexo clean
. Then I can’t generate the static web pages any more! There were only .md
files and .styl
files in the public folders without being converted to .html
and .css
files.
Then I spent the whole morning to solve this problem!
Soluntion 1
The first possible reason came from HuiHut’s blog. He suggested that this may be due to Hexo plugins missing.
Check the plugins:1
2
3
4
5
6
7
8
9
10
11
12
13
14$ npm ls --depth 0
# Result below:
hexo-site@0.0.0 /Users/wang/Documents/blog
├── hexo@3.4.4
├── hexo-deployer-git@0.3.1
├── hexo-generator-archive@0.1.5
├── hexo-generator-category@0.1.3
├── hexo-generator-index@0.2.1
├── hexo-generator-sitemap@1.2.0
├── hexo-generator-tag@0.2.0
├── hexo-renderer-ejs@0.3.1
├── hexo-renderer-marked@0.3.2
├── hexo-renderer-stylus@0.3.3
└── hexo-server@0.2.2
Everything is all right.
Solution 2
Someone said wrong formats of .md
in the ~/source/_posts/
may cause such errors. Then I deleted all .md
files in this folder, but I still can’t generate any static files.
Solution 3
I convinced that errors must come from the config files. I edited the files again, but this time I can see the error messages in Terminal:
1 | Unhandled rejection Error: ENOENT: no such file or directory, open '/Users/wang/Documents/blog/themes/next/layout/_scripts/schemes/.swig' |
By googling, the messages mean hexo can’t find the theme. Then I went over my ~/theme/next/_config.yml
for another time, and found all these were because of AN EXTRA SPACE! I deleted it, generated again, finally I can see all those static files in the public folder!