first commit

This commit is contained in:
shenyu
2019-12-03 19:37:44 +08:00
commit f396a42774
105 changed files with 19372 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<%- js('/js/jquery-2.0.3.min') %>
<%- js('/js/jquery.justifiedGallery.min') %>
<%- js('/js/lazyload.min') %>
<%- js('/js/busuanzi-2.3.pure.min') %>
<% if (theme.fancybox){ %>
<%- js('fancybox/jquery.fancybox.min') %>
<% } %>
<% if (theme.toc && is_post()){ %>
<%- js('/js/tocbot.min') %>
<script>
// Tocbot_v4.7.0 http://tscanlin.github.io/tocbot/
tocbot.init({
tocSelector: '.tocbot',
contentSelector: '.article-entry',
headingSelector: 'h1, h2, h3, h4, h5, h6',
hasInnerContainers: true,
scrollSmooth: true,
positionFixedSelector: '.tocbot',
positionFixedClass: 'is-position-fixed',
fixedSidebarOffset: 'auto',
});
</script>
<% } %>
<script>
var ayerConfig = {
mathjax: <%=theme.mathjax %>
}
</script>
<%- js('js/ayer') %>
<% if (theme.mathjax){ %>
<%- partial('mathjax') %>
<% } %>

View File

@@ -0,0 +1,14 @@
<article class="archive-article archive-type-<%= post.layout %>">
<div class="archive-article-inner">
<header class="archive-article-header">
<%- partial('post/date', {class_name: 'archive-article-date', date_format: 'MM/DD'}) %>
<%- partial('post/title', {class_name: 'archive-article-title'}) %>
</header>
<% if(page.category){ %>
<%- partial('post/category') %>
<% } %>
<% if(page.tag){ %>
<%- partial('post/tag') %>
<% } %>
</div>
</article>

View File

@@ -0,0 +1,55 @@
<section class="outer">
<article class="articles">
<%
var title = '';
if (page.category) title = page.category;
if (page.tag) title = "#" + "&nbsp" + page.tag;
if (page.archive) {
if (page.year) title = page.year + (page.month ? '/' + page.month : '');
else title = __('archive_a');
}
%>
<h1 class="page-type-title"><%- title %></h1>
<% if (pagination == 2){ %>
<% page.posts.each(function(post){ %>
<%- partial('article', {post: post, index: true}) %>
<% }) %>
</article>
<% } else { %>
<% var last; %>
<% page.posts.each(function(post, i){ %>
<% var year = post.date.year(); %>
<% if (last != year){ %>
<% if (last != null){ %>
</div>
</div>
<% } %>
<% last = year; %>
<div class="archives-wrap">
<div class="archive-year-wrap">
<a href="<%- url_for(config.archive_dir + '/' + year) %>" class="archive-year"><%= year %></a>
</div>
<div class="archives">
<% } %>
<%- partial('archive-post', {post: post, even: i % 2 == 0}) %>
<% }) %>
<% if (page.posts.length){ %>
</div>
</div>
<% } %>
<% } %>
<% if (page.total > 1){ %>
<nav class="page-nav">
<%
var prev_text = theme.nav_text.page_prev;
var next_text = theme.nav_text.page_next
%>
<%- paginator({
prev_text: prev_text,
next_text: next_text
}) %>
</nav>
<% } %>
</section>

View File

@@ -0,0 +1,58 @@
<article id="<%= post.layout %>-<%= post.slug %>" class="article article-type-<%= post.layout %>" itemscope
itemprop="blogPost" data-scroll-reveal>
<div class="article-inner">
<% if (post.link || post.title){ %>
<header class="article-header">
<%- partial('post/title', {class_name: 'article-title'}) %>
</header>
<% } %>
<% if (index || is_post()) { %>
<div class="article-meta">
<%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
<%- partial('post/category') %>
</div>
<% } %>
<% if (theme.toc && is_post()){ %>
<%- partial('post/tocbot') %>
<% } %>
<div class="article-entry" itemprop="articleBody">
<%- partial('post/justifiedGallery') %>
<%- partial('post/gallery') %>
<% if (post.excerpt && index){ %>
<%- post.excerpt %>
<% if (theme.excerpt_link){ %>
<a class="article-more-link" href="<%- url_for(post.path) %>"><%= theme.excerpt_link %></a>
<% } %>
<% } else { %>
<%- post.content %>
<% } %>
</div>
<footer class="article-footer">
<a data-url="<%- post.permalink %>" data-id="<%= post._id %>"
class="article-share-link"><%- theme.share_text %></a>
<%- partial('post/tag') %>
</footer>
</div>
<% if (!index){ %>
<%- partial('post/nav') %>
<% } %>
<% if (theme.valine && theme.valine.enable){ %>
<%- partial('post/valine', {
key: post.slug,
title: post.title,
url: config.url+url_for(post.path)
}) %>
<% } %>
<% if (is_post()) { %>
<%- partial('post/gitalk') %>
<%} %>
</article>

