照片墙

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: 世上有条唯一的路,除了你无人能走 subtitle: 世上有条唯一的路,除了你无人能走
description: description:
keywords: keywords:
author: 柠烟夏季 author: 夏夜梦星辰
language: zh-CN language: zh-CN
timezone: timezone:
@ -82,14 +82,14 @@ theme: yilia
# 图片存储仓库地址 # 图片存储仓库地址
picture_cdn: https://blog-cdn.nos-eastchina1.126.net picture_cdn: https://blog-cdn.nos-eastchina1.126.net
### 站点地图 # 站点地图
sitemap: sitemap:
path: sitemap.xml path: sitemap.xml
template: ./sitemap_template.xml template: ./sitemap_template.xml
baidusitemap: baidusitemap:
path: baidusitemap.xml path: baidusitemap.xml
# 内容索引json
jsonContent: jsonContent:
meta: false meta: false
pages: 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 name: jenkins
url: /jenkins/ url: /jenkins/
target: _blank target: _blank
laboratory: # 实验室 photo_wall: # 照片墙
name: laboratory name: photo_wall
url: /lab/ url: /photo_wall/
# SubNav # SubNav
subnav: subnav:
@ -35,9 +35,6 @@ rss: /atom.xml
# Content # Content
# 是否在新窗口打开链接
open_in_new: false
# 打赏 # 打赏
# 打赏type设定0-关闭打赏; 1-文章对应的md文件里有reward:true属性才有打赏 2-所有文章均有打赏 # 打赏type设定0-关闭打赏; 1-文章对应的md文件里有reward:true属性才有打赏 2-所有文章均有打赏
reward_type: 1 reward_type: 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,13 +13,14 @@
<% if (post.excerpt && index){ %> <% if (post.excerpt && index){ %>
<%- post.excerpt %> <%- post.excerpt %>
<% } else { %> <% } else { %>
<% if (!page.pageid){ %>
<div class="post-count"> <div class="post-count">
<div class="count-item">总字数 <span><%= wordcount(post.content) %></span></div> | <div class="count-item">总字数 <span><%= wordcount(post.content) %></span></div> |
<div class="count-item">预计阅读时间 <span><%= min2read(post.content) %></span> 分钟</div> <div class="count-item">预计阅读时间 <span><%= min2read(post.content) %></span> 分钟</div>
</div> </div>
<% } %>
<%- post.content %> <%- post.content %>
<% } %> <% } %>
<% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !index){ %> <% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !index){ %>
<div class="page-reward"> <div class="page-reward">
<a href="javascript:;" class="page-reward-btn tooltip-top"> <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 "./footer";
@import "./waifu"; @import "./waifu";
@import "./night"; @import "./night";
@import "./page/photo-wall";
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
@import "./mobile"; @import "./mobile";
@import "./mobile-slider"; @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>' $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) { 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){ 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") const commentConfig = require("../config/comment.json")
if(window.yiliaConfig.isPost && commentConfig.valine.enable) { if(window.yiliaConfig.isPost && commentConfig.valine.enable) {
// 如果是文章详情页面, 并且启用了评论, 则加载评论相关代码 // 文章详情页面, 并且启用了评论, 则加载评论相关代码
import(/* webpackChunkName: "comment" */ './comment') 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 } // export default { init }
Util.addLoadEvent(function() { if(!window.yiliaConfig.pageid) { // 非个性化页面的普通文章
init() Util.addLoadEvent(init)
}) }