Skip to content

Commit

Permalink
Version1.0.6添加fancybox插件等...
Browse files Browse the repository at this point in the history
  • Loading branch information
Lete114 committed Jan 8, 2021
1 parent 9d77da7 commit ddc91b5
Show file tree
Hide file tree
Showing 20 changed files with 460 additions and 135 deletions.
61 changes: 61 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

- 2021-1-8
添加fancybox插件
添加友情链接页面
调整配置


- 2021-1-7
修复up酱在手机端文章页面显示错位的问题
添加部分动画效果
修复分类页不显示括号的问题的‘()’

- 2021-1-5
添加twikoo评论系统
修复页面刷新后toc进度条清0的问题
添加本地搜索(search插件)
主题css、js资源url可自定义
自定义引入外部js、css、等资源
添加首页显示文章数
修复当手机端打开导航栏菜单是屏幕大小有变化后,无法上下滚动浏览内容
添加404页面
调整部分字体在手机端显示过大的bug

- 2021-1-4
添加valine评论系统
添加waline评论系统
调整手机端页面样式
添加手机端toc目录
添加开/关首页是否显示cover图片
添加文章页是否显示up酱
添加主题配色
配置文件添加CDN选项
添加右侧选项、回到顶部、直达评论、手机端展开toc按钮
调整up酱显示逻辑
页面统计采用valine、waline自带的功能(待适配twikoo后也是如此)


- 2021-1-3
添加up酱(回到顶部)
添加开/关toc滚动条
添加css压缩

- 2021-1-2
调整css,从纯css调整到stylue预处理
添加toc目录,优化a标签锚点滚动
调整toc长度超出内容区(显示滚动条)
toc目录进行宽度调整
更新标签页、分类页、归档页
标签页、分类页、归档页添加分页
更新首页cover,不适应可以不写
调整分页在手机端不对其的情况
调整部分样式

- 2021-1-1
修复手机端代码块行号于代码不匹配bug
调整手机端版权框显示问题
调整手机端文章底部tag和social-share显示bug
修复文章无tag时,文章底部显示icon图标的bug

- 2020-12-31
首发第一个版本1.0.0
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

把注意力集中到内容上

