创建组件主题新建themes/anzhiyu/layout/includes/widget/card_poem.pug,内容如下
123456789101112131415161718#card-poem.card-widget #poem_sentence #poem_info #poem_dynasty #poem_authorscript(src='https://cdn.jsdelivr.net/npm/js-heo@1.0.11/poem/jinrishici.js', charset='utf-8')script(type='text/javascript'). jinrishici.load(function(result) { var sentence = document.querySelector("#poem_sentence") var author = document.que ...
主题安装方式一(Github 推荐):1git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
方式三(npm安装)1npm i hexo-theme-anzhiyu
应用主题打开 Hexo 根目录下的 config.yml, 找到以下配置项,把主题改为anzhiyu1234# Extensions## Plugins: https://hexo.io/plugins/## Themes: https://hexo.io/themes/theme: anzhiyu
安装 pug 和 stylus 渲染插件1npm install hexo-renderer-pug hexo-renderer-stylus --save
本地启动 hexo123hexo clhexo ghexo s
Hexo 本地部署Hexo 是什么?
Hexo 是一个快速、简洁且高效的静态博客框架,它基于 Node.js 运行,可以将我们撰写的 Markdown 文档解析渲染成静态的 HTML 网页。
一、安装 git官网地址:https://git-scm.com1.访问官方网站,下载对应的安装包,进行安装2.安装完成后,鼠标右键可以看到:Git Bash Here, 点击后打开
1git --version # 查看git版本
二、安装Node.js官网地址:https://nodejs.org
访问nodejs官方网站,下载对应的安装包,进行安装安装完成后,配置环境变量,并在终端里面输入:
1node -v # 查看node.js版本
三、安装hexo全局安装
12yarn global add hexo-cli # yarnnpm install -g hexo-cli # npm
局部安装
12yarn add hexo # yarnnpm intall hexo # npm
检查hexo 版本
1hexo -v # 查看hexo版本
1 ...
