This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
BREAKING CHANGE: Turn default frontmatter key to tags instead of tag/tags
- Loading branch information
1 parent
50abb08
commit a689ada
Showing
28 changed files
with
225 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<template> | ||
<div class="post-meta"> | ||
<div v-if="author" class="post-meta-author"> | ||
<NavigationIcon /> {{ author }} | ||
<span v-if="location"> in {{ location }}</span> | ||
</div> | ||
<div v-if="date" class="post-meta-date"> | ||
<ClockIcon /> {{ resolvedDate }} | ||
</div> | ||
<ul v-if="tags" class="post-meta-tags"> | ||
<PostTag v-for="tag in resolvedTags" :key="tag" :tag="tag" /> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import dayjs from 'dayjs' | ||
import { NavigationIcon, ClockIcon } from 'vue-feather-icons' | ||
import PostTag from './PostTag.vue' | ||
export default { | ||
name: 'PostMeta', | ||
components: { NavigationIcon, ClockIcon, PostTag }, | ||
props: { | ||
tags: { | ||
type: [Array, String], | ||
}, | ||
author: { | ||
type: String, | ||
}, | ||
date: { | ||
type: String, | ||
}, | ||
location: { | ||
type: String, | ||
}, | ||
}, | ||
computed: { | ||
resolvedDate() { | ||
return dayjs(this.date).format( | ||
this.$themeConfig.dateFormat || 'ddd MMM DD YYYY' | ||
) | ||
}, | ||
resolvedTags() { | ||
if (!this.tags || Array.isArray(this.tags)) return this.tags | ||
return [this.tags] | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="stylus"> | ||
.post-meta | ||
&-tags | ||
display flex | ||
flex-wrap wrap | ||
list-style none | ||
overflow hidden | ||
padding 0 | ||
margin 20px 0 | ||
> li | ||
margin-bottom 10px | ||
> div | ||
display inline-flex | ||
line-height 12px | ||
font-size 12px | ||
margin-right 20px | ||
svg | ||
margin-right 5px | ||
width 14px | ||
height 14px | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<template> | ||
<li class="post-tag"> | ||
<router-link :to="'/tag/' + tag"> {{ tag }} </router-link> | ||
</li> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'PostTag', | ||
props: { | ||
tag: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped lang="stylus"> | ||
.post-tag | ||
background-color $postTagBgColor | ||
border-radius 3px 0 0 3px | ||
height 26px | ||
padding 0 20px 0 23px | ||
position relative | ||
cursor pointer | ||
&:not(:last-child) | ||
margin-right 10px | ||
a | ||
color $postTagColor | ||
text-decoration none | ||
transition color 0.2s | ||
&:before | ||
position absolute | ||
left 10px | ||
top 10px | ||
background #fff | ||
border-radius 50% | ||
box-shadow inset 0 1px rgba(0, 0, 0, 0.25) | ||
content '' | ||
height 6px | ||
width 6px | ||
&:after | ||
position absolute | ||
right 0 | ||
top 0 | ||
background $bgColor | ||
border-bottom 13px solid transparent | ||
border-left 10px solid $postTagBgColor | ||
border-top 13px solid transparent | ||
content '' | ||
&:hover | ||
background-color $accentColor | ||
&:after | ||
border-left-color $accentColor | ||
a | ||
color #fff | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: frontmatter in vuepress 2 | ||
date: 2018-11-7 | ||
tag: | ||
tags: | ||
- frontmatter | ||
- vuepress | ||
author: ULIVZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: frontmatter in vuepress 3 | ||
date: 2018-11-7 | ||
tag: | ||
tags: | ||
- frontmatter | ||
- vuepress | ||
author: ULIVZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: frontmatter in vuepress 1 | ||
date: 2018-11-7 | ||
tag: | ||
tags: | ||
- frontmatter | ||
- vuepress | ||
author: ULIVZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Markdown Slot 2 | ||
date: 2019-2-26 | ||
tag: | ||
tags: | ||
- markdown | ||
- vuepress | ||
author: ULIVZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Markdown Slot 3 | ||
date: 2019-2-26 | ||
tag: | ||
tags: | ||
- markdown | ||
- vuepress | ||
author: ULIVZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Markdown Slot 4 | ||
date: 2019-2-26 | ||
tag: | ||
tags: | ||
- markdown | ||
- vuepress | ||
author: ULIVZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Markdown Slot 1 | ||
date: 2019-2-26 | ||
tag: | ||
tags: | ||
- markdown | ||
- vuepress | ||
author: ULIVZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: writing a vuepress theme 2 | ||
date: 2019-5-6 | ||
tag: | ||
tags: | ||
- theme | ||
- blog | ||
- vuepress | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: writing a vuepress theme 3 | ||
date: 2019-5-6 | ||
tag: | ||
tags: | ||
- theme | ||
- blog | ||
- vuepress | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: writing a vuepress theme 4 | ||
date: 2019-5-6 | ||
tag: | ||
tags: | ||
- theme | ||
- blog | ||
- vuepress | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Writing a vuepress theme 1 | ||
date: 2019-5-6 | ||
tag: | ||
tags: | ||
- theme | ||
- blog | ||
- vuepress | ||
|
Oops, something went wrong.