23
layout/_partial/ayer.ejs Normal file
View File

@@ -0,0 +1,23 @@
<% if (theme.cover.enable) { %>
<section class="cover">
<div class="cover-frame">
<div class="bg-box">
<img src="<%- theme.cover.path %>" alt="image frame" />
</div>
<div class="cover-inner text-center text-white">
<h1><a href="<%- url_for() %>"><%= config.title %></a></h1>
<h2><%= config.subtitle %></h2>
<div>
<img
src="<%- theme.cover.logo %>"
class="cover-logo"
alt="<%= config.title %>"
/>
</div>
</div>
</div>
<div class="cover-learn-more">
<a href="#main" class="anchor"><i class="ri-arrow-down-line"></i></a>
</div>
</section>
<% } %>

View File

@@ -0,0 +1,32 @@
<footer class="footer">
<div class="outer">
<ul class="list-inline">
<li>
&copy;
<% if (theme.since && !isNaN(theme.since) && theme.since < date(new Date(), 'YYYY')) { %><%- theme.since%>-<% } %><%= date(new Date(), 'YYYY') %>
<%= config.author || config.title %>
</li>
<li>
<% if (theme.pageFooter){ %>
<% var hexoLink = '<a href="https://hexo.io" target="_blank">Hexo</a>'; %>
<% var themeLink = '<a href="https://hexo.io" target="_blank">Ayer</a>'; %>
<%- hexoLink %> Theme <%- themeLink %> by shenyu
<% } %>
</li>
</ul>
<ul class="list-inline">
<li>
<% if (theme.busuanzi && theme.busuanzi.enable){ %>
<%# "不蒜子统计" %>
<%- partial('post/busuanzi') %>
<% } %>
</li>
<li>
<!-- cnzz统计 -->
<% if (theme.cnzz&&theme.cnzz.enable){ %>
<script type="text/javascript" src='<%= theme.cnzz.url%>'></script>
<% } %>
</li>
</ul>
</div>
</footer>

34
layout/_partial/head.ejs Normal file
View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<% var title = page.title; if (is_archive()) { title = __('archive_a'); if
(is_month()) { title += ': ' + page.year + '/' + page.month; } else if
(is_year()) { title += ': ' + page.year; } } else if (is_category()) { title
= __('categories.ejs') + ': ' + page.categories; } else if (is_tag()) {
title = __('tag') + ': ' + page.tag; } %> <% if (page.keywords){ %>
<meta
name="keywords"
content="<%= page.keywords %>,<%= config.keywords %>"
/>
<% } else if (config.keywords){ %>
<meta name="keywords" content="<%= config.keywords %>" />
<% } %> <% if (page.description){ %>
<meta name="description" content="<%= page.description %>" />
<% } else if (config.description){ %>
<meta name="description" content="<%= config.description %>" />
<% } %>
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<title>
<% if (title){ %><%= title %> | <% } %> <%= config.title %>
</title>
<% if (theme.favicon){ %>
<link rel="shortcut icon" href="<%- theme.favicon %>" />
<% } %>
<%- css('css/style') %> <% if (theme.fancybox){ %> <%-
css('fancybox/jquery.fancybox.min') %> <% } %> <%- js('/js/pace.min.js') %>
</head>
</html>

View File

@@ -0,0 +1,18 @@
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
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>
<script src="https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

View File

@@ -0,0 +1,18 @@
<% if (post.albums && post.albums.length){ %>
<div class="article-albums">
<ul class="article-albums-photos" id="basicExample">
<% post.albums.forEach(function(photo){ %>
<li class="article-albums-item" data-scroll-reveal>
<a class="article-albums-img fancybox" data-fancybox="images" data-caption="<%- photo[1] %>" href="<%- url_for(photo[0]) %>" rel="gallery_<%= post._id %>" title="<%- photo[1] %>">
<img class="lazy" data-original="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>">
</a>
<% if (photo && photo.length > 1){ %>
<span class="article-albums-caption"> <%- photo[1] %> </span>
<% } %>
</li>
<% }) %>
</ul>
</div>
<% } %>

View File

