给你的网站添加悦说页面

历史代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#saysay-box
- let saysay_background = page.top_background
.author-content.author-content-item.saysay.single(style=saysay_background ? `background: url(${saysay_background}) top / cover no-repeat` : "")
.card-content
.author-content-item-tips 每一瞬间的思想,都应该被捕获
span.author-content-item-title 悦说
.content-bottom
.tips 记录本身,即已是反抗!
.banner-button-group
a.banner-button(onclick='pjax.loadUrl("/about/")')
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
span.banner-button-text 我的更多
#saysay-main
each group, groupIndex in site.data.saysay.sayings
.group
h2= group.group
each item, itemIndex in group.items
.say-item
.header
img.avatar(src=item.avatar, alt='Avatar')
.nickname= item.nickname
.time= item.time
.content!= item.content
if item.image.length > 0 || item.video.length > 0
.media-grid
- let mediaItems = []
if item.image.length > 0
- mediaItems = mediaItems.concat(item.image)
if item.video.length > 0
- mediaItems = mediaItems.concat(item.video)
each media, mediaIndex in mediaItems
- let galleryId = `gallery-${groupIndex}-${itemIndex}`
if media.match(/\.(mp4|webm|ogg)$/i)
- let videoHtml = `<video controls style="width: 100%; height: 100%;"><source src="${media}" type="video/mp4">您的浏览器不支持视频播放。</video>`
a.media-item(
href='javascript:void(0);',
data-fancybox=galleryId,
data-caption=item.content,
data-type='html',
data-src=videoHtml
)
video(src=media, preload="metadata", muted, playsinline)
| 您的浏览器不支持视频播放。
else
a.media-item(
href='javascript:void(0);',
data-fancybox="gallery",
data-caption=item.content,
data-src=media
)
img(src=media, alt='Image')
1
2
3
4
5
6
a.media-item(
href=media,
target="_blank",
data-fancybox="gallery",
data-caption=item.content
)