Skip to content

Commit

Permalink
feat: change
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangone233 committed Nov 22, 2022
1 parent d1ebde6 commit 581db42
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 18 deletions.
4 changes: 3 additions & 1 deletion layout/_partial/comments/gitalk.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

<script type="text/javascript">
$.getScript("<%=theme.blog_path?theme.blog_path.lastIndexOf('/') === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>/js/gitalk.js", function () {
console.log('<%=theme.gitalk.ClientID %>', 'ClientID');
var gitalk = new Gitalk({
clientID: '<%=theme.gitalk.ClientID %>',
clientSecret: '<%=theme.gitalk.ClientSecret %>',
repo: '<%=theme.gitalk.repo %>',
owner: '<%=theme.gitalk.githubID %>',
admin: ['<%=theme.gitalk.adminUser %>'],
id: decodeURI(location.pathname),
// id: decodeURI(location.pathname),
id: location.pathname,
distractionFreeMode: '<%=theme.gitalk.distractionFreeMode %>',
language: '<%=theme.gitalk.language %>',
perPage: parseInt('<%=theme.gitalk.perPage %>',10)
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/copyright.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p class="footer-entry"><% if (theme.miit && theme.miit.on) {%><span class="miit">
<img src="<%=theme.blog_path?theme.blog_path.lastIndexOf("/") === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>/img/gov.png" title="中华人民共和国工业和信息化部">
<img src="<%=theme.blog_path?theme.blog_path.lastIndexOf('/') === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>/img/gov.png" title="中华人民共和国工业和信息化部">
<a href="<%= theme.miit.url || 'http://beian.miit.gov.cn/'%>"><%=theme.miit.info%></a>
</span>
<%}%>
Expand Down
19 changes: 13 additions & 6 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script src="<%=theme.blog_path?theme.blog_path.lastIndexOf("/") === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>/js/jquery.pjax.js?v=<%=theme.version%>" ></script>
<script src="<%=theme.blog_path?theme.blog_path.lastIndexOf('/') === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>/js/jquery.pjax.js?v=<%=theme.version%>" ></script>
<% if (theme.img_resize == 'photoSwipe') {%>
<script src="<%=theme.CDN.photoswipe_js%>"></script>
<script src="<%=theme.CDN.photoswipe_ui_js%>"></script>
<% } %>
<script src="<%=theme.blog_path?theme.blog_path.lastIndexOf("/") === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>/js/script.js?v=<%=theme.version%>" ></script>
<script src="<%=theme.blog_path?theme.blog_path.lastIndexOf('/') === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>/js/script.js?v=<%=theme.version%>" ></script>
<script>
var img_resize = '<%=theme.img_resize %>';
function initArticle() {
Expand Down Expand Up @@ -488,7 +488,7 @@
width: 100%;
height: 100%;
opacity: <%= typeof theme.article_bg_img.opacity === 'undefined' ? 0.1 : theme.article_bg_img.opacity %>;
background: url("<%=theme.blog_path?theme.blog_path.lastIndexOf("/") === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %><%=theme.article_bg_img.src %>");
background: url("<%=theme.blog_path?theme.blog_path.lastIndexOf('/') === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %><%=theme.article_bg_img.src %>");
background-repeat: no-repeat;
background-position: 50% 0;
-ms-background-size: cover;
Expand Down Expand Up @@ -584,8 +584,15 @@
</div>
<div class="mobile-menus">
<% for (var menu in theme.menu.menus) {%>
<% if (theme.menu.menus[menu].on) {%>
<a class="dynamic-menu <%=(theme.menu.menus[menu].type==1 ?'site_url':'')%>" <%if(theme.menu.menus[menu].type==2){%>target="_self" <%}else if(theme.menu.menus[menu].type==3){%>target="_blank"<%}%> href="<%=theme.menu.menus[menu].url%>"><%=menu %></a>
<%}}%>
<% if (theme.menu.menus[menu].on) {%>
<a
class="dynamic-menu <%=(theme.menu.menus[menu].type==1 ? 'site_url' : '')%>"
target="<%if(theme.menu.menus[menu].type==2) {%>self<%} else if (theme.menu.menus[menu].type==3) {%>_blank<%} else {%><%} %>"
href="<%=theme.menu.menus[menu].url%>"
>
<%=menu %>
</a>
<%}%>
<%}%>
</div>
<%}%>
2 changes: 1 addition & 1 deletion layout/_partial/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div style="display: none">
<input class="theme_disqus_on" value="<%=(theme.comment.type=='disqus')%>">
<input class="theme_preload_comment" value="<%=theme.comment.preload_comment%>">
<input class="theme_blog_path" value="<%=theme.blog_path?theme.blog_path.lastIndexOf("/") === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>">
<input class="theme_blog_path" value="<%=theme.blog_path?theme.blog_path.lastIndexOf('/') === theme.blog_path.length-1?theme.blog_path.slice(0, theme.blog_path.length-1):theme.blog_path:'' %>">
<input id="theme_shortcut" value="<%=theme.shortcutKey%>" />
<input id="theme_highlight_on" value="<%=theme.highlight.on%>" />
<input id="theme_code_copy" value="<%=theme.highlight.copy%>" />
Expand Down
33 changes: 33 additions & 0 deletions layout/_partial/music.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div id="musicMouseDrag" style="position:fixed; z-index: 9999; bottom: 0; right: 0;">
<div id="musicDragArea" style="position: absolute; top: 0; left: 0; width: 100%;height: 10px;cursor: move; z-index: 10;"></div>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=340 src="//music.163.com/outchain/player?type=0&id=7680603150&auto=1&height=430"></iframe>
</div>

<!--以下代码是为了支持随时拖动音乐控件的位置,如没有需求,可去掉下面代码-->
<script>
var $DOC = $(document)
$('#musicMouseDrag').on('mousedown', function (e) {
// 阻止文本选中
$DOC.bind("selectstart", function () {
return false;
});
$('#musicDragArea').css('height', '100%');
var $moveTarget = $('#musicMouseDrag');
$moveTarget.css('border', '1px dashed grey')
var div_x = e.pageX - $moveTarget.offset().left;
var div_y = e.pageY - $moveTarget.offset().top;
$DOC.on('mousemove', function (e) {
var targetX = e.pageX - div_x;
var targetY = e.pageY - div_y;
targetX = targetX < 0 ? 0 : (targetX + $moveTarget.outerWidth() >= window.innerWidth) ? window.innerWidth - $moveTarget.outerWidth() : targetX;
targetY = targetY < 0 ? 0 : (targetY + $moveTarget.outerHeight() >= window.innerHeight) ? window.innerHeight - $moveTarget.outerHeight() : targetY;
$moveTarget.css({'left': targetX + 'px', 'top': targetY + 'px', 'bottom': 'inherit', 'right': 'inherit'})
}).on('mouseup', function () {
$DOC.unbind("selectstart");
$DOC.off('mousemove')
$DOC.off('mouseup')
$moveTarget.css('border', 'none')
$('#musicDragArea').css('height', '10px');
})
})
</script>
4 changes: 2 additions & 2 deletions layout/_partial/nav-left.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a href="<%= theme.blog_path ? theme.blog_path.lastIndexOf("/") === theme.blog_path.length - 1 ? theme.blog_path.slice(0, theme.blog_path.length - 1) : theme.blog_path : '' %>/"
<a href="<%= theme.blog_path ? theme.blog_path.lastIndexOf('/') === theme.blog_path.length - 1 ? theme.blog_path.slice(0, theme.blog_path.length - 1) : theme.blog_path : '' %>/"
class="avatar_target">
<img class="avatar"
src="<%= theme.blog_path ? theme.blog_path.lastIndexOf("/") === theme.blog_path.length - 1 ? theme.blog_path.slice(0, theme.blog_path.length - 1) : theme.blog_path : '' %><%= theme.avatar %>"/>
src="<%= theme.blog_path ? theme.blog_path.lastIndexOf('/') === theme.blog_path.length - 1 ? theme.blog_path.slice(0, theme.blog_path.length - 1) : theme.blog_path : '' %><%= theme.avatar %>"/>
</a>
<div class="author">
<span><%= config.author %></span>
Expand Down
6 changes: 6 additions & 0 deletions layout/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@
<% } %>
</body>
<%- partial('_partial/footer') %>

<% if (theme.music.enable) { %>
<%- fragment_cache('music', function(){
return partial('_partial/music');
}) %>
<% } %>
</html>
13 changes: 6 additions & 7 deletions layout/indexs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@

通过博客,我们可以记录自己的生活和成长的轨迹。它不像 Twitter 那样碎片化,也不像 Facebook 那样关系化,它是私人的空间。

## 关于叶落阁
**叶落阁** 是阁主(杨玉杰)的个人站。
## 关于本站

到目前为止已经写了<code class="article_number"></code>篇文章, 共<code class="site_word_count"></code>字。

本站访问人数:<code class="site_uv"></code>人次 , 访问量:<code class="site_pv"></code>次

## 博客平台
这个博客通过 [Hexo](https://hexo.io/) 生成,部署在 [GitHub Pages](https://pages.github.com/)主题 [3-hexo](https://github.com/yelog/hexo-theme-3-hexo) 已经在github上开源

`3-hexo` 主题使用交流可以加 Q群: <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=e8cf083cc097141eaf323396f1766809b8e90ff00c67bb441898f672892f6904"><img data-ignore border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="3-hexo使用交流" title="3-hexo使用交流"></a>
<!-- ## 博客平台 -->
<!-- 这个博客通过 [Hexo](https://hexo.io/) 生成,部署在 [GitHub Pages](https://pages.github.com/)主题 [3-hexo](https://github.com/yelog/hexo-theme-3-hexo) 已经在github上开源
`3-hexo` 主题使用交流可以加 Q群: <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=e8cf083cc097141eaf323396f1766809b8e90ff00c67bb441898f672892f6904"><img data-ignore border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="3-hexo使用交流" title="3-hexo使用交流"></a> -->
<!--
主要功能:
- 搜索支持文章标题、标签(#标签)、作者(@作者)
- pad/手机等移动端适配
- 页面全局快捷键 <a href='http://yelog.org/2017/03/24/3-hexo-shortcuts/'>3-hexo快捷键说明</a>
- 页面全局快捷键 <a href='http://yelog.org/2017/03/24/3-hexo-shortcuts/'>3-hexo快捷键说明</a> -->
1 change: 1 addition & 0 deletions source/css/_partial/nav-left.styl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
color white
.more-menus
display: none
padding: 0 6px
.icon
text-align center
margin 0 auto 5px
Expand Down

0 comments on commit 581db42

Please sign in to comment.