@@ -0,0 +1,9 @@
<ul class="list-inline">
<% if (is_home()) { %>
<li>PV:<span id="busuanzi_value_site_pv"></span></li>
<%} %>
<li>UV:<span id="busuanzi_value_site_uv"></span></li>
<% if (is_post()) { %>
<li>PV:<span id="busuanzi_value_page_pv"></span></li>
<%} %>
</ul>

View File

@@ -0,0 +1,10 @@
<% if (post.categories && post.categories.length){ %>
<div class="article-category">
<%- list_categories(post.categories, {
show_count: false,
class: 'article-category',
style: 'none',
separator: ' / '
}) %>
</div>
<% } %>

View File

@@ -0,0 +1,3 @@
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</a>

View File

@@ -0,0 +1,15 @@
<% if (post.photos && post.photos.length){ %>
<div class="article-gallery">
<div class="article-gallery-photos">
<% post.photos.forEach(function(photo, i){ %>
<% if (index){ %>
<a class="article-gallery-img" href="<%- url_for(post.path) %>" rel="gallery_<%= post._id %>">
<img src="<%- url_for(photo) %>" itemprop="image">
</a>
<% } else { %>
<img src="<%- url_for(photo) %>" itemprop="image">
<% } %>
<% }) %>
</div>
</div>
<% } %>

View File

@@ -0,0 +1,21 @@
<% if (theme.gitalk.enable) { %>
<div class="gitalk" id="gitalk-container"></div>
<%- css('https://unpkg.com/gitalk/dist/gitalk.css') %>
<%- js('https://unpkg.com/gitalk/dist/gitalk.min.js') %>
<%- js('https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js') %>
<script type="text/javascript">
var gitalk = new Gitalk({
clientID: '<%- theme.gitalk.clientID %>',
clientSecret: '<%- theme.gitalk.clientSecret %>',
repo: '<%- theme.gitalk.repo %>',
owner: '<%- theme.gitalk.owner %>',
admin: ['<%- theme.gitalk.admin %>'],
// id: location.pathname, // Ensure uniqueness and length less than 50
id: md5(location.pathname),
distractionFreeMode: false, // Facebook-like distraction free mode
pagerDirection: 'last'
})
gitalk.render('gitalk-container')
</script>
<% } %>

View File

@@ -0,0 +1,12 @@
<% if (post.albums && post.albums.length){ %>
<div class="justified-gallery" id="gallery">
<% post.albums.forEach(function(photo){ %>
<div>
<a class="fancybox" data-fancybox="images" data-caption="<%- photo[1] %>" href="<%- url_for(photo[0]) %>" rel="gallery_<%= post._id %>" title="<%- photo[1] %>">
<img src="<%- url_for(photo[0]) %>" itemprop="image" alt="<%- photo[1] %>">
</a>
</div>
<% }) %>
</div>
<% } %>

View File

@@ -0,0 +1,22 @@
<% if (post.prev || post.next){ %>
<nav class="article-nav">
<% if (post.prev){ %>
<a href="<%- url_for(post.prev.path) %>" class="article-nav-link">
<strong class="article-nav-caption"><%- theme.nav_text.post_prev %></strong>
<div class="article-nav-title">
<% if (post.prev.title){ %>
<%= post.prev.title %>
<% } else { %>
(no title)
<% } %>
</div>
</a>
<% } %>
<% if (post.next){ %>
<a href="<%- url_for(post.next.path) %>" class="article-nav-link">
<strong class="article-nav-caption"><%- theme.nav_text.post_next %></strong>
<div class="article-nav-title"><%= post.next.title %></div>
</a>
<% } %>
</nav>
<% } %>

View File

@@ -0,0 +1,4 @@
<div class="local-search local-search-plugin">
<input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
<div id="local-search-result" class="local-search-result"></div>
</div>

View File

@@ -0,0 +1,6 @@
<% if (post.tags && post.tags.length){ %>
<%- list_tags(post.tags, {
show_count: false,
class: 'article-tag'
}) %>
<% } %>

View File

@@ -0,0 +1,17 @@
<% if (post.link){ %>
<h2 itemprop="name">
<a class="<%= class_name %>" href="<%- url_for(post.link) %>" itemprop="url"
><%= post.title %></a
>
</h2>
<% } else if (post.title){ %> <% if (index){ %>
<h2 itemprop="name">
<a class="<%= class_name %>" href="<%- url_for(post.path) %>"
><%= post.title %></a
>
</h2>
<% } else { %>
<h1 class="<%= class_name %> sea-center" style="border-left:0" itemprop="name">
<%= post.title %>
</h1>
<% } %> <%- partial('topping') %> <% } %>

View File