口号:禁止花里胡哨
Docs: [MengD(萌典)](https://mengd.lete114.top/)

部分样式模仿自[hexo-theme-butterfly](https://github.com/jerryc127/hexo-theme-butterfly)非常感谢

Expand All @@ -18,12 +18,12 @@

稳定[推荐]
``` powershell
git clone -b dev https://github.com/lete114/hexo-theme-MengD.git themes/MengD
git clone -b master https://github.com/lete114/hexo-theme-MengD.git themes/MengD
```

开发
``` powershell
git clone -b master https://github.com/lete114/hexo-theme-MengD.git themes/MengD
git clone -b dev https://github.com/lete114/hexo-theme-MengD.git themes/MengD
```

打开根目录下的`_config.yml`修改`theme: MengD`
Expand All @@ -32,12 +32,14 @@ git clone -b master https://github.com/lete114/hexo-theme-MengD.git themes/MengD

``` yml


# 导航栏菜单
menu:
首页: /
标签: /tags
分类: /categories
归档: /archives
友情链接: /link
关于我: /about

# 基本设置(会覆盖hexo的配置)
Expand All @@ -49,7 +51,7 @@ avatar: https://www.lete114.top/img/avatar.png
language: zh-CN
keywords:
description: 人生只有一次,大胆的生活!!
upjiang: true # 文章页面是否显示up酱(回到顶部)
upjiang: false # 文章页面是否显示up酱(回到顶部)
cover: true # 是否开启主页文章cover(首图)
# 是否开启版权(文章内可以设置copytight: false 属性单独关闭某个文章的版权)
copytight: true
Expand Down Expand Up @@ -97,10 +99,10 @@ comment: waline # twikoo / waline / valine
# valine
## https://valine.js.org/
valine:
appid: qvkfTxFxxxxxxxxxxxxxxxxxxxXbMMI # 你的 leancloud app id
appkey: WOUxxxxxxxxxxxxxxxxrog # 你的 leancloud app key
master: 2axxxxxxxxxxxxxxxxxx2e2 # (原版valine不支持)你的邮箱md5加密(百度搜索md5在线加密)
friends: ed5xxxxxxxxxxxxxxxxxxxxxxxx893b,d24xxxxxxxxxxxxxxxxx457 # (原版valine不支持)你的小伙伴的md5邮箱加密
appid: qvkfxxxxxxxxxxxxxxxxxxxxxbMMI # 你的 leancloud app id
appkey: WOURxxxxxxxxxxxxxxxxxWJrog # 你的 leancloud app key
master: 2a776xxxxxxxxxxxxxxxxxd7f4442e2 # (原版valine不支持)你的邮箱md5加密(百度搜索md5在线加密)
friends: ed5bb69dfxxxxxxxxxxxxxxe6893b,d24719e3bxxxxxxxxxxxxxxbac991457 # (原版valine不支持)你的小伙伴的md5邮箱加密
placeholder: 快来评论吧!! #评论框占位符
avatar: '' # gravatar style https://valine.js.org/#/avatar
meta: ['nick','mail','link'] # 评论者相关属性
Expand All @@ -114,7 +116,7 @@ valine:
# waline
## https://waline.js.org
waline:
serverURL: https://waline.vercel.app/ # 服务端地址
serverURL: https://waline.lete114.top/ # 服务端地址
placeholder: 快来评论吧!! #评论框占位符
avatar: '' # gravatar style https://valine.js.org/#/avatar
meta: ['nick','mail','link'] # 评论者相关属性
Expand All @@ -128,7 +130,7 @@ waline:
# twikoo
## https://twikoo.js.org/
twikoo:
envId: env-jxxxxxxxg # 你的环境id
envId: exxxxxxxxxxxxg # 你的环境id
region: ap-shanghai # 环境地域,ap-shanghai / ap-guangzhou
path: window.location.pathname # 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数
option:
Expand All @@ -151,9 +153,9 @@ analytics:

# 自定义引入外部css、js
import:
style:
head:
-
script:
botton:
-
# 例如:
# - <link rel="stylesheet" href="/css/index.css">
Expand All @@ -168,14 +170,22 @@ CDN:
index_js: /js/main.js
article_css: /css/article.css
search: /js/search.js
# 图片展示
fancybox_css: https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
fancybox_js: https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js
# 分享
share_css: https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css
share_js: https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js
# 评论
valine: https://cdn.jsdelivr.net/gh/lete114/CDN2/js/Valine-Lete3.2.js ## 原版: //unpkg.com/valine/dist/Valine.min.js
waline: //cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js
twikoo: https://cdn.jsdelivr.net/npm/twikoo@0.5.1/dist/twikoo.all.min.js


```


## 更新日志

```
[更新日志](https://mengd.lete114.top/article/ChangeLog.html)

31 changes: 22 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#--------------------------------------------------------
# Hexo-MengD(萌典)
# 项目地址:https://github.com/lete114/hexo-theme-MengD
# 主题文档:https://mengd.lete114.top/
# 一个崇尚简约优雅,以及极致的性能,把注意力集中到内容上
#--------------------------------------------------------


# 导航栏菜单
menu:
首页: /
标签: /tags
分类: /categories
归档: /archives
友情链接: /link
关于我: /about

# 基本设置(会覆盖hexo的配置)
Expand All @@ -16,7 +24,7 @@ avatar: https://www.lete114.top/img/avatar.png
language: zh-CN
keywords:
description: 人生只有一次,大胆的生活!!
upjiang: true # 文章页面是否显示up酱(回到顶部)
upjiang: false # 文章页面是否显示up酱(回到顶部)
cover: true # 是否开启主页文章cover(首图)
# 是否开启版权(文章内可以设置copytight: false 属性单独关闭某个文章的版权)
copytight: true
Expand Down Expand Up @@ -64,10 +72,10 @@ comment: waline # twikoo / waline / valine
# valine
## https://valine.js.org/
valine:
appid: qvkfTxFxKl55ExACiF4lscUn-MdYXbMMI # 你的 leancloud app id
appkey: WOURILcYqtYS5PmtwTyWJrog # 你的 leancloud app key
master: 2a7765642415437fa16a54cd7f4442e2 # (原版valine不支持)你的邮箱md5加密(百度搜索md5在线加密)
friends: ed5bb69dfcfe547babab7c3aaee6893b,d24719e3b7a66cbde951909bac991457 # (原版valine不支持)你的小伙伴的md5邮箱加密
appid: qvkfxxxxxxxxxxxxxxxxxxxxxbMMI # 你的 leancloud app id
appkey: WOURxxxxxxxxxxxxxxxxxWJrog # 你的 leancloud app key
master: 2a776xxxxxxxxxxxxxxxxxd7f4442e2 # (原版valine不支持)你的邮箱md5加密(百度搜索md5在线加密)
friends: ed5bb69dfxxxxxxxxxxxxxxe6893b,d24719e3bxxxxxxxxxxxxxxbac991457 # (原版valine不支持)你的小伙伴的md5邮箱加密
placeholder: 快来评论吧!! #评论框占位符
avatar: '' # gravatar style https://valine.js.org/#/avatar
meta: ['nick','mail','link'] # 评论者相关属性
Expand All @@ -81,7 +89,7 @@ valine:
# waline
## https://waline.js.org
waline:
serverURL: https://waline.vercel.app/ # 服务端地址
serverURL: https://waline.lete114.top/ # 服务端地址
placeholder: 快来评论吧!! #评论框占位符
avatar: '' # gravatar style https://valine.js.org/#/avatar
meta: ['nick','mail','link'] # 评论者相关属性
Expand All @@ -95,7 +103,7 @@ waline:
# twikoo
## https://twikoo.js.org/
twikoo:
envId: env-jxscvzag # 你的环境id
envId: exxxxxxxxxxxxg # 你的环境id
region: ap-shanghai # 环境地域,ap-shanghai / ap-guangzhou
path: window.location.pathname # 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数
option:
Expand All @@ -118,9 +126,9 @@ analytics:

# 自定义引入外部css、js
import:
style:
head:
-
script:
botton:
-
# 例如:
# - <link rel="stylesheet" href="/css/index.css">
Expand All @@ -135,8 +143,13 @@ CDN:
index_js: /js/main.js
article_css: /css/article.css
search: /js/search.js
# 图片展示
fancybox_css: https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
fancybox_js: https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js
# 分享
share_css: https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css
share_js: https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js
# 评论
valine: https://cdn.jsdelivr.net/gh/lete114/CDN2/js/Valine-Lete3.2.js ## 原版: //unpkg.com/valine/dist/Valine.min.js
waline: //cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js
twikoo: https://cdn.jsdelivr.net/npm/twikoo@0.5.1/dist/twikoo.all.min.js
Expand Down
59 changes: 58 additions & 1 deletion layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
<%if(page.type==null || page.layout==null){%>
<article class="post">
<link rel="stylesheet" href="<%-theme.CDN.article_css%>">
<link rel="stylesheet" href="<%-theme.CDN.fancybox_css%>" />
<script src="<%-theme.CDN.fancybox_js%>"></script>
<div class="post-title">
<h2 class="title"><%= page.title %></h2>
</div>
Expand Down Expand Up @@ -132,11 +134,33 @@
</div>
`;
<%if(theme.upjiang==false){%>
<%if(theme.upjiang){%>
setInterval(function(){
$('img#up').remove();
},0)
<%}%>
setInterval(function(){
if(document.body.clientWidth < 800){
$('img#up').remove();
}
},0)
$(".post-content img").each(function () {
// $(this).attr("data-fancybox", "gallery"); //直接给img添加data-fancybox会导致点击图片后图片消失
var element = document.createElement("a");
$(element).attr("data-fancybox", "images");
$(element).attr("href", $(this).attr("src"));
$(this).wrap(element);
});
$().fancybox({
selector: '[data-fancybox="images"]',
loop: true,
transitionEffect: 'slide',
protect: true,
buttons: ['slideShow', 'fullScreen', 'thumbs', 'close'],
hash: false
});
$("#body-wrap").after('<div id="toc">'+tocTitle+'<%- toc(page.content,{list_number: false}) %></div>');
</script>
Expand Down Expand Up @@ -208,6 +232,39 @@
</div>
<%- partial('archive') %>
<%}else if(page.type=="links" || page.layout=="links"){%>
<div id="page-title" class="page-title">
<h2><%= page.title %></h2>
</div>
<%- partial('link') %>
<%- page.content %>
<%if(theme.comment!=null){%>
<%if(post.comment==null || post.comment){%>
<hr>
<section id="rightside">
<div id="rightside-item">
<a href="#直达评论" title="直达评论">
<i class="fas fa-comments"></i>
</a>
</div>
</section>
<div class="comment-head" id="直达评论">
<div class="comment-headline">
<i class="fas fa-comments fa-fw"></i>
<span> 评论</span>
</div>
<%if(theme.comment=="valine"){%>
<%- partial('comment/valine') %>
<%}else if(theme.comment=="waline"){%>
<%- partial('comment/waline') %>
<%}else if(theme.comment=="twikoo"){%>
<%- partial('comment/twikoo') %>
<%}%>
</div>
<%}%>
<%}%>
<%}else if(page.type!=null || page.layout!=null){%>
<div id="page-title" class="page-title">
<h2><%= page.title %></h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script src="<%-theme.CDN.index_js%>"></script>
<% theme.import.script.forEach(function(script, i){ %>
<% theme.import.botton.forEach(function(script, i){ %>
<%-script%>
<% }) %>
3 changes: 3 additions & 0 deletions layout/_partial/import_head.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% theme.import.head.forEach(function(style, i){ %>
<%-style%>
<% }) %>
3 changes: 0 additions & 3 deletions layout/_partial/styles.ejs

This file was deleted.

4 changes: 2 additions & 2 deletions layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<%- partial('_partial/head') %>
<%- partial('_partial/styles') %>
<%- partial('_partial/import_head') %>
</head>
<body id="body">
<div id="mask"></div>
Expand All @@ -20,6 +20,6 @@
<img id="up" src="https://cdn.jsdelivr.net/gh/lete114/CDN/Use/up.gif" alt="回到顶部">

<%- partial('_partial/footer') %>
<%- partial('_partial/scripts') %>
<%- partial('_partial/import_botton') %>
</body>
</html>
Loading

0 comments on commit ddc91b5

Please sign in to comment.