项目初始化建立

This commit is contained in:
徐涛
2021-04-08 09:45:39 +08:00
commit 9318f020fd
40 changed files with 2876 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<div class="uk-flex mx-2 my-2 main-content">
<section class="uk-width-3-4 px-1">
<% if (!is_month()) { %>
<div class="uk-card uk-card-default uk-card-body uk-height-1-1">
<%- list_archives({type: 'monthly', order: '1', show_count: true, format: 'YYYY年MM月'}) %>
</div>
<% } else { %>
<%- partial('partial/post/list', {start: 1}) %>
<% } %>
</section>
<section class="uk-width-1-4">
<%- partial('partial/side', {'noCategories': false, 'noTags': false}) %>
</section>
</div>

View File

@@ -0,0 +1,10 @@
<div class="uk-flex mx-2 my-2 main-content">
<section class="uk-width-3-4 px-1">
<div class="uk-card uk-card-default uk-card-body uk-height-1-1">
<%- list_categories({orderby: 'name', order: '1', show_count: true, class: "categories-toc"}) %>
</div>
</section>
<section class="uk-width-1-4">
<%- partial('partial/side', {'noCategories': true, 'noTags': false}) %>
</section>
</div>

View File

@@ -0,0 +1,19 @@
<div class="uk-flex mx-2 my-2 main-content">
<section class="uk-width-3-4 px-1">
<%- partial('partial/post/list', {start: 1}) %>
<% if (page.total> 1) { %>
<div class="uk-flex uk-flex-between p-1">
<a class="<% if (page.prev == 0) { %>uk-disabled<% } %>"
href="<%- page.prev_link %>"
uk-slidenav-previous></a>
<a class="<% if (page.next == 0) { %>uk-disabled<% } %>"
href="<%- page.next_link %>"
uk-slidenav-next
></a>
</div>
<% } %>
</section>
<section class="uk-width-1-4">
<%- partial('partial/side', {'noCategories': true, 'noTags': false}) %>
</section>
</div>

View File

@@ -0,0 +1,19 @@
<div class="uk-flex mx-2 my-2 main-content">
<section class="uk-width-3-4 px-1">
<%- partial('partial/post/list', {start: 1}) %>
<% if (page.total> 1) { %>
<div class="uk-flex uk-flex-between p-1">
<a class="<% if (page.prev == 0) { %>uk-disabled<% } %>"
href="<%- page.prev_link %>"
uk-slidenav-previous></a>
<a class="<% if (page.next == 0) { %>uk-disabled<% } %>"
href="<%- page.next_link %>"
uk-slidenav-next
></a>
</div>
<% } %>
</section>
<section class="uk-width-1-4">
<%- partial('partial/side', {'noCategories': false, 'noTags': false}) %>
</section>
</div>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="<%= page.lang %>">
<%- partial('partial/head.ejs') %>
<body>
<%- partial('partial/header.ejs') %>
<%- body %>
<%- partial('partial/footer.ejs') %>
<%- partial('partial/scripts.ejs') %>
</body>
</html>

View File

View File

@@ -0,0 +1,14 @@
<footer class="uk-flex uk-flex-row uk-flex-between uk-flex-center py-2 px-2">
<div class="uk-width-1-3 uk-text-small">
<p class="m-0">Powered by <%- link_to("http://hexo.io/", "Hexo", {external: true})%></p>
<p class="uk-text-meta m-0">Theme Grid by FarDawn.</p>
</div>
<div class="uk-width-1-3 uk-text-small uk-text-center">
<p class="m-0">&copy; ArchGrid, since 2021.</p>
<p class="m-0">Proudly presents by FarDawn.</p>
</div>
<div class="uk-width-1-3 uk-text-small uk-text-right">
<p class="m-0">备案信息位置</p>
<p class="m-0">备案信息位置</p>
</div>
</footer>

View File

