Hexo 安装 Next 主题-Hexo建站(四)

安装条件

生产环境(Linux服务器):

  • hexo

未安装 hexo 的同学可以参考前两节的内容. 将 hexo 部署起来

安装步骤

注意: 以下工作空间根目录为 Linux 服务器 hexo 安装路径根目录

下载 Next 主题

这里我选择的是最后一次发布的主线版本.
Next版本选择

cd <your_hexo_path>
mkdir themes/next
curl -L https://api.github.com/repos/theme-next/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1

更多版本选择请前往 Next 的 部署文档

配置 Next

修改 hexo 根目录下配置文件 _config.yml.
在配置文件中找到关键字 theme, 并将主题设置为 next (注意这里的next 为 theme/next 的文件夹名)

# 将原始主题注释掉, 万一想换回来呢
# theme: landscape 
theme: next

重启验证:

docker-compose restart hexo

Hexo_Next皮肤重启校验

安装图片插件

如果像使用 markdown 一样方便的引用图片, 那么就要安装如下插件. 引用官方文档上的话

hexo-renderer-marked 3.1.0 introduced a new option that allows you to embed an image in markdown without using asset_img tag plugin.

_config.yml
post_asset_folder: true
marked:
  prependRoot: true
  postAsset: true
Once enabled, an asset image will be automatically resolved to its corresponding post’s path. For example, “image.jpg” is located at “/2020/01/02/foo/image.jpg”, meaning it is an asset image of “/2020/01/02/foo/“ post, !\[](image) will be rendered as <img src="/2020/01/02/foo/image.jpg">.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值