fix: post card title center when has cover, close #157

This commit is contained in:
YunYouJun 2023-01-17 00:53:45 +08:00
parent f7559fe1ac
commit b8e471770f
3 changed files with 11 additions and 3 deletions

View File

@ -1,15 +1,19 @@
<script lang="ts" setup>
import type { Post } from 'valaxy'
import { useLayout } from 'valaxy'
import YunPostMeta from 'valaxy-theme-yun/components/YunPostMeta.vue'
defineProps<{
frontmatter: Post
}>()
// Post
const isPost = useLayout('post')
</script>
<template>
<YunPostMeta :frontmatter="frontmatter">
<span id="busuanzi_container_page_pv">
<span v-if="isPost" id="busuanzi_container_page_pv">
本文总阅读量 <span id="busuanzi_value_page_pv" />
</span>
</YunPostMeta>

View File

@ -81,16 +81,20 @@ useScriptTag('//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
```vue
<script lang="ts" setup>
import type { Post } from 'valaxy'
import { useLayout } from 'valaxy'
import YunPostMeta from 'valaxy-theme-yun/components/YunPostMeta.vue'
defineProps<{
frontmatter: Post
}>()
// 仅在 Post 布局显示
const isPost = useLayout('post')
</script>
<template>
<YunPostMeta :frontmatter="frontmatter">
<span id="busuanzi_container_page_pv">
<span v-if="isPost" id="busuanzi_container_page_pv">
本文总阅读量 <span id="busuanzi_value_page_pv" />
</span>
</YunPostMeta>

View File

@ -31,7 +31,7 @@ const { icon, styles } = usePostProperty(props.post.type)
:to="post.path || ''"
m="t-3"
>
<div class="flex justify-center items-center title text-2xl" font="serif black">
<div class="flex justify-center items-center title text-2xl" text="center" font="serif black">
<div v-if="post.type" class="inline-flex" m="r-1" :class="icon" />{{ post.title }}
</div>
</AppLink>