@@ -0,0 +1,16 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<%- partial('partial/styles') -%>
<title><%= config.title %> - <%= config.subtitle %></title>
<%_ if (config.keyword) { -%>
<meta name="keywords" content="<% config.keyword %>">
<%_ } -%>
<%_ if (config.description) { -%>
<meta name="description" content="<%= config.description %>">
<%_ } -%>
<%_ if (config.author) { -%>
<meta name="author" content="<%= config.author %>">
<%_ } -%>
</head>

View File

@@ -0,0 +1,16 @@
<nav class="uk-navbar-container uk-box-shadow-medium" uk-navbar uk-sticky>
<div class="uk-navbar-left">
<a class="uk-navbar-item uk-logo" href="/index.html"><%= config.title %></a>
<span class="uk-navbar-item">用碎片化的时间收集碎片化的知识</span>
</div>
<div class="uk-navbar-right">
<ul class="uk-navbar-nav">
<% if (!is_home()) { %>
<li><a href="/index.html">返回首页</a></li>
<% } %>
<li<% if (is_current('/categories')) { %> class="uk-active"<% } %>><a href="/categories">知识分类</a></li>
<li<% if (is_current('/tags')) { %> class="uk-active"<% } %>><a href="/tags">知识标签</a></li>
<li<% if (is_archive()) { %> class="uk-active"<% } %>><a href="/archives">归档文章</a></li>
</ul>
</div>
</nav>

View File

@@ -0,0 +1,35 @@
<% page.posts.sort("date", "desc" ).each(function(post, i) { %>
<div class="uk-card uk-card-default uk-card-small uk-width-1-1 mb-2">
<div class="uk-card-header">
<h3 class="uk-card-title">
<a href="<%= post.path %>"><%= post.title %></a>
</h3>
<div class="uk-flex uk-flex-left">
<div class="uk-text-meta mr-1">最后更新:<%= date(post.date, "YYYY-MM-DD HH:mm") %></div>
<% if (post.categories.length > 0) { %>
<div class="uk-text-meta">知识分类:
<%- list_categories(post.categories, {
class: { a: 'uk-link-muted' },
show_count: false,
style: false,
separator: ' / '
}) %>
</div>
<% } %>
</div>
</div>
<% if (post.excerpt) { %>
<div class="uk-card-body">
<%- post.excerpt %>
</div>
<% } %>
<% if (post.tags.length > 0) { %>
<div class="uk-card-footer uk-flex uk-flex-left">
<span>分类标签:</span>
<% post.tags.each(function(tag) { %>
<span class="uk-label ml-1 <% if (is_tag(tag.name)) { %>uk-label-warning<% } %>"><%= tag.name %></span>
<% }) %>
</div>
<% } %>
</div>
<% }) %>

View File

@@ -0,0 +1,4 @@
<%- js(['https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js']) %>
<%- js(['https://cdn.staticfile.org/uikit/3.6.18/js/uikit-core.min.js']) %>
<%- js(['https://cdn.staticfile.org/uikit/3.6.18/js/uikit-icons.min.js']) %>
<%- js(['/js/prism.js']) %>

View File

@@ -0,0 +1,40 @@
<% if (is_post()) { %>
<div class="uk-card uk-card-small uk-card-default uk-card-body mb-2">
<div class="uk-card-title">文章目录</div>
<div class="pt-1">
<%- toc(page.content) %>
</div>
</div>
<% } %>
<% if (!is_category() && !noCategories) { %>
<div class="uk-card uk-card-small uk-card-default uk-card-body mb-2">
<div class="uk-card-title">知识分类</div>
<div class="pt-1">
<% if (site.categories.length == 0) { %>
<div class="uk-alert-warning" uk-alert>
<p>当前还没有分类。</p>
</div>
<% } else { %>
<%- list_categories(site.categories, {
class: 'category',
style: 'list',
show_count: false,
}) %>
<% } %>
</div>
</div>
<% } %>
<% if (!is_tag() && !noTags) { %>
<div class="uk-card uk-card-small uk-card-default uk-card-body mb-2">
<div class="uk-card-title">知识标签</div>
<div class="pt-1">
<% if (site.tags.length == 0) { %>
<div class="uk-alert-warning" uk-alert>
<p>当前还没有建立标签。</p>
</div>
<% } else { %>
<%- partial('widget/tagcloud') %>
<% } %>
</div>
</div>
<% } %>

