Merge pull request #220 from ipfs/feat/outboundLink

This commit is contained in:
Jessica Schilling
2021-05-27 07:21:09 -06:00
committed by GitHub
2 changed files with 15 additions and 2 deletions
@@ -12,7 +12,7 @@
</div>
<UnstyledLink v-if="!onclick" :to="postPath" :title="title">
<h1 class="type-h5 text-xl text-primary hover:underline clamp-3">
{{ title }}
<PostMetaTitle :title="title" :is-external="isExternal" />
</h1>
</UnstyledLink>
<a
@@ -24,7 +24,7 @@
@click="onclick"
>
<h1 class="type-h5 text-xl text-primary hover:underline clamp-3">
{{ title }}
<PostMetaTitle :title="title" :is-external="isExternal" />
</h1>
</a>
<PostAuthor v-if="author" :author="author" />
@@ -50,9 +50,11 @@
<script>
import dayjs from 'dayjs'
import { isExternal } from '@theme/util'
import utc from 'dayjs/plugin/utc'
import PostTag from '@theme/components/blog/PostTag'
import PostAuthor from '@theme/components/blog/PostAuthor'
import PostMetaTitle from '@theme/components/blog/PostMetaTitle'
import UnstyledLink from '@theme/components/UnstyledLink'
import countly from '../../util/countly'
@@ -62,6 +64,7 @@ export default {
PostTag,
PostAuthor,
UnstyledLink,
PostMetaTitle,
},
props: {
tags: {
@@ -104,6 +107,9 @@ export default {
.utc(this.date)
.format(this.$themeLocaleConfig.dateFormat || 'YYYY-MM-DD')
},
isExternal() {
return isExternal(this.postPath)
},
},
methods: {
handleCatClick() {
@@ -0,0 +1,7 @@
<template functional>
<span v-if="props.isExternal"
><span class="mr-4">{{ props.title }}</span
><OutboundLink class="-ml-4 pl-1" />
</span>
<span v-else>{{ props.title }}</span>
</template>