@@ -3,7 +3,7 @@ import type { FictionPosts, Post } from '@fiction/posts'
3
3
import type { Card } from ' @fiction/site'
4
4
import type { UserConfig } from ' ./index.js'
5
5
import CardLink from ' @fiction/cards/el/CardLink.vue'
6
- import { unhead , useService , vue } from ' @fiction/core'
6
+ import { dayjs , unhead , useService , vue } from ' @fiction/core'
7
7
import { allPostsLink , postEditLink , postLink , taxonomyLink } from ' @fiction/posts'
8
8
import AnimClipPath from ' @fiction/ui/anim/AnimClipPath.vue'
9
9
import ElSpinner from ' @fiction/ui/loaders/ElSpinner.vue'
@@ -38,26 +38,26 @@ const imageAspect = vue.computed(() => {
38
38
39
39
return w > h ? ' aspect-square max-h-[70dvh]' : ' aspect-[2/1]'
40
40
})
41
- const title = () => post ?.userConfig .value ?.site ?.title || post ?.title .value || ' Post Not Found'
42
- const description = () => post ?.userConfig .value ?.site ?.description || post ?.subTitle .value || ' Post Not Found'
43
- const author = () => post ?.authors .value ?.map (a => a .fullName ).join (' , ' )
41
+ const getTitle = () => post ?.userConfig .value ?.site ?.title || post ?.title .value || ' Post Not Found'
42
+ const getDescription = () => post ?.userConfig .value ?.site ?.description || post ?.subTitle .value || ' Post Not Found'
43
+ const getAuthor = () => post ?.authors .value ?.map (a => a .fullName ).join (' , ' )
44
44
const postImage = () => post ?.media .value ?.url
45
45
const postDate = () => post ?.dateAt .value
46
46
const keywords = () => post ?.tags .value ?.join (' , ' )
47
47
unhead .useHead ({
48
- title ,
48
+ title: getTitle ,
49
49
meta: [
50
- { name: ` description ` , content: description },
51
- { name: ` author ` , content: author },
50
+ { name: ` description ` , content: getDescription },
51
+ { name: ` author ` , content: getAuthor },
52
52
{ name: ` keywords ` , content: keywords },
53
53
{ name: ` robots ` , content: ` index, follow ` },
54
- { name: ` og:title ` , content: title },
55
- { name: ` og:description ` , content: description },
54
+ { name: ` og:title ` , content: getTitle },
55
+ { name: ` og:description ` , content: getDescription },
56
56
{ name: ` og:type ` , content: ` article ` },
57
57
{ name: ` og:image ` , content: postImage },
58
58
{ name: ` og:locale ` , content: ` en_US ` },
59
59
{ name: ` article:published_time ` , content: postDate },
60
- { name: ` article:author ` , content: author },
60
+ { name: ` article:author ` , content: getAuthor },
61
61
],
62
62
})
63
63
</script >
@@ -72,38 +72,8 @@ unhead.useHead({
72
72
</div >
73
73
<article v-if =" post" >
74
74
<div class =" space-y-8 text-center max-w-screen-lg mx-auto mb-12" >
75
- <div class =" tags space-x-4" >
76
- <CardButton
77
- size =" sm"
78
- :card
79
- design =" link"
80
- :href =" allPostsLink({ card })"
81
- rounding =" full"
82
- icon =" i-tabler-arrow-left"
83
- >
84
- All Posts
85
- </CardButton >
86
- <CardButton
87
- v-for =" (cat, i) in post.categories.value"
88
- :key =" i"
89
- size =" sm"
90
- :card
91
- design =" outline"
92
- :text =" cat"
93
- :href =" taxonomyLink({ card, taxonomy: 'category', term: cat })"
94
- />
95
- <CardButton
96
- v-if =" userIsAuthor"
97
- size =" sm"
98
- :card
99
- :href =" postEditLink({ post })"
100
- class =" flex items-center"
101
- design =" outline"
102
- icon =" i-tabler-edit"
103
- theme =" green"
104
- >
105
- Edit Post
106
- </CardButton >
75
+ <div v-if =" post.publishAt.value" class =" tags space-x-4" >
76
+ {{ dayjs(post.dateAt.value || post.publishAt.value).format('MMMM D, YYYY') }}
107
77
</div >
108
78
<div class =" space-y-4" >
109
79
<CardTextPost
@@ -118,7 +88,7 @@ unhead.useHead({
118
88
path =" subTitle"
119
89
class =" text-lg md:text-2xl xl:text-3xl dark:text-theme-400 text-pretty"
120
90
/>
121
- <div class =" flex justify-center" >
91
+ <div class =" flex justify-center gap-3 " >
122
92
<ElAuthor v-for =" (author, i) in post.authors.value" :key =" i" :user =" author" :date-at =" post.dateAt.value" />
123
93
</div >
124
94
</div >
0 commit comments