Skip to content

Commit

Permalink
chore: tidy up (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexmoe committed Mar 18, 2023
2 parents 98a8b98 + f5a39b8 commit b0f4d37
Show file tree
Hide file tree
Showing 17 changed files with 2,695 additions and 122 deletions.
Empty file removed README_ZH.md
Empty file.
23 changes: 23 additions & 0 deletions layout/_index/list.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<% page.posts.each(function (page) { %>
<div class="nexmoe-post">
<a href="<%- url_for(page.path) %>">
<% if (page.cover){ %>
<div class="nexmoe-post-cover mdui-ripple absolute" style="padding-top: <%- page.coverHeight/page.coverWidth*100 %>%;">
<img src="<%- page.cover %>" alt="<%= page.title %>" loading="lazy">
<h1><%= page.title %></h1>
</div>
<%} else{ %>
<div class="nexmoe-post-cover mdui-ripple">
<img src="<%- theme.background.path %>" alt="<%= page.title %>" loading="lazy">
<h1><%= page.title %></h1>
</div>
<% } %>
</a>
<%- partial('_partial/_post/meta', {page: page}) %>
<article>
<%- page.excerpt %>
</article>
</div>
<% }) %>
3 changes: 3 additions & 0 deletions layout/_layout/single/content.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="nexmoe-primary">
<%- body %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
</a>
<% } %>
</div>
<%- partial('_partial/sidebar') %>
<aside id="nexmoe-sidebar">
<% theme.widgets.forEach(function(widget){ %>
<% if(widget.enable){ %>
<%- partial('_widget/' + widget.name, {options: widget.options}) %>
<% }}) %>
</aside>
<div class="nexmoe-copyright">
&copy; <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %>
<%= __('Powered by') %> <a href="http://hexo.io/" target="_blank">Hexo</a>
Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions layout/_partial/after-footer.ejs

This file was deleted.

55 changes: 55 additions & 0 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<head>
<%
var title = page.title;
if (is_archive()){
title = __('archive');
if (is_month()){
title += '' + page.year + '/' + page.month;
} else if (is_year()){
title += '' + page.year;
}
} else if (is_category()){
title = __('count.categories') + '' + page.category;
} else if (is_tag()){
title = __('count.tags') + '' + page.tag;
}
%>
<title><% if (title){ %><%= title %> - <% } %><%= config.title %></title>
<meta charset="UTF-8">
<meta name="keywords" content="<%= config.keywords %>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">

<link rel="shortcut icon" href="<%= theme.favicon.href %>" type="<%= theme.favicon.type %>" />
<%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %>
<%- css([
'lib/fancybox/fancybox.css',
'lib/mdui_043tiny/mdui.css'
]) %>

<%- css_auto_version('lib/iconfont/iconfont.css') %>
<% if (theme.iconlib) { %>
<link rel="stylesheet" href="<%= theme.iconlib %>">
<% } %>
<%- css_auto_version('css/style') %>

<% if (theme.customStyles) { %>
<% theme.customStyles.forEach(function(custom){ %>
<%- css_auto_version('custom.css') %>
<% }) %>
<% } %>

<%- js([
{ src:'lib/mdui_043tiny/mdui.js' , async: true},
{ src:'lib/fancybox/fancybox.umd.js' , async: true}
]) %>

<%- js_auto_version('js/app') %>

<% if (theme.copyText) { %>
<script>var copyTip = "<%- theme.copyText %>"</script>
<% } %>

<%- theme.slotHead %>
</head>
2 changes: 1 addition & 1 deletion layout/_partial/paginator.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
escape: false
}) %>
</nav>
<% } %>
<% } %>
6 changes: 0 additions & 6 deletions layout/_partial/sidebar.ejs

This file was deleted.

