ejs

hexo博客yili主题个性化自定义教程(1) ——借鉴中学习,初认yili主题

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-05 18:11:17
这个博客跌跌撞撞也弄了好多天了,由于Next主题不知道什么情况,被我玩坏了。所以换了一个主题。 大名鼎鼎的yilia主题,崇尚简约优雅,以及极致的性能,符合我的性格。以后很长一段时间都用这个主题啦。 接下来来说一下一些yili主题个性化自定义的方法和自己走过的坑。 本教程适用于yilia主题 <!--more--> 前言 由于yilia已经不维护了,坑还挺多的,所以下面这些方法都是我试过了才敢拿出来的。 如果有错误,请原步骤返回检查错误,或者参考官方教程↓ yilia主题github开源地址 本篇收集了全网目前最全的攻略啦,各位凑活着看。 这是一个系列,第一步先借鉴一下别人的代码,哈哈哈哈嗝。 如何正确使用yilia主题 安装 $ git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia 配置 修改hexo根目录下的 _config.yml : theme: yilia 自定义配置 主题配置文件在主目录下的 _config.yml ,请根据自己需要修改使用。 完整配置例子,可以参考 作者的博客 主题配置详细介绍 接下来我来说一下主题配置中的基本配置有哪些可以自定义的地方,详细看下面的备注 部分代码我会用我自己的配置来讲解具体用法 # Header // 这段代码是左侧栏的相关展示内容,后期可以加上分类

Error: Could not find the include file “partials/head”

微笑、不失礼 提交于 2020-04-30 11:11:05
问题 enter image description hereI am trying to run an ejs file and gets error Error: Could not find the include file "partials/head". i have checked most of the articles from stackoverflow and github however not able to resolve it ... Error: Could not find the include file "partials/head" at getIncludePath (C:\Users\Junia\Desktop\node\node_modules\ejs\lib\ejs.js:162:13) enter code here at includeSource (C:\Users\Junia\Desktop\node\node_modules\ejs\lib\ejs.js:306:17) at C:\Users\Junia\Desktop\node

Error: Could not find the include file “partials/head”

元气小坏坏 提交于 2020-04-30 11:10:50
问题 enter image description hereI am trying to run an ejs file and gets error Error: Could not find the include file "partials/head". i have checked most of the articles from stackoverflow and github however not able to resolve it ... Error: Could not find the include file "partials/head" at getIncludePath (C:\Users\Junia\Desktop\node\node_modules\ejs\lib\ejs.js:162:13) enter code here at includeSource (C:\Users\Junia\Desktop\node\node_modules\ejs\lib\ejs.js:306:17) at C:\Users\Junia\Desktop\node

从无到有,用Nodejs+express+mongodb搭建简易登陆系统

旧时模样 提交于 2020-04-28 01:02:23
前端处理server表示很蛋疼,初学Node,虽然感觉异常强大,但是学起来还是有些吃力的,Node是工具,它不是万能的,搭建一个系统还是需要借助其他一些工具,对于我这个没怎么接触server的前端来说,挑战是有的。昨天参考一些资料尝试用Node+express+mongodb搭建一个简易的登陆系统,在此记之。 express是一个灵活的nodejs web应用框架, 提供一系列强大特性帮助你创建各种Web应用。 Mongodb是数据库。 1、安装express,express安装比较简单,直接用npm install -g express-generator,一定要用这个,如果用npm install -g express就会出现express not found的问题。 2、安装mongodb, 在官网下下在程序,然后一步步安装,我是在F盘的/software3下新建一个mongodb的文件夹,安装在该文件夹内。 3、启动mongodb,cmd中命令如下: 如果看到下面的内容,恭喜启动成功。最好建一个cmd文件,每次启动运行该文件即可。 上面遇到一个小的报错: WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0) 2018-12-23T09:21:00.012+0800 I CONTROL [initandlisten] 2018

base64 images not displaying in Outlook when using ejs + emailjs

本小妞迷上赌 提交于 2020-04-21 04:32:57
问题 I'm using a mix of ejs and emailjs to send out emails in my node.js app when various events happen. I'd like to embed a base64 image (a small logo) into the email when it sends, but both Outlook and Gmail (plus Inbox by Google) fail to render the image. I'm using this bit of code to find the mime type of the image and put together the base64 string: MyApp.prototype.ImageToBase64 = function(image) { var mime = require("mime") file = fs.readFileSync(__dirname + "/images/" + image, { encoding:

Express serve static files in nested directory

巧了我就是萌 提交于 2020-04-11 08:21:29
问题 I am not new to working with express and rendering template views but recently I tried a new directory structure which seems to have confused my app instance. It no longer serves my static bootstrap, css and image files anymore and my view looks all messed up now. Here's my directory structure AppName - node_modules folder - src (all code live here) - public (statics) - css/mycss, bootstrapcss - js/ myjs, bootstrapjs - images folder - models - app.js (entry point) The static files seem to be

Express serve static files in nested directory

Deadly 提交于 2020-04-11 08:21:10
问题 I am not new to working with express and rendering template views but recently I tried a new directory structure which seems to have confused my app instance. It no longer serves my static bootstrap, css and image files anymore and my view looks all messed up now. Here's my directory structure AppName - node_modules folder - src (all code live here) - public (statics) - css/mycss, bootstrapcss - js/ myjs, bootstrapjs - images folder - models - app.js (entry point) The static files seem to be

Express.js application bug: form filed values do not persist

喜夏-厌秋 提交于 2020-04-11 02:02:31
问题 I am working on a blogging application (click the link to see the GitHub repo) with Express, EJS and MongoDB. There is an "Add New Post" form of course, with an addPost() method in the controller; exports.addPost = (req, res, next) => { const errors = validationResult(req); const post = new Post(); post.title = req.body.title; post.short_description = req.body.excerpt post.full_text = req.body.body; console.log(post); if (!errors.isEmpty()) { req.flash('danger', errors.array()); req.session

Express.js application bug: Cannot read property 'transfer-encoding' of undefined

房东的猫 提交于 2020-04-07 08:07:38
问题 I am working on a blogging application (click the link to see the GitHub repo) with Express, EJS and MongoDB. I am trying to introduce an add post image feature. Being quite new to Express, I am puzzled about the problem I have ran into. The add post form: <form action="/dashboard/post/add" method="POST" enctype="multipart/form-data" class="mb-0"> <div class="form-group"> <input type="text" class="form-control" name="title" value="<%= typeof form!='undefined' ? form.titleholder : '' %>"

Express.js application bug: Cannot read property 'transfer-encoding' of undefined

人走茶凉 提交于 2020-04-07 08:05:11
问题 I am working on a blogging application (click the link to see the GitHub repo) with Express, EJS and MongoDB. I am trying to introduce an add post image feature. Being quite new to Express, I am puzzled about the problem I have ran into. The add post form: <form action="/dashboard/post/add" method="POST" enctype="multipart/form-data" class="mb-0"> <div class="form-group"> <input type="text" class="form-control" name="title" value="<%= typeof form!='undefined' ? form.titleholder : '' %>"