Skip to content

Commit

Permalink
flex-block v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miiiku committed Jul 8, 2021
1 parent 9982b26 commit cfb3de7
Show file tree
Hide file tree
Showing 65 changed files with 1,127 additions and 1,713 deletions.
469 changes: 21 additions & 448 deletions README.md

Large diffs are not rendered by default.

112 changes: 52 additions & 60 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
# Header
menu:
HOME: /
banner: https://qiniu.sukoshi.xyz/src/images/banner.jpg
# banner: css/images/banner.jpg
# logo: https://qiniu.miiiku.xyz/src/images/logo.png
首页: /
友链: /links
留言: /messages
关于: /about

# large cover
large_legnth: 20
# 主页banner图
banner: https://qiniu.sukoshi.xyz/src/images/68686407_p0.jpg

# 一言
# docs: https://hitokoto.cn/api
# type: [a, b, c, d, e, f, g]
hitokoto:
enable: true
type: a
# 站点通知信息
notice: flex-block主题部分重构,详情查看https://github.com/miiiku/flex-block

# 作者信息
author:
name: Sukoshi
avatar: https://s.gravatar.com/avatar/2d6b803eea37de0257620d5fabee7e64?s=200&r=g&d=retro
description: 要坚持健身鸭

# valine 评论
# docs: https://valine.js.org
# You can get your appid and appkey from https://leancloud.cn
valine:
enable: false
appId:
appKey:
avatar: mm
placeholder: 随便说点什么叭~
notify: true
visitor: true
pageSize: 10
toc:
max_depth: 3 # 生成 TOC 的最大深度
min_depth: 2 # 生成 TOC 的最小深度

disqus:
enable: false
website:
error: 如果你看不到评论,那么就真的看不到评论 w(゜Д゜)w
comments:
enable: true
use: 'valine' # valine || disqus
# valine 评论
# docs: https://valine.js.org
# You can get your appid and appkey from https://leancloud.cn
# 这里appId和appKey一定一定要改成自己的,没有的话去https://leancloud.cn这个网站注册创建一个
valine:
appId: oTmfgIaoB7PfPATvA9tsOwTu-gzGzoHsz
appKey: PPbJycuezKD3BJlhHUy8zOnG
avatar: mm
placeholder: 随便说点什么叭~
notify: true
visitor: true
pageSize: 10
# disqus 评论
# docs: https://disqus.com/
disqus:
website: sukoshi95
error: 如果你看不到评论,那么就真的看不到评论 w(゜Д゜)w

# dplayer 视频播放
# docs: http://dplayer.js.org/#/zh-Hans/
Expand All @@ -52,44 +61,27 @@ aplayer:
mutex: true
lrcType: 3

# waterfall 瀑布流
# docs: https://github.com/miiiku/waterfall
# Specific configuration information go to `layout/plug-in/waterfall.ejs`
waterfall:
enable: true

# zoom 图片预览
# docs: https://github.com/miiiku/zoom
# Specific configuration information go to `layout/plug-in/zoom.ejs`
zoom:
enable: true


# widget behavior
archive_type: 'monthly'
show_count: false

# beian
beian:
# 国内备案信息
beian: 蜀ICP备15014309号

# Miscellaneous
google_analytics:
# 谷歌分析
google_analytics: UA-165681463-1
# gauges分析
gauges_analytics:
baidu_analytics:
tencent_analytics:
# 百度分析
baidu_analytics: 77cce6624f1114785af5e77d00cbf93c
# 腾讯分析
tencent_analytics: 66537616
# 站点ico
favicon: /favicon.ico


