hexo的next主题换到Yelee(Yilia)
原有的主题是已经配过valine的 配置valine,
需要注意下面的配置
本主题基于主题 Hexo-Theme-Yilia 修改而来,在此再次感谢原作者 Litten。修复了一些 bugs,改变了大量的样式,添加了不少特性。对原主题百般折腾后,发觉变动越来越大,
索性就发布个新主题了,主题随我微博名 “夜Yelee” 。个人喜欢简洁的样式,重视内容的浏览,
同时希望作为个人网站的博客,能稍微凸显出博主个性。各种修改折腾大抵基于以上考虑。
layout/_partial/post/nav.ejs
<% if (theme.valine && theme.valine.appid && theme.valine.appkey){ %>
<p id="comments" class="comments" style="margin:30px;padding:15px;background:#fff} "><style>@media screen and (max-width:800px) {.comments {margin: auto;padding: 10px;background: #fff}}</style><%- partial('../comments/valine', {key: post.slug,title: post.title,url: config.url+url_for(post.path)}) %>
</p>
<% } %>
layout/_partial/comments/valine.ejs
<div id="vcomment" class="comment"></div>
<!--载入js,在 body之前插入即可-->
<!--Leancloud 操作库:-->
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<!--Valine 的核心代码库-->
<script src='//cdn.jsdelivr.net/npm/valine/dist/Valine.min.js'></script>
<script>var notify = '<%= theme.valine.notify %>' == true ? true : false;var verify = '<%= theme.valine.verify %>' == true ? true : false;new Valine({// AV 对象来自上面引入av-min.js(老司机们不要开车➳♡゛扎心了老铁)av: AV,el: '#vcomment',emoticon_url: 'https://cloud.panjunwen.com/alu',emoticon_list: ["狂汗.png", "不说话.png", "汗.png", "坐等.png", "献花.png", "不高兴.png", "中刀.png", "害羞.png","皱眉.png", "小眼睛.png", "暗地观察.png"],app_id: '<%= theme.valine.appid %>',app_key: '<%= theme.valine.appkey %>',placeholder: '<%= theme.valine.placeholder %>'});if (window.location.hash) {var checkExist = setInterval(function () {if (document.getElementById(window.location.hash.replace("#", ""))) {location.href = window.location.hash;clearInterval(checkExist);}}, 250);}
</script>
起初参考MonoLogueChi博客,不知道什么原因:( 在主页的界面的每个标题下面都有一个留言的窗口
于是我将加到 ARTICLE.EJS
换了地方 themes/hexo-theme-yelee/layout/_partial/post/nav.ejs
,注意换了路径需要将
<%- partial(‘../comments/valine’, {
key: post.slug,
title: post.title,
url: config.url+url_for(post.path)
}) %>
中的../POST/valine
相对地址也跟着换掉
自动生成摘要
官方推荐的文章摘要格式
方法一:
<!-- more -->
> title: Hello World> date: 2015-12-03 00:00:00> ---> <Excerpt in index | 首页摘要>> <!-- more -->> <The rest of contents | 余下全文>>
<!-- more -->
之前最好不要有空格等字符;方法二:
description
in Front-matter> title: Hello World> date: 2015-12-03 00:00:00> +description: "Welcome to Hexo! This is your very first post."> ---> <Contents>>
通过
description
添加的摘要只能为纯文本;
但是很复杂每次写的时候都要添加对于标签重复劳动,对于之前的文章都要这样去设置很机械,后面发现了
有 hexo-auto-excerpt
可以使用
npm install –save hexo-auto-excerpt
将
layout/_partial/article.ejs
,在div.article-entry
中的代码换成下面的<% if (index){ %><% if (post.excerpt) { %><%- post.excerpt %><% } else if (theme.auto_excerpt.enable) { %><% var br_position = 0 %><% for (var br_count = 0; br_count < theme.auto_excerpt.lines; br_count++) { %><% br_position = post.content.indexOf('\n',br_position + 1) %><% if(br_position < 0) { break } %><% } %><% if(br_position > 0) { %><% show_all_content = false %><p><%- post.content.substring(0, br_position + 1) %><p><% } %><% } %><% } else { %><%- partial('toc', { post: post}) %><%- post.content %><% } %></div>
_config.yml 添加下面代码
auto_excerpt:enable: truelines: 3
hexo博文摘要生成方案
Yelee(Yilia)打赏和调节版本署名的样式
yelee没有打赏功能目前需要自己实现目前需要修改
_config.yml
#打赏 donate:enable: true #设定打赏功能是否可用reward_wording: 加个鸡腿wechat: /pics/weixin.png #微信二维码图片的路径alipay: /pics/alipay.jpg #支付宝二维码图片的路径 # 打赏 # 打赏type设定:0-关闭打赏; 1-文章对应的md文件里有reward:true属性,才有打赏; 2-所有文章均有打赏 reward_type: 2 # 打赏wording reward_wording: '加个鸡腿' # 支付宝二维码图片地址,跟你设置头像的方式一样。比如:/assets/img/alipay.jpg alipay: /pics/weixin.png # 微信二维码图片地址 weixin: /pics/alipay.jpg # rss配置 feed:type: atompath: atom.xmllimit: 20hub:content:content_limit: 140content_limit_delim: ' 'order_by: -dateicon: icon.png
layout/_partial/post/nav.ejs
<% if (((theme.reward_type === 2 && !post.reward) || (theme.reward_type === 1 && post.reward)) && !index){ %> <link rel="stylesheet" type="text/css" href="/share/reward.css" /> <div class="page-reward"><a href="javascript:;" class="page-reward-btn tooltip-top"><div class="tooltip tooltip-east"><span class="tooltip-item">赏</span><span class="tooltip-content"><span class="tooltip-text"><span class="tooltip-inner"><p class="reward-p"><i class="icon icon-quo-left"></i><%= theme.reward_wording%><iclass="icon icon-quo-right"></i></p><div class="reward-box"><% if(theme.alipay) {%><div class="reward-box-item"><img class="reward-img" src="<%= theme.alipay%>"><span class="reward-type">支付宝</span></div><% } %><% if(theme.weixin) {%><div class="reward-box-item"><img class="reward-img" src="<%= theme.weixin%>"><span class="reward-type">微信</span></div><% } %></div></span></span></span></div></a> </div> <% } %>
最后是在source下的share文件夹下保存css文件 地址../share/reward.css
修改版本署名的样式 /themes/hexo-theme-yelee/layout/_partial/post/nav.ejs
<div class="is_copyright">
<ui class=post-copyright><li><strong><%= __('copyright_info.title') %>:</strong><a href="<%- url_for(post.path) %>"><%= post.title %></a></li><li><strong><%= __('copyright_info.author') %>:</strong><a href="/" title="<%= __('tooltip.back2home') %>"><%=theme.author%></a> </li> <li><strong><%= __('copyright_info.date') %>:</strong><%= post.date.format("YYYY-MM-DD, HH:mm:ss") %> </li><li> <strong><%= __('copyright_info.updated') %>:</strong><%= post.updated.format("YYYY-MM-DD, HH:mm:ss") %> </li><li><strong><%= __('copyright_info.url') %>:</strong><a class="post-url" href="<%- url_for(post.path) %>" title="<%= post.title %>"><%= post.permalink %></a> <strong class="copy-path" data-clipboard-text="<%= __('copyright_info.from') %> <%= post.permalink %><%= __('copyright_info.by') %> <%=theme.author%>" title="<%= __('tooltip.copyPath') %>"><i class="fa fa-clipboard"></i></strong> <script> var clipboard = new Clipboard('.copy-path'); </script></li><li> <strong><%= __('copyright_info.license') %>:</strong><i class="fa fa-creative-commons"></i> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" title="CC BY-NC-SA 4.0 International" target = "_blank">"<%= __('copyright_info.cc') %>"</a> <%= __('copyright_info.notice') %> </li></ui>
</div>
代码区前后有很多空行
.article-entry
pre, code font-family: font-mono, monospace, font-chs font-size: 1em
## 后面加这几个
.line:after content: '' display: inline-block;
解决链接
添加统计字数
<% if (post.tags && post.tags.length){ %>-
<div class="article-tag tagcloud"><div class="article-tag tagcloud" style="display: flex; flex-wrap: wrap"><%- list_tags(post.tags, { show_count: false, class: 'article-tag' }) %><span class="post-count">总字数<%= wordcount(post.content) %></span><span class="post-count">预计阅读<%= min2read(post.content) %>分钟</span></div><% } %>
起初参考MonoLogueChi博客,不知道什么原因:( 在主页的界面的每个标题下面都有一个留言的窗口
于是我将加到 ARTICLE.EJS
换了地方 themes/hexo-theme-yelee/layout/_partial/post/nav.ejs
,注意换了路径需要将
<%- partial(‘../comments/valine’, {
key: post.slug,
title: post.title,
url: config.url+url_for(post.path)
}) %>
中的../POST/valine
相对地址也跟着换掉
自动生成摘要
官方推荐的文章摘要格式
方法一:
> title: Hello World> date: 2015-12-03 00:00:00> ---> > > >
之前最好不要有空格等字符;
方法二:
description
in Front-matter> title: Hello World> date: 2015-12-03 00:00:00> +description: "Welcome to Hexo! This is your very first post."> ---> >
通过
description
添加的摘要只能为纯文本;
但是很复杂每次写的时候都要添加对于标签重复劳动,对于之前的文章都要这样去设置很机械,后面发现了
有 hexo-auto-excerpt
可以使用
npm install –save hexo-auto-excerpt
将
layout/_partial/article.ejs
,在div.article-entry
中的代码换成下面的<% if (index){ %><% if (post.excerpt) { %><%- post.excerpt %><% } else if (theme.auto_excerpt.enable) { %><% var br_position = 0 %><% for (var br_count = 0; br_count < theme.auto_excerpt.lines; br_count++) { %><% br_position = post.content.indexOf('\n',br_position + 1) %><% if(br_position < 0) { break } %><% } %><% if(br_position > 0) { %><% show_all_content = false %><%- post.content.substring(0, br_position + 1) %><% } %><% } %><% } else { %><%- partial('toc', { post: post}) %><%- post.content %><% } %>
_config.yml 添加下面代码
auto_excerpt:enable: truelines: 3
hexo博文摘要生成方案
Yelee(Yilia)打赏和调节版本署名的样式
yelee没有打赏功能目前需要自己实现目前需要修改
_config.yml
#打赏 donate:enable: true #设定打赏功能是否可用reward_wording: 加个鸡腿wechat: /pics/weixin.png #微信二维码图片的路径alipay: /pics/alipay.jpg #支付宝二维码图片的路径 # 打赏 # 打赏type设定:0-关闭打赏; 1-文章对应的md文件里有reward:true属性,才有打赏; 2-所有文章均有打赏 reward_type: 2 # 打赏wording reward_wording: '加个鸡腿' # 支付宝二维码图片地址,跟你设置头像的方式一样。比如:/assets/img/alipay.jpg alipay: /pics/weixin.png # 微信二维码图片地址 weixin: /pics/alipay.jpg # rss配置 feed:type: atompath: atom.xmllimit: 20hub:content:content_limit: 140content_limit_delim: ' 'order_by: -dateicon: icon.png
layout/_partial/post/nav.ejs
<% if (((theme.reward_type === 2 && !post.reward) || (theme.reward_type === 1 && post.reward)) && !index){ %>赏<%= theme.reward_wording%><% if(theme.alipay) {%>支付宝<% } %><% if(theme.weixin) {%>微信<% } %><% } %>
最后是在source下的share文件夹下保存css文件 地址../share/reward.css
修改版本署名的样式 /themes/hexo-theme-yelee/layout/_partial/post/nav.ejs
<%= __('copyright_info.title') %>:<%= post.title %><%= __('copyright_info.author') %>:<%=theme.author%> <%= __('copyright_info.date') %>:<%= post.date.format("YYYY-MM-DD, HH:mm:ss") %> <%= __('copyright_info.updated') %>:<%= post.updated.format("YYYY-MM-DD, HH:mm:ss") %> <%= __('copyright_info.url') %>:<%= post.permalink %> <%= __('copyright_info.license') %>: "<%= __('copyright_info.cc') %>" <%= __('copyright_info.notice') %>
代码区前后有很多空行
.article-entry pre, code font-family: font-mono, monospace, font-chs font-size: 1em ## 后面加这几个 .line:after content: '' display: inline-block;
解决链接
添加统计字数
<% if (post.tags && post.tags.length){ %>-<%- list_tags(post.tags, { show_count: false, class: 'article-tag' }) %>总字数<%= wordcount(post.content) %>预计阅读<%= min2read(post.content) %>分钟<% } %>
-->
hexo的next主题换到Yelee(Yilia)相关推荐
- Hexo博客主题安装和优化(一)
当你看到这篇文章的时候,想必你已经搭建好了属于你的Hexo博客并且已经部署到了Github上面,如果还没有的话呢,请移步去Hexo+github搭建博客! 因为默认的Hexo主题实在太难看了,所以我们 ...
- hexo之next主题个性化配置详细教程
hexo之next主题个性化配置详细教程 1.在右上角或者左上角实现fork me on github 实现的效果图 具体实现方法 点击传送门>> 挑选自己喜欢的样式,并复制代码. 例如, ...
- Hexo部署+Sakura主题调教教程
CSDN不定期补充 个人博客内会实时更新推送: https://flymc.cc/2020/03/28/Sakura/ 前言 这个教程的重点在于调教Sakura主题,关于Hexo+GitHub搭建博客 ...
- android view设置按钮颜色_Android 主题换肤技术方案分析
写在前面 Android TV 电视开发,主题换肤,我感觉有两种层级的方式,一种是 系统级,另一种 是应用级, 我记得很早在 Linux 桌面开发的时候,我们之前的公司在GTK+上也实现了一套换肤UI ...
- Android主题换肤实现
本系列文章主要是对一个Material Design的APP的深度解析,主要包括以下内容 基于Material Design Support Library作为项目整体框架.对应博文:Android ...
- Hexo中next主题的个性化配置
next主题常用配置 一.主题常用配置 1. 更换主题(Scheme Setting) 2. 菜单设置(Menu Settings) 3. 侧边栏设置(Sidebar Settings) 4. 侧边栏 ...
- hexo之next主题添加分类
hexo之next主题添加分类 @(Hexo+Github) 当前博客主题用的是next最新版,最初是比较简陋的界面,一直放着没怎么动,测试了下Latex的显示效果没有达到在CSDN我的博客上的效果, ...
- hexo下next主题的优化
1.站点信息的配置. 修改一些基本的配置,比如站点名.站点描述等等. # Site title: halisi7 subtitle: '一个专注技术的组织' description: '涉猎的主要编程 ...
- 【Hexo】NexT 主题的配置使用记录
文章目录 简介 版本 安装 配置记录 风格/主题 网页图标 菜单栏 侧边栏 本地搜索 代码块 动画效果 阅读进度 书签 Mermaid lazyload fancybox pangu 捐赠 版权声明 ...
最新文章
- 百度Apollo 3.5是如何设计Cyber RT计算框架的?
- 美国物理超级计算机,美国科学家在物理学的一个分支领域朝着开发超级计算机迈进了一步。这一分支领域研究的是人眼看不见的粒子。...
- 使用asp.net MVC4中的Bundle遇到的问题及解决办法
- html求和按钮,使用模板标记在html模板中求和
- python键盘输入代码,python监控键盘输入实例代码
- cisco IOS及配置的备份及升级
- ios字典存bool_#iOS 打印中文字典,数组,控制台输出中文,并保持缩进格式
- WKViewManager iOS 弹窗架构
- 密钥文件登录服务器,密钥文件登录云服务器
- 六零后的人马上步入老年生活,没有退休金,如何养老?
- html中怎么不让网页缩放_网页中的形状图形都是怎么画出来的?
- mysql递归查询所有子级,完整PDF
- java nativearray_Java中的native关键字与JNI
- PHP无限极分类巧用引用生成树
- 419.甲板上的战舰
- Qt编写输入法终极版V2018
- XShell「6.0.0111」已激活授权绿色版v2
- 现在学 Prolog 递归
- tftpd32服务器软件在Windows与linux 下的文件传输
- 慢性肾炎的中医药调理【转】
热门文章
- Flash Builder 4.6.1的安装与破解
- 工具使用 - IDA使用
- kubernetes--RBAC权限管理
- C++ GUI Programming with Qt4 Second Edition 之 附录A.3 Mac系统Qt的安装
- 宠物食品“味及”完成数百万天使轮+融资
- 采样频率和带宽的关系_ADC为什么需要采样保持器(SHA)?
- 2018谷歌开发者节深圳站,Testin云测的AI应用案例获广泛关注
- 名帖291 董其昌 行书《乐志论》
- 樱花飘落,3D效果,抖音热门樱花飘落html
- 有一种蓝叫 APEC 蓝