View File

@@ -0,0 +1,5 @@
<%- css(['https://cdn.staticfile.org/KaTeX/0.12.0/katex.min.css']) %>
<%- css(['css/admonition.css']) %>
<%- css(['css/prism.css']) %>
<%- css(['css/theme.css']) %>
<%- css(['css/style.css']) %>

View File

@@ -0,0 +1,39 @@
<div class="uk-flex mx-2 my-2 main-content">
<section class="uk-width-3-4 px-1">
<div class="uk-card uk-card-default uk-card-small uk-width-1-1 mb-2">
<div class="uk-card-header">
<h3 class="uk-card-title uk-flex uk-flex-left uk-flex-middle">
<a href="javascript:history.go(-1)" uk-icon="icon: chevron-left" uk-tooltip="后退到上一个页面"></a>
<span class="ml-1"><%= page.title %></span>
</h3>
<div class="uk-flex uk-flex-left">
<div class="uk-text-meta mr-1">最后更新:<%= date(page.date, "YYYY-MM-DD HH:mm") %></div>
<% if (page.categories.length > 0) { %>
<div class="uk-text-meta">知识分类:
<%- list_categories(page.categories, {
class: { a: 'uk-link-muted' },
show_count: false,
style: false,
separator: ' / '
}) %>
</div>
<% } %>
</div>
</div>
<article class="uk-card-body">
<%- page.content %>
</article>
<% if (page.tags.length > 0) { %>
<div class="uk-card-footer uk-flex uk-flex-left">
<span>分类标签:</span>
<% page.tags.each(function(tag) { %>
<span class="uk-label ml-1"><%= tag.name %></span>
<% }) %>
</div>
<% } %>
</div>
</section>
<section class="uk-width-1-4">
<%- partial('partial/side', {'noCategories': false, 'noTags': false}) %>
</section>
</div>

View File

@@ -0,0 +1,19 @@
<div class="uk-flex mx-2 my-2 main-content">
<section class="uk-width-3-4 px-1">
<%- partial('partial/post/list', {start: 1}) %>
<% if (page.total> 1) { %>
<div class="uk-flex uk-flex-between p-1">
<a class="<% if (page.prev == 0) { %>uk-disabled<% } %>"
href="<%- page.prev_link %>"
uk-slidenav-previous></a>
<a class="<% if (page.next == 0) { %>uk-disabled<% } %>"
href="<%- page.next_link %>"
uk-slidenav-next
></a>
</div>
<% } %>
</section>
<section class="uk-width-1-4">
<%- partial('partial/side', {'noCategories': false, 'noTags': true}) %>
</section>
</div>

View File

@@ -0,0 +1,10 @@
<div class="uk-flex mx-2 my-2 main-content">
<section class="uk-width-3-4 px-1">
<div class="uk-card uk-card-default uk-card-body uk-height-1-1">
<%- list_tags({orderby: 'name', order: '1', show_count: true, class: "tags-toc"}) %>
</div>
</section>
<section class="uk-width-1-4">
<%- partial('partial/side', {'noCategories': false, 'noTags': true}) %>
</section>
</div>

View File

@@ -0,0 +1,7 @@
<% if (site.tags.length) { %>
<div class="widget-wrap">
<div class="widget tagcloud">
<%- tagcloud(site.tags, {min_font: 12, max_font: 18, amount: 90, color: true, start_color: '#8377ee', end_color: '#1b0ba8', class: 'tag-item', level: 20}) %>
</div>
</div>
<% } %>