一些个错误
hexo默认主题是landscape,因为太普通了,想换一个,好不容易解决git clone速度慢的问题,屁颠屁颠的配置好_config.yml,打开网页一看,给我出了这么个玩意
extends includes/layout.pug block content #recent-posts.recent-posts include includes/recent-posts.pug include includes/pagination.pug
网页什么样式,文字都没有,果然是神烦的hexo,不多逼逼,说一下解决办法
1、在hexo目录下打开git bash,输入命令:
npm install --save hexo-renderer-jade hexo-generator-feed hexo-generator-sitemap hexo-browsersync hexo-generator-archive
2、然后又报错
$ npm install --save hexo-renderer-jade hexo-generator-feed hexo-generator-sitemap hexo-browsersync hexo-generator-archive
npm WARN deprecated hexo-renderer-jade@0.5.0: hexo-renderer-jade has been deprecated. Please install hexo-renderer-pug and rename all *.jade files to *.pug.
npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer
npm WARN deprecated constantinople@3.0.2: Please update to at least constantinople 3.1.1
npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
这样就是配置好了
changed 212 packages, and audited 451 packages in 3m
33 packages are looking for funding
run `npm fund` for details
9 vulnerabilities (1 low, 4 high, 4 critical)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
然后三部曲,访问你 - 我和我的猪猪4000端口就可以了
主题魔改
菜单栏
menu:
Home: / || fas fa-home
Archives: /archives/ || fas fa-archive
Tags: /tags/ || fas fa-tags
Categories: /categories/ || fas fa-folder-open
List||fas fa-list:
- Music || /music/ || fas fa-music
- Movie || /movies/ || fas fa-video
Link: /link/ || fas fa-link
About: /about/ || fas fa-heart
图像设置
# Favicon(網站圖標)
favicon: /img/favicon.png
# Avatar (頭像)
avatar:
img: /img/avatar.png
effect: false 回旋钻
静止彩带
# canvas_ribbon (靜止彩帶背景)
# See: https://github.com/hustcc/ribbon.js
canvas_ribbon:
enable: true
size: 150
alpha: 0.6
zIndex: -1
click_to_change: true
mobile: true
推送问题
$ hexo d
INFO Validating config
ERROR Deployer not found: git
这是因为没安装hexo-deployer-git插件,在站点目录下输入下面的插件安装就好了:
npm install hexo-deployer-git --save
Hexo常见操作
1、使用命令添加页面,例如:使用:hexo new page "about" 新建一个 关于我 页面
2、添加含有标签、分类的文章:
title: 标签标题
tags:
- tag1 (这个就是文章的标签)
- tag2 (这个就是文章的标签)
categories: Javscript (这个就是文章的分类)
链接错无
fatal: unable to access 'https://github.com/xpssssss/xpssssss.github.io.git/': Recv failure: Connection was reset
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed ##生成失败
at ChildProcess.<anonymous> (D:\myblog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:513:28)
at cp.emit (D:\myblog\node_modules\cross-spawn\lib\enoent.js:34:29)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
问题大多是因为git进行push或者hexo d的时候改变了一些.deploy_git文件下的内容。
1.删除 .deploy_git 文件夹;
2.输入 git config --global core.autocrlf false
关闭git对文件换行符的修改,如自动把CRLF换成LF等
3.然后,依次执行:
hexo clean
hexo g
hexo d