Add Tsu theme
This commit is contained in:
5
themes/hexo-theme-Tsu/layout/_partials/footer.ejs
Normal file
5
themes/hexo-theme-Tsu/layout/_partials/footer.ejs
Normal file
@@ -0,0 +1,5 @@
|
||||
<div class="copyright">
|
||||
<div class="text">Powered By
|
||||
<a href="https://hexo.io/">Hexo</a> | Theme <a href="https://github.com/zjx137/hexo-theme-Tsu">Tsu</a> © 2019
|
||||
</div>
|
||||
</div>
|
21
themes/hexo-theme-Tsu/layout/_partials/head.ejs
Normal file
21
themes/hexo-theme-Tsu/layout/_partials/head.ejs
Normal file
@@ -0,0 +1,21 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
|
||||
<%
|
||||
var title = page.title;
|
||||
if (is_archive()){
|
||||
title = 'Archives';
|
||||
if (is_month()){
|
||||
title += ': ' + page.year + '/' + page.month;
|
||||
} else if (is_year()){
|
||||
title += ': ' + page.year;
|
||||
}
|
||||
} else if (is_category()){
|
||||
title = 'Category: ' + page.category;
|
||||
} else if (is_tag()){
|
||||
title = 'Tag: ' + page.tag;
|
||||
}
|
||||
%>
|
||||
<title><% if (title){ %><%= title %> | <% } %><%= config.title %></title>
|
||||
|
||||
<%- css('styles/main') %>
|
16
themes/hexo-theme-Tsu/layout/_partials/header.ejs
Normal file
16
themes/hexo-theme-Tsu/layout/_partials/header.ejs
Normal file
@@ -0,0 +1,16 @@
|
||||
<header>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<a href="#" class="logo"><%= config.title %></a>
|
||||
</div>
|
||||
<div class="site-nav">
|
||||
<ul id="menu" class="menu">
|
||||
<% for (name in theme.menu) { %>
|
||||
<li class="menu-item text-underline">
|
||||
<a href="<%- url_for(theme.menu[name]) %>"><%- __('Menu.' + name) %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
36
themes/hexo-theme-Tsu/layout/_partials/mathjax.ejs
Normal file
36
themes/hexo-theme-Tsu/layout/_partials/mathjax.ejs
Normal file
@@ -0,0 +1,36 @@
|
||||
<!-- MathJax配置,可通过单美元符号书写行内公式等 -->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
"HTML-CSS": {
|
||||
preferredFont: "TeX",
|
||||
availableFonts: ["STIX","TeX"],
|
||||
linebreaks: { automatic:true },
|
||||
EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
|
||||
},
|
||||
tex2jax: {
|
||||
inlineMath: [ ["$", "$"], ["\\(","\\)"] ],
|
||||
processEscapes: true,
|
||||
ignoreClass: "tex2jax_ignore|dno",
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
|
||||
},
|
||||
TeX: {
|
||||
equationNumbers: { autoNumber: "AMS" },
|
||||
noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } },
|
||||
Macros: { href: "{}" }
|
||||
},
|
||||
messageStyle: "none"
|
||||
});
|
||||
</script>
|
||||
<!-- 给MathJax元素添加has-jax class -->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Queue(function() {
|
||||
var all = MathJax.Hub.getAllJax(), i;
|
||||
for(i=0; i < all.length; i += 1) {
|
||||
all[i].SourceElement().parentNode.className += ' has-jax';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!-- 通过连接CDN加载MathJax的js代码 -->
|
||||
<script type="text/javascript" async
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
|
||||
</script>
|
46
themes/hexo-theme-Tsu/layout/_partials/paginator.ejs
Normal file
46
themes/hexo-theme-Tsu/layout/_partials/paginator.ejs
Normal file
@@ -0,0 +1,46 @@
|
||||
<% if (page.total>1){ %>
|
||||
<nav class="page-nav">
|
||||
<% if(page.prev){ %>
|
||||
<a class="prev" href="<%- url_for(page.prev_link) %>">
|
||||
<i class="iconfont icon-left"></i>
|
||||
<span class="prev-text"><%- __('Paginator.Prev') %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
<% if(page.next){ %>
|
||||
<a class="next" href="<%- url_for(page.next_link) %>">
|
||||
<span class="next-text"><%- __('Paginator.Next') %></span>
|
||||
<i class="iconfont icon-right"></i>
|
||||
</a>
|
||||
<% } %>
|
||||
</nav>
|
||||
<% } %>
|
||||
<% if (!is_home()) { %>
|
||||
<nav class="post-nav">
|
||||
<% if(page.tags){ %>
|
||||
<div class="page-tags">
|
||||
<% page.tags.forEach(function(tag){ %>
|
||||
<a href="<%- url_for(tag.path) %>"><%= tag.name%></a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
</nav>
|
||||
|
||||
<% } %>
|
||||
<% if (is_post()){ %>
|
||||
<nav class="paginator clearfix">
|
||||
<%if(page.prev){%>
|
||||
<a class="prev" href="<%- url_for(page.prev.path) %>">
|
||||
<i class="iconfont icon-left"></i>
|
||||
<span class="prev-text"><%= page.prev.title %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
<%if(page.next){%>
|
||||
<a class="next" href="<%- url_for(page.next.path) %>">
|
||||
|
||||
<span class="prev-text"><%= page.next.title %></span>
|
||||
<i class="iconfont icon-right"></i>
|
||||
</a>
|
||||
<% } %>
|
||||
</nav>
|
||||
|
||||
<%}%>
|
21
themes/hexo-theme-Tsu/layout/_partials/posts.ejs
Normal file
21
themes/hexo-theme-Tsu/layout/_partials/posts.ejs
Normal file
@@ -0,0 +1,21 @@
|
||||
<div class="posts-wrapper">
|
||||
<% page.posts.each(function(post){ %>
|
||||
<article class="post article-entry">
|
||||
<div class="post-title">
|
||||
<a class="post-title-link text-underline" href="<%- url_for(post.path) %>"><%= post.title %></a>
|
||||
</div>
|
||||
<p class="sub"><%- date(post.date, "MMM DD YYYY") %></p>
|
||||
<div class="post-content">
|
||||
<% if (post.excerpt){ %>
|
||||
<%- post.excerpt %>
|
||||
<p class="article-more-link">
|
||||
<a href="<%- url_for(post.path) %>">阅读全文</a>
|
||||
</p>
|
||||
<% } else { %>
|
||||
<%- post.content %>
|
||||
<% } %>
|
||||
</div>
|
||||
</article>
|
||||
<% }) %>
|
||||
</div>
|
||||
<%- partial('_partials/side-bar') %>
|
18
themes/hexo-theme-Tsu/layout/_partials/side-bar.ejs
Normal file
18
themes/hexo-theme-Tsu/layout/_partials/side-bar.ejs
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="side-bar">
|
||||
|
||||
|
||||
<div class="avator" id="avator">
|
||||
<div class="title">
|
||||
<a href="#" class="text-underline">About Me</a>
|
||||
</div>
|
||||
<img src="<%= theme.avator %>" class="ava-img">
|
||||
<h3 class="author"><%= config.author %></h3>
|
||||
<div class="icon-list">
|
||||
<a href="<%= theme.weibo %>"><i class="iconfont icon-weibo icon-item"></i></a>
|
||||
<a href="<%= theme.email %>"><i class="iconfont icon-email icon-item"></i></a>
|
||||
<a href="<%= theme.github %>"><i class="iconfont icon-github icon-item"></i></a>
|
||||
<a href="<%= theme.linkedin %>"><i class="iconfont icon-linkedin icon-item"></i></a>
|
||||
</div>
|
||||
<%- partial('_partials/tags') %>
|
||||
</div>
|
||||
</div>
|
4
themes/hexo-theme-Tsu/layout/_partials/tags.ejs
Normal file
4
themes/hexo-theme-Tsu/layout/_partials/tags.ejs
Normal file
@@ -0,0 +1,4 @@
|
||||
<div class="tags">
|
||||
<h3 class="tags-title">Tags</h3>
|
||||
<%- list_tags({show_count: true, amount: 10, orderby: 'count'}) %>
|
||||
</div>
|
10
themes/hexo-theme-Tsu/layout/_partials/toc.ejs
Normal file
10
themes/hexo-theme-Tsu/layout/_partials/toc.ejs
Normal file
@@ -0,0 +1,10 @@
|
||||
<% if(is_post()){%>
|
||||
<div class="_toc">
|
||||
<strong class="toc-title">
|
||||
Contents
|
||||
</strong>
|
||||
<div class="toc-content">
|
||||
<%- toc(page.content, {list_number: false}) %>
|
||||
</div>
|
||||
</div>
|
||||
<%}%>
|
1
themes/hexo-theme-Tsu/layout/about.ejs
Normal file
1
themes/hexo-theme-Tsu/layout/about.ejs
Normal file
@@ -0,0 +1 @@
|
||||
<p>helo</p>
|
48
themes/hexo-theme-Tsu/layout/archive.ejs
Normal file
48
themes/hexo-theme-Tsu/layout/archive.ejs
Normal file
@@ -0,0 +1,48 @@
|
||||
<section class="archive">
|
||||
<% if (!page.prev){ %>
|
||||
<% if (page.tag){ %>
|
||||
<div class="archive-title tag">
|
||||
<h2 class="archive-name"><%= page.tag %></h2>
|
||||
</div>
|
||||
<% if(page.category)%>
|
||||
<div class="archive-title category">
|
||||
<h2 class="archive-name"><%= page.category %></h2>
|
||||
</div>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<div class="post-archive">
|
||||
<% var last; %>
|
||||
<% page.posts.each(function(post){ %>
|
||||
<% var year = date(post.date,"YYYY"); %>
|
||||
<% if (last !== year){ %>
|
||||
<% last = year; %>
|
||||
<% if (last !== null){ %>
|
||||
<%if(is_archive()){%>
|
||||
<div class="collect-year">
|
||||
<h2><%= year %></h2>
|
||||
</div>
|
||||
<%}%>
|
||||
<% } %>
|
||||
|
||||
<% }; %>
|
||||
<div class="collect-item">
|
||||
<% if(is_archive()){%>
|
||||
<div class="time"><%= date(post.date,"MM-DD")%></div>
|
||||
<a href="<%- url_for(post.path) %>" class="title"><%= post.title %></a>
|
||||
<%};%>
|
||||
<% if(!is_archive()) {%>
|
||||
<div class="time"><%= date(post.date,"YYYY-MM-DD")%></div>
|
||||
<a href="<%- url_for(post.path) %>" class="title"><%= post.title %></a>
|
||||
<%};%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<% }) %>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<%- partial('_partials/paginator') %>
|
4
themes/hexo-theme-Tsu/layout/index.ejs
Normal file
4
themes/hexo-theme-Tsu/layout/index.ejs
Normal file
@@ -0,0 +1,4 @@
|
||||
<section class="posts clearfix">
|
||||
<%- partial('_partials/posts') %>
|
||||
</section>
|
||||
<%- partial('_partials/paginator') %>
|
23
themes/hexo-theme-Tsu/layout/layout.ejs
Normal file
23
themes/hexo-theme-Tsu/layout/layout.ejs
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%- partial('_partials/head') %>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<%- partial('_partials/header') %>
|
||||
<main class="main">
|
||||
<%- body %>
|
||||
</main>
|
||||
<%- partial('_partials/footer') %>
|
||||
</div>
|
||||
<div class="back-to-top" id="back-to-top">
|
||||
<i class="iconfont icon-up"></i>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<%- js('js/jquery-3.3.1.min.js')%>
|
||||
<%- js('js/back-to-top.js') %>
|
||||
<%- js('js/scroll.js') %>
|
||||
<%- partial('_partials/mathjax') %>
|
||||
</html>
|
15
themes/hexo-theme-Tsu/layout/post.ejs
Normal file
15
themes/hexo-theme-Tsu/layout/post.ejs
Normal file
@@ -0,0 +1,15 @@
|
||||
<section class="posts clearfix">
|
||||
<div class="post-wrapper">
|
||||
<article class="post article-entry">
|
||||
<div class="post-title">
|
||||
<%= page.title %>
|
||||
</div>
|
||||
<p class="sub"><%- date(page.date, "MMM DD YYYY") %></p>
|
||||
<div class="post-content">
|
||||
<%- page.content %>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<%- partial('_partials/toc') %>
|
||||
</section>
|
||||
<%- partial('_partials/paginator') %>
|
Reference in New Issue
Block a user