24 changes: 1 addition & 23 deletions layout/index.ejs
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
<section class="nexmoe-posts">
<% page.posts.each(function (page) { %>
<div class="nexmoe-post">
<a href="<%- url_for(page.path) %>">
<% if (page.cover){ %>
<div class="nexmoe-post-cover mdui-ripple absolute" style="padding-top: <%- page.coverHeight/page.coverWidth*100 %>%;">
<img src="<%- page.cover %>" alt="<%= page.title %>" loading="lazy">
<h1><%= page.title %></h1>
</div>
<%} else{ %>
<div class="nexmoe-post-cover mdui-ripple">
<img src="<%- theme.background.path %>" alt="<%= page.title %>" loading="lazy">
<h1><%= page.title %></h1>
</div>
<% } %>
</a>
<%- partial('_partial/_post/meta', {page: page}) %>
<article>
<%- page.excerpt %>
</article>
</div>
<% }) %>
<%- partial('_index/list') %>
</section>
<%- partial('_partial/paginator') %>
58 changes: 9 additions & 49 deletions layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,13 @@

<html <% if (config.language) { %>lang="<%- config.language %>"<% } %>>

<head>
<%
var title = page.title;
if (is_archive()){
title = __('archive');
if (is_month()){
title += '' + page.year + '/' + page.month;
} else if (is_year()){
title += '' + page.year;
}
} else if (is_category()){
title = __('count.categories') + '' + page.category;
} else if (is_tag()){
title = __('count.tags') + '' + page.tag;
}
%>
<title><% if (title){ %><%= title %> - <% } %><%= config.title %></title>
<meta charset="UTF-8">
<meta name="keywords" content="<%= config.keywords %>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
<%- theme.slotHead %>
<link rel="shortcut icon" href="<%= theme.favicon.href %>" type="<%= theme.favicon.type %>" />
<%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %>
<%- css([
'lib/fancybox/fancybox.css',
'lib/mdui_043tiny/mdui.css'
]) %>

<%- css_auto_version('lib/iconfont/iconfont.css') %>
<% if (theme.iconlib) { %>
<link rel="stylesheet" href="<%= theme.iconlib %>">
<% } %>
<%- css_auto_version('css/style') %>

<% if (theme.customStyles) { %>
<% theme.customStyles.forEach(function(custom){ %>
<%- css_auto_version('custom.css') %>
<% }) %>
<% } %>
</head>
<%- partial('_partial/head') %>

<body class="mdui-drawer-body-left">
<div id="nexmoe-background">
<div class="nexmoe-bg" style="background-image: url(<%= theme.background.path %>)"></div>
<div class="nexmoe-bg"
<%- `style="background-image: url(${theme.background.path})"` %>
></div>
<div class="mdui-appbar mdui-shadow-0">
<div class="mdui-toolbar">
<a mdui-drawer="{target: '#drawer', swipe: true}" title="menu" class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon nexmoefont icon-menu"></i></a>
Expand All @@ -58,12 +19,11 @@
</div>
</div>
<div id="nexmoe-header">
<%- partial('_partial/header') %>
<%- partial('_layout/single/header') %>
</div>
<div id="nexmoe-content">
<div class="nexmoe-primary">
<%- body %>
<div class="nexmoe-post-right">
<%- partial('_layout/single/content') %>
<div class="nexmoe-post-right">
<div class="nexmoe-fixed">
<div class="nexmoe-tool">

Expand All @@ -85,10 +45,10 @@
</div>
</div>
</div>
</div>
</div>
<%- partial('_partial/searchbox') %>
<%- partial('_partial/after-footer') %>

<%- theme.slotFooter %>
</body>

</html>
24 changes: 0 additions & 24 deletions layout/plain.ejs

This file was deleted.

3 changes: 1 addition & 2 deletions layout/post.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div class="nexmoe-post">

<article>
<% if (page.cover){ %>
<div class="nexmoe-post-cover absolute" style="padding-top: <%- page.coverHeight/page.coverWidth*100 %>%;">
Expand All @@ -20,7 +19,7 @@
</article>

<% if (!page.reprint){ %>
<%- partial('_partial/copyright') %>
<%- partial('_partial/_post/copyright') %>
<% } %>

<%- partial('_partial/_post/tag') %>
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"homepage": "https://docs.nexmoe.com/",
"devDependencies": {
"cz-conventional-changelog": "3.3.0",
"eslint": "8.15.0"
"eslint": "8.15.0",
"eslint-config-hexo": "^5.0.0",
"eslint-plugin-json": "^3.1.0"
},
"dependencies": {
"hexo-generator-json-content": "^4.2.3"
Expand Down
Loading

0 comments on commit b0f4d37

Please sign in to comment.