Skip to content

Commit 37e5214

Browse files
author
reco_luan
authored
Merge pull request #119 from vuepress-reco/feature/reco
Feature/reco
2 parents b2f4208 + dca6b3d commit 37e5214

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

components/FriendLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default {
9393
const { logo, email } = info
9494
if (logo && /^http/.test(logo)) return logo
9595
if (logo && !/^http/.test(logo)) return this.$withBase(logo)
96-
return `http://1.gravatar.com/avatar/${this.getMd5(email || '')}?s=50&d=mm&r=x`
96+
return `//1.gravatar.com/avatar/${this.getMd5(email || '')}?s=50&d=mm&r=x`
9797
},
9898
_adjustPosition (dom) {
9999
const { offsetWidth } = document.body

example/docs/views/other/guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: vuepress-theme-reco
33
date: 2019-04-09
44
categories:
55
- other
6+
- test
67
keys:
78
- '123'
89
---

helpers/postData.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ import { compareDate } from '@theme/helpers/utils'
22

33
// 过滤博客数据
44
export function filterPosts (posts, isTimeline) {
5-
posts = posts.filter(item => {
5+
posts = posts.filter((item, index) => {
66
const { title, frontmatter: { home, date, publish }} = item
7-
return isTimeline === true
8-
? !(home == true || title == undefined || date === undefined || publish === false)
9-
: !(home == true || title == undefined || publish === false)
7+
// 过滤多个分类时产生的重复数据
8+
if (posts.indexOf(item) !== index) {
9+
return false
10+
} else {
11+
return isTimeline === true
12+
? !(home == true || title == undefined || date === undefined || publish === false)
13+
: !(home == true || title == undefined || publish === false)
14+
}
1015
})
1116
return posts
1217
}

0 commit comments

Comments
 (0)