|
16 | 16 | :image="articles[0].author.img"
|
17 | 17 | />
|
18 | 18 | <div class="relative lg:w-1/2 xs:w-full xs:h-84 lg:h-full post-left">
|
19 |
| - <amp-img |
| 19 | + <!-- <amp-img |
20 | 20 | v-if="$isAMP"
|
21 | 21 | :src="articles[0].author.img"
|
22 | 22 | :alt="articles[0].author.name"
|
|
30 | 30 | :src="articles[0].author.img"
|
31 | 31 | :alt="articles[0].author.name"
|
32 | 32 | class="absolute h-full w-full object-cover"
|
| 33 | + /> --> |
| 34 | + <img |
| 35 | + :src="articles[0].author.img" |
| 36 | + :alt="articles[0].author.name" |
| 37 | + class="absolute h-full w-full object-cover" |
33 | 38 | />
|
34 | 39 | </div>
|
35 | 40 |
|
36 | 41 | <div class="overlay"></div>
|
37 | 42 | <div class="absolute top-32 left-32 text-white">
|
38 | 43 | <div class="relative">
|
39 |
| - <NuxtLink to="/"><Logo :amp="$isAMP" /></NuxtLink> |
| 44 | + <!-- <NuxtLink to="/"><Logo :amp="$isAMP" /></NuxtLink> --> |
| 45 | + <NuxtLink to="/"><Logo /></NuxtLink> |
40 | 46 | </div>
|
41 | 47 | <div class="mt-16 -mb-3 flex flex-col uppercase text-sm">
|
42 | 48 | <h1 class="text-4xl font-bold">
|
|
114 | 120 |
|
115 | 121 | <script>
|
116 | 122 | export default {
|
117 |
| - async asyncData({ $content, params }) { |
118 |
| - const articles = await $content('articles', params.slug) |
119 |
| - .where({ |
120 |
| - 'author.name': { |
121 |
| - $regex: [params.author, 'i'] |
122 |
| - }, |
123 |
| - offLink: false |
124 |
| - }) |
125 |
| - .without('body') |
126 |
| - .sortBy('createdAt', 'asc') |
127 |
| - .fetch() |
128 |
| - return { |
129 |
| - articles |
| 123 | + async asyncData({ $content, params, error }) { |
| 124 | + try { |
| 125 | + const articles = await $content('articles') |
| 126 | + .where({ |
| 127 | + 'author.name': { |
| 128 | + $regex: [params.slug, 'i'] |
| 129 | + }, |
| 130 | + status: 'publish' |
| 131 | + }) |
| 132 | + .without('body') |
| 133 | + .sortBy('createdAt', 'asc') |
| 134 | + .fetch() |
| 135 | + return { |
| 136 | + articles |
| 137 | + } |
| 138 | + } catch (err) { |
| 139 | + error(err) |
130 | 140 | }
|
131 | 141 | }
|
132 | 142 | }
|
|
0 commit comments