@@ -0,0 +1,6 @@
<% if (post.toc != false && toc(page.content).length!==0){ %>
<div class="tocbot"></div>
<% } %>

View File

@@ -0,0 +1,5 @@
<% if (is_home() && post.top) { %>
<div class="article-topping">
<i class="ri-umbrella-line"></i>
</div>
<% } %>

View File

@@ -0,0 +1,51 @@
<% if (!index && theme.leancloud && theme.leancloud.enable){ %>
<!-- valine评论 -->
<div id="vcomments-box">
<div id="vcomments">
</div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine@1.3.10/dist/Valine.min.js'></script>
<script>
new Valine({
el: '#vcomments',
notify: false,
verify: false,
app_id: '<%- theme.leancloud.app_id %>',
app_key: '<%- theme.leancloud.app_key %>',
path: window.location.pathname,
avatar: '<%- theme.valine.avatar %>',
placeholder: '<%- theme.valine.placeholder %>',
recordIP: true
});
const infoEle = document.querySelector('#vcomments .info');
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
infoEle.childNodes.forEach(function (item) {
item.parentNode.removeChild(item);
});
}
</script>
<style>
#vcomments-box {
padding: 5px 30px;
}
@media screen and (max-width: 800px) {
#vcomments-box {
padding: 5px 0px;
}
}
#vcomments-box #vcomments {
background-color: #fff;
}
.v .vlist .vcard .vh {
padding-right: 20px;
}
.v .vlist .vcard {
padding-left: 10px;
}
</style>
<% } %>

View File

@@ -0,0 +1,34 @@
<button class="navbar-toggle"></button>
<nav class="navbar">
<% if (theme.logo){ %>
<div class="logo">
<a href="<%- url_for() %>"><img src="<%- theme.logo %>" alt="<%= config.title %>"></a>
</div>
<% } %>
<ul class="nav nav-main">
<% for (var i in theme.menu){ %>
<li class="nav-item">
<a class="nav-item-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a>
</li>
<% } %>
</ul>
</nav>
<nav class="navbar navbar-bottom">
<ul class="nav">
<li class="nav-item">
<% if (theme.search){ %>
<a class="nav-item-link nav-item-search" title="<%= __('search') %>">
<i class="ri-search-line"></i>
</a>
<% } %>
<% if (theme.rss){ %>
<a class="nav-item-link" target="_blank" href="<%- url_for(theme.rss) %>" title="<%= __('rss_feed') %>">
<i class="ri-rss-line"></i>
</a>
<% } %>
</li>
</ul>
</nav>
<div class="search-form-wrap">
<%- partial('post/search') %>
</div>

View File

@@ -0,0 +1,3 @@
<div class="totop" id="totop">
<i class="ri-arrow-up-line"></i>
</div>

1
layout/archive.ejs Normal file
View File

@@ -0,0 +1 @@
<%- partial('_partial/archive', {pagination: config.archive, index: true}) %>

6
layout/categories.ejs Normal file
View File

@@ -0,0 +1,6 @@
<section class="outer">
<% if (site.categories.length){ %>
<h1 class="page-type-title"><%= __('categories') %></h1>
<%- list_categories({show_count: theme.show_count}) %>
<% } %>
</section>

7
layout/index.ejs Normal file
View File

@@ -0,0 +1,7 @@
<%- partial('_partial/ayer') %>
<div id="main">
<%- partial('_partial/archive', {pagination: 2, index: true}) %>
<div class="to_top">
<%- partial('_partial/totop') %>
</div>
</div>

20
layout/layout.ejs Normal file
View File

@@ -0,0 +1,20 @@
<%- partial('_partial/head') %>
<body>
<div id="app">
<main class="content">
<%- body %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
</main>
<% if (theme.toc && is_post()){ %>
<aside class="sidebar">
<% } else { %>
<aside class="sidebar">
<% } %>
<%- partial('_partial/sidebar') %>
</aside>
<%- partial('_partial/after-footer') %>
</div>
</body>
</html>

3
layout/page.ejs Normal file
View File

@@ -0,0 +1,3 @@
<section class="outer">
<%- partial('_partial/article', {post: page, index: false}) %>
</section>

3
layout/post.ejs Normal file
View File

@@ -0,0 +1,3 @@
<section class="outer">
<%- partial('_partial/article', {post: page, index: false}) %>
</section>

7
layout/tags.ejs Normal file
View File

@@ -0,0 +1,7 @@
<section class="outer">
<% if (site.tags.length){ %>
<h1 class="page-type-title"><%= __('tags') %></h1>
<%- list_tags({show_count: theme.show_count}) %>
<% } %>
</section>