1
1
<template >
2
2
<Full >
3
3
<div
4
- class =" container z-10 mx-auto post-page"
4
+ class =" z-10 post-page"
5
5
itemscope
6
6
itemtype =" https://schema.org/Blog"
7
7
>
8
8
<article
9
9
itemscope
10
10
itemprop =" blogPost"
11
11
itemtype =" https://schema.org/BlogPosting"
12
- class =" px-6 pb-24 mt-6 mb-24 xl:px-4 "
12
+ class =" pb-24 mb-24"
13
13
>
14
14
<meta
15
15
itemprop =" mainEntityOfPage"
16
16
:content =" $themeConfig.url + post.path"
17
17
>
18
- <BackTo
19
- class =" py-2 -ml-4"
20
- :text =" `${$themeLocaleConfig.backToText} posts`"
21
- :to =" `${$localePath}posts/`"
22
- />
23
- <HeaderFullPage >
24
- <template v-slot :cardTitle >
25
- {{ $page.title }}
26
- </template >
27
-
28
- <template v-slot :cardFooter >
29
- <time
30
- :datetime =" post.date.datetime"
31
- itemprop =" datePublished"
32
- >
33
- {{ post.date.short }}
34
- </time >
35
- <span
36
- itemprop =" author"
37
- itemscope
38
- itemtype =" https://schema.org/Person"
39
- >
40
- <RouterLink
41
- v-if =" post.author"
42
- ref =" authors"
43
- rel =" author"
44
- itemprop =" url"
45
- :to =" { path: '/authors/', hash: post.author.username }"
46
- class =" relative flex hover:underline"
47
- style =" top : 6px ;"
48
- >
49
- <div class =" w-8 h-8 mr-2 overflow-hidden rounded-full" >
50
- <img
51
- :src =" post.author.avatar"
52
- :alt =" `Avatar ${post.author.name}`"
53
- class =" object-cover object-top w-full h-fl"
54
- >
55
- </div >
56
- <span class =" mt-1" >
57
- <span class =" sr-only" >Post by </span >
58
- <span itemprop =" name" >{{ post.author.name }}</span >
59
- </span >
60
- </RouterLink >
61
- </span >
62
- </template >
63
- </HeaderFullPage >
64
18
<meta
65
19
itemprop =" dateModified"
66
20
:content =" post.updated_at"
67
21
>
68
-
69
- <section
70
- v-show =" post.summary"
71
- class =" my-10 text-lg leading-9 post-page-summary sm:px-5 md:mx-auto lg:mx-0 max-char"
72
- role =" region"
73
- :aria-label =" $themeLocaleConfig.a11y.landmarks.post.summary"
22
+ <header
23
+ class =" w-full py-20 border-b border-solid bg-primary border-secondary"
24
+ aria-labelledby =" title-post"
74
25
>
75
- <span itemprop =" description" >
26
+ <div class =" container max-w-2xl mx-auto" >
27
+ <h1
28
+ id =" title-post"
29
+ class =" text-4xl font-bold"
30
+ >
31
+ {{ $page.title }}
32
+ </h1 >
33
+ <aside
34
+ role =" note"
35
+ class =" flex items-center mt-4 text-sm"
36
+ >
37
+ <!-- <span class="uppercase">3 min</span> -->
38
+ <div
39
+ itemprop =" author"
40
+ itemscope
41
+ itemtype =" https://schema.org/Person"
42
+ >
43
+ <RouterLink
44
+ v-if =" post.author"
45
+ ref =" authors"
46
+ rel =" author"
47
+ itemprop =" url"
48
+ :to =" { path: '/authors/', hash: post.author.username }"
49
+ class =" relative flex hover:underline"
50
+ style =" top : 2px ;"
51
+ >
52
+ <div class =" w-8 h-8 mr-2 overflow-hidden rounded-full" >
53
+ <img
54
+ :src =" post.author.avatar"
55
+ :alt =" `Avatar ${post.author.name}`"
56
+ class =" object-cover object-top w-full h-fl"
57
+ >
58
+ </div >
59
+ <span class =" mt-1" >
60
+ <span class =" sr-only" >Post by </span >
61
+ <span itemprop =" name" >{{ post.author.name }}</span >
62
+ </span >
63
+ </RouterLink >
64
+ </div >
65
+ <div class =" w-6 mx-4 border-b-2 border-solid rounded border-accent-primary" />
66
+ <time
67
+ :datetime =" post.date.datetime"
68
+ class =" uppercase"
69
+ itemprop =" datePublished"
70
+ >
71
+ {{ post.date.short }}
72
+ </time >
73
+ </aside >
74
+ </div >
75
+ </header >
76
+
77
+ <div class =" container max-w-2xl mx-auto" >
78
+ <p
79
+ v-show =" post.summary"
80
+ class =" mt-10 text-lg leading-9 post-page-summary"
81
+ itemprop =" description"
82
+ >
76
83
{{ post.summary }}
77
- </span >
78
- </section >
79
-
80
- <TableOfContents
81
- v-if =" $frontmatter.toc !== 0"
82
- :key =" $route.path"
83
- :title =" $themeLocaleConfig.toc.title"
84
- title-tag =" h2"
85
- class =" my-10 lg:hidden"
86
- />
87
-
88
- <hr v-show =" post.summary" >
89
-
90
- <section
91
- class =" flex justify-between"
92
- role =" region"
93
- aria-label =" Content post"
94
- >
95
- <div class =" w-full max-w-3xl lg:w-auto" >
96
- <Content
97
- itemprop =" articleBody"
98
- class =" sm:px-5 md:mx-auto lg:mx-0"
99
- />
84
+ </p >
85
+
86
+ <hr
87
+ v-show =" post.summary"
88
+ class =" my-10"
89
+ >
90
+
91
+ <TableOfContents
92
+ v-if =" $frontmatter.toc !== 0"
93
+ :key =" $route.path"
94
+ :title =" $themeLocaleConfig.toc.title"
95
+ title-tag =" h2"
96
+ class =" my-10"
97
+ />
98
+
99
+ <section
100
+ role =" region"
101
+ aria-label =" Content article"
102
+ >
103
+ <Content itemprop =" articleBody" />
100
104
101
105
<hr class =" my-16" >
102
106
105
109
:title =" post.title"
106
110
:summary =" post.summary"
107
111
horizontal
108
- class =" lg:hidden"
109
112
/>
110
113
111
- <hr class =" my-16 lg:hidden " >
114
+ <hr class =" my-16" >
112
115
113
116
<div class =" disqus-section" >
114
- <Disqus shortname = " vue-a11y-test " />
117
+ <Disqus v-bind = " disqus " />
115
118
</div >
116
119
117
120
<hr class =" my-16" >
118
121
119
122
<div class =" webmentions-section" >
120
123
<WebMentions />
121
124
</div >
122
- </div >
123
- <RightNavigation class =" mt-16 ml-16 lg:block post-page-toc" >
124
- <ShareLinks
125
- class =" mt-16"
126
- :path =" post.path"
127
- :title =" post.title"
128
- :summary =" post.summary"
129
- />
130
- </RightNavigation >
131
- </section >
125
+ </section >
126
+ </div >
132
127
</article >
133
128
</div >
134
129
</Full >
135
130
</template >
136
131
137
132
<script >
138
133
import { computed } from ' @vue/composition-api'
139
- import { Comment } from ' @vuepress/plugin-blog/lib/client/components'
140
134
import { Disqus } from ' vue-disqus'
141
135
142
- import BackTo from ' @/theme/components/BackTo'
143
- import HeaderFullPage from ' @/theme/components/HeaderFullPage'
144
- import RightNavigation from ' @/theme/components/RightNavigation'
145
136
import ShareLinks from ' @/theme/components/ShareLinks'
146
137
import TableOfContents from ' @/theme/components/TableOfContents'
147
138
import WebMentions from ' @/theme/components/WebMentions'
@@ -150,14 +141,10 @@ export default {
150
141
name: ' Post' ,
151
142
152
143
components: {
153
- BackTo,
154
144
Disqus,
155
- Comment ,
156
- HeaderFullPage,
157
145
ShareLinks,
158
146
WebMentions,
159
- TableOfContents,
160
- RightNavigation
147
+ TableOfContents
161
148
},
162
149
163
150
setup (_ , { root }) {
@@ -174,21 +161,19 @@ export default {
174
161
}
175
162
}))
176
163
164
+ const disqus = {
165
+ shortname: ' vue-a11y-test' ,
166
+ lazyConfig: {
167
+ root: null ,
168
+ rootMargin: ' 1000px' ,
169
+ threshold: 0.5
170
+ }
171
+ }
172
+
177
173
return {
178
- post
174
+ post,
175
+ disqus
179
176
}
180
177
}
181
178
}
182
179
</script >
183
-
184
- <style lang="scss">
185
- .post-page-content {
186
- max-width : 57rem
187
- }
188
-
189
- .post-page-toc {
190
- @screen xl {
191
- min-width : var (--toc-w-size );
192
- }
193
- }
194
- </style >
0 commit comments