# Social Icon
social_icon:
enable: true
icons:
- { type: email, value: }
- { type: github, value: }
- { type: google+, value: }
- { type: ins, value: }
- { type: twitter, value: }
- { type: youtube, value: }
- { type: weibo, value: }
- { type: cloudmusic, value: }
- { type: zhihu, value: }
ins :
zhihu :
weibo : https://twitter.com/guanquanhong
github : https://github.com/miiiku/
twitter : https://twitter.com/guanquanhong
Binary file removed img/flex-block-1.png
Binary file not shown.
Binary file removed img/flex-block-2.png
Binary file not shown.
58 changes: 26 additions & 32 deletions layout/_partial/article-list.ejs
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
<!-- post list container -->
<div class="body-container">
<div class="content-container article-list">
<div class="card-container card-articles">
<div class="card-list">
<% page.posts.each(function(post, i) { %>
<%
let isLarge = false;
if (theme.large_legnth && post.title.length > theme.large_legnth) {
isLarge = true
}
%>
<div class="card-item<%= isLarge ? ' large' : '' %><%= post.cover ? ' img' : '' %>">
<article>
<% if (post.cover) { %>
<div class="card-cover" style="background-image: url(<%= post.cover %>)"></div>
<% } %>
<% if (post.link) { %>
<a class="article-link card-link" href="<%- url_for(post.link) %>" itemprop="url" target="_blank"></a>
<% } else { %>
<a class="article-link card-link" href="<%- url_for(post.path) %>" itemprop="url"></a>
<% } %>
<h2 class="article-title"><%= post.title %></h2>
<div class="article-meta">
<strong><%= post.author || config.author %></strong>
<span>发布于</span>
<%- partial("../_widget/date", { class_name: 'article-date', post: post, date_format: null, link: true }) %>
</div>
<div class="article-category">
<%- partial("../_widget/category", { class_name: "article-category", post: post }) %>
</div>
</article>
<div class="content-container layout-block article-list">
<% page.posts.each(function(post, i) { %>
<div class="article-item layout-padding">
<article class="card-container article-card content-padding--large soft-size--large soft-style--box">
<% if (post.cover) { %>
<div class="card-cover" background-image-lazy data-img="<%= post.cover %>"></div>
<% } %>
<div class="card-text">
<% if (post.link) { %>
<a href="<%- url_for(post.link) %>" itemprop="url" target="_blank">
<h2 class="card-text--title"><%= post.title || "(no title)" %></h2>
</a>
<% } else { %>
<a href="<%- url_for(post.path) %>" itemprop="url">
<h2 class="card-text--title"><%= post.title || "(no title)" %></h2>
</a>
<% } %>
<div class="card-text--row">
<span>发布于</span>
<%- partial("../_widget/date", { class_name: null, post: post, date_format: null }) %>
</div>
<%- partial("../_widget/category", { page: post, class_name: post.cover ? 'dark' : 'light' }) %>
<%- partial("../_widget/tag", { page: post, class_name: post.cover ? 'dark' : 'light' }) %>
</div>
<% }) %>
</article>
</div>
</div>
<% }) %>
</div>
</div>
49 changes: 37 additions & 12 deletions layout/_partial/content.ejs
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
<!-- 文章内容 -->

<div class="body-container">
<article class="content-container article-container">
<div class="article-content">
<article class="content-container layout-block post-container">
<div class="article-info">
<%# 如果文章设置了photos内容 %>
<% if (page.photos && page.photos.length) { %>
<section class="article-gallery">
<%- partial("../_widget/gallery", { class_name: "article-gallery-photos", post: page }) %>
<section class="article-entry markdown-body layout-margin content-padding--large soft-size--large soft-style--box">
<% page.photos.forEach(function(photo, i) { %>
<p>
<a href="<%- url_for(photo) %>" target="_blank">
<img src="<%- url_for(photo) %>" itemprop="image" loading="lazy" />
</a>
</p>
<% }) %>
</section>
<% } %>

<section class="article-entry">

<%# 输出Markdown内容 %>
<section class="article-entry markdown-body layout-margin content-padding--large soft-size--large soft-style--box">
<%- page.content %>
</section>

<section class="article-footer">
<%- partial("../_widget/tags", { class_name: "article-tag", post: page }) %>
</section>
<%# 输出上一篇,下一篇内容 %>
<% if (page.prev || page.next){ %>
<nav class="article-nav">
<% if (page.prev) { %>
<%- partial("../_widget/article-nav", { page: page.prev, keyword: 'newer' }) %>
<% } %>
<% if (page.next) { %>
<%- partial("../_widget/article-nav", { page: page.next, keyword: 'older' }) %>
<% } %>
</nav>
<% } %>

<section class="article-navs">
<%- partial('../_widget/article-nav', { post: page }) %>
<section class="page-message-container layout-padding">
<%- partial('../_widget/comment', { post: page }) %>
</section>
</div>
<div class="widget-info">
<%- partial("../_widget/widget-author") %>

<%- partial("../_widget/widget-toc", { page: page }) %>

<%- partial("../_widget/widget-notice") %>

<%- partial("../_widget/widget-categorys") %>

<%- partial("../_widget/widget-tags") %>
</div>
</article>
</div>
11 changes: 7 additions & 4 deletions layout/_partial/footer-script.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<%- partial('../plug-in/valine') %>
<%- partial('../plug-in/disqus') %>
<!-- aplayer -->
<% if (page.aplayer) { %>
<%- partial('../plug-in/aplayer') %>
<% } %>

