hexo主题集成pug
发表于|更新于
|浏览量:
你问人问题,她若答非所问,便已是答了,无需再问。——木心
文档:https://hexo.io/zh-cn/docs/themes
先创建hexo项目
1 | hexo init simple-hexo |
然后到themes新建一个主题文件夹
1 | cd .\simple-hexo\themes\ |
修改外部_config.yml的theme
1 | theme: simple-theme |

外部执行一下hexo s启动项目试试

打开localhost:4000

因为我们什么都没写,所以是白屏
新建一个layout目录,下面放一个index.pug

1 | .container Hello World |
发现我们的pug代码并未渲染

这是因为我们没有安装pug插件导致的
到主目录执行
1 | cnpm i hexo-renderer-pug |

pug元素成功渲染

好了,接下来你可以编写你自己的主题啦!
相关推荐
2022-01-02
图片懒加载
如果你只读每个人都在读的书,你也只能想到每个人都能想到的事。——村上春树 首先贴代码: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> .ruben { width: 400px; height: 300px; background-color: #e8e8e8 } .ruben img { width: 100%; height: 100%; } </style> <...
2020-09-07
常用正则
我发现,一个人在放弃给别人留好印象的负担之后,原来心里会如此踏实。——严歌苓 分享一点常用正则 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185...
2023-10-03
threejs+vite+ts实现官网基础部分
一个温柔的目光,一句由衷的话语,能使人忍受生活给他的许多磨难。——高尔基 官方文档:three.js manual 源代码从这里改进: GitHub - PacktPublishing/Learn-Three.js-Fourth-edition: Learn Three.js, Fourth edition, published by Packt 我本地进行了一些修改,首先package.json 12345678910111213141516171819{ "name": "three-ts", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "tsc &...
2024-09-19
Jest集成github action
仅是天才不能成为作家,因为书的背后极需要作家的人格。——爱默生 Jest是一款优雅、简洁的JavaScript测试框架。 官方文档: https://jestjs.io/zh-Hans/ github: https://github.com/jestjs/jest 创建项目: 12345678910111213Last login: Wed Sep 18 16:56:31 on ttys001The default interactive shell is now zsh.To update your account to use zsh, please run `chsh -s /bin/zsh`.For more details, please visit https://support.apple.com/kb/HT208050.Github-Id-VampireAchao:streampark achao$ cd ~/IdeaProjects/simple-jest/Github-Id-VampireAchao:simple-jest achao$ npm inst...
2021-08-24
页面滚动事件
有些路是非要单独一人去跋涉,路再远再长,也得独自默默走下去。——席慕蓉 HTML DOM事件大全:https://www.runoob.com/jsref/dom-obj-event.html 可以如下写法: 12345window.onscroll = function() { console.log("滚动上下距离" + document.documentElement.scrollTop || document.body.scrollTop); console.log("滚动左右距离" + document.documentElement.scrollLeft || document.body.scrollLeft);}// jquery $(window).scroll(()=>{}) uniapp页面生命周期文档:https://uniapp.dcloud.io/collocation/frame/lifecycle?id=%e9%a1%b5%e9%9d%a2%e7%94%9f%...
2024-10-29
typescript-exercises(三)
青年人的教育是国家的基石。——富兰克林 题面: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970/*Intro: Since we already have some of the additional information about our users, it's a good idea to output it in a nice way.Exercise: Fix type errors in logPerson function. logPerson function should accept both User and Admin and should output relevant information according to the input: occupation for User an...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog