照片墙

This commit is contained in:
结发受长生 2019-05-08 22:56:39 +08:00
parent f78712c611
commit f64ec5dc6d
19 changed files with 124 additions and 55 deletions

View File

@ -11,7 +11,7 @@ title: Silence
subtitle: 世上有条唯一的路,除了你无人能走
description:
keywords:
author: 柠烟夏季
author: 夏夜梦星辰
language: zh-CN
timezone:
@ -82,14 +82,14 @@ theme: yilia
# 图片存储仓库地址
picture_cdn: https://blog-cdn.nos-eastchina1.126.net
### 站点地图
# 站点地图
sitemap:
path: sitemap.xml
template: ./sitemap_template.xml
baidusitemap:
path: baidusitemap.xml
# 内容索引json
jsonContent:
meta: false
pages: false

View File

@ -1,7 +0,0 @@
---
title: 实验室
date: 2018-5-24 10:05:28
pageid: lab
---
这里是内容
[测试超链接](https://www.baidu.com)

View File

@ -0,0 +1,7 @@
---
title: 照片墙
date: 2018-5-24 10:05:28
pageid: PhotoWall
---
<div id="photo-wall"></div>

View File

@ -8,9 +8,9 @@ menu:
name: jenkins
url: /jenkins/
target: _blank
laboratory: # 实验室
name: laboratory
url: /lab/
photo_wall: # 照片墙
name: photo_wall
url: /photo_wall/
# SubNav
subnav:
@ -35,9 +35,6 @@ rss: /atom.xml
# Content
# 是否在新窗口打开链接
open_in_new: false
# 打赏
# 打赏type设定0-关闭打赏; 1-文章对应的md文件里有reward:true属性才有打赏 2-所有文章均有打赏
reward_type: 1

View File

@ -1,3 +1,5 @@
# 英语(默认)
categories: Categories
category: Category
search: Search
@ -15,7 +17,7 @@ share: Share
show_full_text: Show Full Text
home: Homepage
informal_essay: Informal Essay
laboratory: Laboratory
photo_wall: Photo Wall
netdisc: Netdisc
all_articles: All Articles
about_me: About Me

View File

@ -1,3 +1,5 @@
# 法语
categories: Catégories
category: Catégorie
search: Rechercher
@ -15,7 +17,7 @@ share: Partager
show_full_text: Voir le texte intégral de la
home: Homepage
informal_essay: Essais
laboratory: Laboratoires
photo_wall: Mur de photo
netdisc: Disque réseau
all_articles: Tous les articles
about_me: À propos de moi

View File

@ -1,3 +1,5 @@
# 日语
categories: カテゴリー
category: カテゴリー
search: 検索
@ -15,7 +17,7 @@ share: シェア
show_full_text: 記事全体を見る
home: ホーム
informal_essay: エッセイ
laboratory: 研究室
photo_wall: フォトウォール
netdisc: ネットワークディスク
all_articles: すべての記事
about_me: 私について

View File

@ -1,3 +1,5 @@
# 俄语
categories: Категории
category: Категория
search: Поиск
@ -15,7 +17,7 @@ share: Поделиться
show_full_text: просмотреть полный текст
home: дома
informal_essay: эссе
laboratory: лаборатория
photo_wall: Фото стена
netdisc: Сетевой диск
all_articles: Все статьи
about_me: Обо мне

View File

@ -1,3 +1,5 @@
# 中文简体
categories: 分类
category: 分类
search: 搜索
@ -15,7 +17,7 @@ share: 分享
show_full_text: 查看全文
home: 主页
informal_essay: 随笔
laboratory: 实验室
photo_wall: 照片墙
netdisc: 网盘
all_articles: 所有文章
about_me: 关于我

View File

@ -1,3 +1,5 @@
# 中文繁体
categories: 分類
category: 分類
search: 搜尋
@ -15,7 +17,7 @@ share: 分享
show_full_text: 查看全文
home: 主頁
informal_essay: 隨筆
laboratory: 實驗室
photo_wall: 照片墻
netdisc: 網盤
all_articles: 所有文章
about_me: 關於我

View File

@ -1,14 +1,13 @@
<script>
window.yiliaConfig = {
isHome: <%=is_home()%>,
isPost: <%=is_post()%>,
isArchive: <%=is_archive()%>,
isTag: <%=is_tag()%>,
isCategory: <%=is_category()%>,
open_in_new: <%=theme.open_in_new%>,
toc_hide_index: <%=theme.toc_hide_index%>,
root: "<%=config.root%>",
showTags: <%=(theme.slider && theme.slider.showTags) ? true : false%>
isHome: <%=is_home()%>, // 是否为首页
isPost: <%=is_post()%>, // 是否为文章全文页面
isArchive: <%=is_archive()%>, // 是否为归档页面
isTag: <%=is_tag()%>, // 是否为标签页面
isCategory: <%=is_category()%>, // 是否为分类页面
pageid: <%-page.pageid ? `"${page.pageid}"` : 'undefined'%>, // 页面标识, 用于个性化页面开发
toc_hide_index: <%=theme.toc_hide_index%>, // 目录序号
root: "<%=config.root%>" // 资源根路径
}
</script>
<%- partial('script') %>
@ -18,13 +17,13 @@ window.yiliaConfig = {
<script>
(function(Gitalk){
new Gitalk({
clientID: '<%=theme.gitalk.ClientID%>',
clientSecret: '<%=theme.gitalk.ClientSecret%>',
repo: '<%=theme.gitalk.repo%>',
owner: '<%=theme.gitalk.githubID%>',
admin: ['<%=theme.gitalk.adminUser%>'],
id: decodeURI(location.pathname),
distractionFreeMode: <%=theme.gitalk.distractionFreeMode%>
clientID: '<%=theme.gitalk.ClientID%>',
clientSecret: '<%=theme.gitalk.ClientSecret%>',
repo: '<%=theme.gitalk.repo%>',
owner: '<%=theme.gitalk.githubID%>',
admin: ['<%=theme.gitalk.adminUser%>'],
id: decodeURI(location.pathname),
distractionFreeMode: <%=theme.gitalk.distractionFreeMode%>
}).render('comments')
})(Gitalk)
</script>

View File

@ -13,13 +13,14 @@
<% if (post.excerpt && index){ %>
<%- post.excerpt %>
<% } else { %>
<% if (!page.pageid){ %>
<div class="post-count">
<div class="count-item">总字数 <span><%= wordcount(post.content) %></span></div> |
<div class="count-item">预计阅读时间 <span><%= min2read(post.content) %></span> 分钟</div>
</div>
<% } %>
<%- post.content %>
<% } %>
<% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !index){ %>
<div class="page-reward">
<a href="javascript:;" class="page-reward-btn tooltip-top">

View File

@ -0,0 +1,30 @@
[
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00001.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00002.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00003.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00004.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00005.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00006.png"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00007.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00001.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00002.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00003.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00004.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00005.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00006.png"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00007.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00001.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00002.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00003.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00004.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00005.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00006.png"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00007.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00001.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00002.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00003.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00004.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00005.jpg"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00006.png"},
{"url":"https://blog-cdn.nos-eastchina1.126.net/photo-wall/pic00007.jpg"}
]

View File

@ -19,6 +19,7 @@
@import "./footer";
@import "./waifu";
@import "./night";
@import "./page/photo-wall";
@media screen and (max-width: 800px) {
@import "./mobile";
@import "./mobile-slider";

View File

@ -0,0 +1,21 @@
/*
* 照片墙页面专用css
*/
// 瀑布流最外层
#photo-wall {
margin: 0 auto;
column-count: auto;
column-width: 240px;
column-gap: 20px;
// 每一列图片包含层
.item {
margin-bottom: 20px;
// 防止多列布局分页媒体和多区域上下文中的意外中断
break-inside: avoid;
}
// 图片
.item-img {
width: 100%;
vertical-align: middle;
}
}

View File

@ -8,21 +8,11 @@ function init() {
$nav.innerHTML = $nav.innerHTML + '<a class="extend next disabled" rel="next">Next &raquo;</a>'
}
// 新窗口打开
if (yiliaConfig && yiliaConfig.open_in_new) {
let $a = document.querySelectorAll(('.article-entry a:not(.article-more-a)'))
$a.forEach(($em) => {
let target = $em.getAttribute('target');
if (!target || target === '') {
$em.setAttribute('target', '_blank');
}
})
}
// 目录序号
if (yiliaConfig && yiliaConfig.toc_hide_index) {
let $a = document.querySelectorAll(('.toc-number'))
let $a = document.querySelectorAll('.toc-number')
Array.prototype.forEach.call($a, function($em){
$em.style.display = 'none';
$em.style.display = 'none'
})
}
}

View File

@ -16,6 +16,11 @@ Util.addLoadEvent(function() {
})
const commentConfig = require("../config/comment.json")
if(window.yiliaConfig.isPost && commentConfig.valine.enable) {
// 如果是文章详情页面, 并且启用了评论, 则加载评论相关代码
// 文章详情页面, 并且启用了评论, 则加载评论相关代码
import(/* webpackChunkName: "comment" */ './comment')
}
if(window.yiliaConfig.pageid === 'PhotoWall') {
// 自定义的照片墙页面
import(/* webpackChunkName: "photo-wall" */ './photo-wall')
}

View File

@ -0,0 +1,13 @@
import photoWallJson from '../config/photo-wall.json'
var content = '<div class="itemContainer">'
photoWallJson.forEach(item => {
content += `
<div class="item">
<img class="item-img" src="${item.url}" alt=""/>
</div>
`
})
content += '</div>'
document.getElementById('photo-wall').innerHTML = content

View File

@ -36,6 +36,6 @@ function init() {
}
// export default { init }
Util.addLoadEvent(function() {
init()
})
if(!window.yiliaConfig.pageid) { // 非个性化页面的普通文章
Util.addLoadEvent(init)
}