<!-- dplayer -->
<% if (page.dplayer) { %>
<%- partial('../plug-in/dplayer') %>
<%- partial('../plug-in/waterfall') %>
<%- partial('../plug-in/zoom')%>
<% } %>

<%# Gaug.es Analytics %>
<% if (theme.gauges_analytics) { %>
Expand Down
19 changes: 7 additions & 12 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
<div class="footer-container">
<% if (theme.social_icon.enable) { %>
<div class="social-icons">
<%-
icons(theme.social_icon.icons, {
render: function (icon, value) {
return partial("../_svg/" + icon, { icon, value, size: 30 })
}
})
-%>
<% for (var i in theme.social_icon.icons) { %>
<% if (theme.social_icon.icons[i]) { %>
<a href="<%= theme.social_icon.icons[i] %>" class="soft-size--primary soft-style--box" target="_blank" rel="noopener noreferrer">
<%- partial("../_svg/social-"+ i +".svg") %>
</a>
<% } %>
<% } %>
</div>
<% } %>
<p>&copy; <%= date(new Date(), 'YYYY') %> <a href="/" target="_blank"><%= config.author %></a></p>

<% if (theme.hitokoto && theme.hitokoto.enable) { %>
<p id="hitokoto"></p>
<script src="https://v1.hitokoto.cn/?<%= theme.hitokoto.type ? 'c=' + theme.hitokoto.type + '&' : '' %>encode=js&select=%23hitokoto" defer></script>
<% } %>

<% if (theme.beian) { %>
<p><a href="http://www.miitbeian.gov.cn" target="_blank"><%= theme.beian %></a></p>
<% } %>
Expand Down
29 changes: 15 additions & 14 deletions layout/_partial/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%# index container %>
<% if (is_home()) { %>
<div class="header-content">
<div class="post-text">
<div class="post-text layout-block layout-padding">
<h1 class="title-wrap"><%= config.title %></h1>
<% if (config.subtitle) { %>
<h2 class="title-sub-wrap"><%= config.subtitle %></h2>
Expand All @@ -22,7 +22,7 @@
<%# archive container %>
<% if (is_archive()) { %>
<div class="header-content">
<div class="post-text">
<div class="post-text layout-block layout-padding">
<h1 class="title-wrap">归档</h1>
<h2 class="title-sub-wrap">共有<%= site.posts.length %>篇文章</h2>
</div>
Expand All @@ -38,7 +38,7 @@
});
%>
<div class="header-content">
<div class="post-text">
<div class="post-text layout-block layout-padding">
<h1 class="title-wrap"><%= page.category %></h1>
<h2 class="title-sub-wrap">当前分类下共有<%= length %>篇文章</h2>
</div>
Expand All @@ -54,7 +54,7 @@
});
%>
<div class="header-content">
<div class="post-text">
<div class="post-text layout-block layout-padding">
<h1 class="title-wrap"><%= page.tag %></h1>
<h2 class="title-sub-wrap">当前标签下共有<%= length %>篇文章</h2>
</div>
Expand All @@ -64,24 +64,25 @@
<%# post banner %>
<% if (is_post()) { %>
<div class="header-content">
<div class="post-text">
<div class="type-wrap">
<%- partial("../_widget/category", { class_name: "article-category", post: page }) %>
<div class="post-text layout-block">
<div class="layout-margin">
<h1 class="title-wrap"><%= page.title %></h1>
<h2 class="title-sub-wrap">
<strong><%= page.author || config.author %></strong>
<span>发布于</span>
<%- partial("../_widget/date", { class_name: 'article-date', post: page, date_format: null }) %>
</h2>
<%- partial("../_widget/category", { page: page, class_name: 'dark' }) %>
<%- partial("../_widget/tag", { page: page, class_name: 'dark' }) %>
</div>
<h1 class="title-wrap"><%= page.title %></h1>
<h2 class="title-sub-wrap">
<strong><%= page.author || config.author %></strong>
<span>发布于</span>
<%- partial("../_widget/date", { class_name: 'article-date', post: page, date_format: null, link: false }) %>
</h2>
</div>
</div>
<% } %>

<%# page banner %>
<% if (is_page()) { %>
<div class="header-content">
<div class="post-text">
<div class="post-text layout-block layout-padding">
<h1 class="title-wrap"><%= page.title %></h1>
<% if (page.subtitle) { %>
<h2 class="title-sub-wrap"><%= page.subtitle %></h2>
Expand Down
Loading

0 comments on commit cfb3de7

Please sign in to comment.