照片墙
This commit is contained in:
@@ -8,21 +8,11 @@ function init() {
|
||||
$nav.innerHTML = $nav.innerHTML + '<a class="extend next disabled" rel="next">Next »</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'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
@@ -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
|
||||
@@ -36,6 +36,6 @@ function init() {
|
||||
}
|
||||
|
||||
// export default { init }
|
||||
Util.addLoadEvent(function() {
|
||||
init()
|
||||
})
|
||||
if(!window.yiliaConfig.pageid) { // 非个性化页面的普通文章
|
||||
Util.addLoadEvent(init)
|
||||
}
|
||||
Reference in New Issue
Block a user