Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大白技术控
yanglr2010
提交
ced54c94
Y
yanglr2010
项目概览
大白技术控
/
yanglr2010
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yanglr2010
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ced54c94
编写于
7月 26, 2019
作者:
EvanOne(文一)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: Show all content & show gallery in post list
refactor: Update
上级
4e9ed12f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
87 addition
and
74 deletion
+87
-74
layout/_components/gallery.pug
layout/_components/gallery.pug
+0
-3
layout/_components/recent-posts.pug
layout/_components/recent-posts.pug
+22
-15
layout/_mixins/gallery.pug
layout/_mixins/gallery.pug
+4
-0
layout/_mixins/post-header.pug
layout/_mixins/post-header.pug
+1
-1
layout/page.pug
layout/page.pug
+6
-4
layout/post.pug
layout/post.pug
+2
-1
source/css/_components/external-link.styl
source/css/_components/external-link.styl
+1
-1
source/css/_components/recent-posts.styl
source/css/_components/recent-posts.styl
+47
-41
source/css/_mixins/post-header.styl
source/css/_mixins/post-header.styl
+4
-8
未找到文件。
layout/_components/gallery.pug
已删除
100644 → 0
浏览文件 @
4e9ed12f
div.post-gallery(itemscope itemtype="http://schema.org/ImageGallery")
each photo in page.photos
img(src=url_for(photo) itemprop="contentUrl").post-g-img
layout/_components/recent-posts.pug
浏览文件 @
ced54c94
section#recent-posts
include ../_mixins/gallery.pug
- var postLists = theme.post_list.paginate.home ? page.posts : site.posts
- postLists.each(function (post) {
article.post-item
article
(class=`${post.link ? 'post-link' : ''}`)
.post-item
+postHeader(post)
if !post.link
if theme.post_list.cover_image.home && post.top_image
img(src=post.top_image)
if post.top
include ./sticky-top.pug
if post.top
include ./sticky-top.pug
if theme.post_list.cover_image.home && post.top_image
img(src=post.top_image)
if post.photos && post.photos.length
+gallery(post)
if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(post.content)
- var excerpt = content.substring(0, theme.auto_excerpt.length)
- content.length > theme.auto_excerpt.length ? excerpt += '......' : ''
div!= excerpt
else if post.excerpt
div.post-excerpt!= post.excerpt
else
div.post-excerpt!= post.content
if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(post.content)
- var excerpt = content.substring(0, theme.auto_excerpt.length)
- content.length > theme.auto_excerpt.length ? excerpt += '......' : ''
div!= excerpt
else
div.post-excerpt!= post.excerpt
if !post.link
div.post-btn
a(href=url_for(post.path))= _p("post.read_more") + " »"
- })
layout/_mixins/gallery.pug
0 → 100644
浏览文件 @
ced54c94
mixin gallery(post)
div.post-gallery(itemscope itemtype="http://schema.org/ImageGallery")
each photo in post.photos
img(src=url_for(photo) itemprop="contentUrl").post-g-img
layout/_mixins/post-header.pug
浏览文件 @
ced54c94
...
...
@@ -7,7 +7,7 @@ mixin postHeader(post)
a(href=url_for(post.link) target="_blank").post-title-wrapper
h1.post-title= post.title || post.link
else
a(href=url_for(post.
canonical_
path)).post-title-wrapper
a(href=url_for(post.path)).post-title-wrapper
h1.post-title= post.title || _p("post.untitled")
if !post.link
...
...
layout/page.pug
浏览文件 @
ced54c94
extends ./_common/layout.pug
block content
include ./_mixins/gallery.pug
if (page.title === "tags")
div.content.tag-cloud
if page.photos && page.photos.length
include ./_components/gallery.pug
+gallery(page)
div.tag-cloud-title= _p("page.tags") + " - "
span.tag-cloud-num= site.tags.length
...
...
@@ -16,7 +18,7 @@ block content
else if (page.title === "categories")
div.content.category
if page.photos && page.photos.length
include ./_components/gallery.pug
+gallery(page)
div.category-title= _p("page.categories") + " - "
span.category-num= site.categories.length
...
...
@@ -24,12 +26,12 @@ block content
else if (page.title === "about")
div.content.headings.code-highlight
if page.photos && page.photos.length
include ./_components/gallery.pug
+gallery(page)
!= page.content
else
div.content.headings.code-highlight
if page.photos && page.photos.length
include ./_components/gallery.pug
+gallery(page)
!= page.content
layout/post.pug
浏览文件 @
ced54c94
...
...
@@ -2,13 +2,14 @@ extends ./_common/layout.pug
block content
include ./_mixins/post-header.pug
include ./_mixins/gallery.pug
div.content.headings.code-highlight
+postHeader(page)
div.post-body
if page.photos && page.photos.length
include ./_components/gallery.pug
+gallery(page)
!= page.content
...
...
source/css/_components/external-link.styl
浏览文件 @
ced54c94
$external-link-icon-color = convert(hexo-config('external_link.icon.color') || '#aaa')
.external-link
margin: 0
1px 0 3px
margin: 0
.1em 0 .2em
font-size: .9em
color: $external-link-icon-color
source/css/_components/recent-posts.styl
浏览文件 @
ced54c94
#recent-posts
.post-header
margin-bottom: 1.5rem
.post-header
margin-bottom: 1.5rem
.post-excerpt
margin-bottom: 2em
.post-item
position: relative
margin: 0 0 1.5rem
border-radius: 5px
padding: 1.5rem 2rem
width: 100%
background-color: $white
& > :first-child,
.post-excerpt > :first-child
margin-top: 0
& > :last-child,
.post-excerpt > :last-child
margin-bottom: 0
.sticky-top
top: 1rem
.post-btn
display: flex
a
clearAStyle()
display: inline-block
margin: 0 auto
border-radius: 5px
padding: 0 .6em
text-align: center
color: $white
background-color: $home-post-read-more-color
transition: background-color .2s ease
cursor: pointer
.post-excerpt
margin-bottom: 2em
&:hover
background-color: $home-post-read-more-hover-color
.post-item
position: relative
margin: 0 0 1.5rem
border-radius: 5px
padding: 1.5rem 2rem
width: 100%
background-color: $white
& > :first-child,
.post-excerpt > :first-child
margin-top: 0
& > :last-child,
.post-excerpt > :last-child
margin-bottom: 0
.sticky-top
top: 1rem
.post-btn
display: flex
a
clearAStyle()
display: inline-block
margin: 0 auto
border-radius: 5px
padding: 0 .6em
text-align: center
color: $white
background-color: $home-post-read-more-color
transition: background-color .2s ease
cursor: pointer
&:hover
background-color: $home-post-read-more-hover-color
.post-link
.post-header
margin: 0 0 .5rem
.post-title-wrapper
margin: 0
source/css/_mixins/post-header.styl
浏览文件 @
ced54c94
...
...
@@ -5,7 +5,8 @@
.post-title-wrapper
display: inline-block
position: relative
border: 0
margin: 0 0 1rem
border-width: 0
word-wrap: break-word
color: $post-info-title-color
...
...
@@ -14,7 +15,7 @@
.post-title
display: inline-block
margin: 0
0 1rem
margin: 0
font-size: $font-post-title
cursor: auto
...
...
@@ -66,9 +67,4 @@
color: $post-info-reading-count-color
.external-link
font-size: .6em
#recent-posts
.post-header
margin-bottom: 2em
padding: 0
font-size: 1.5em
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录