-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathligne-editoriale.vue
52 lines (50 loc) · 1.32 KB
/
ligne-editoriale.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<div class="pages__ligne-editoriale--parent">
<div class="document document--item z-30">
<div class="title page-title mb-4 font-serif text-2xl italic">
<h1>{{ content.title }}</h1>
</div>
<div class="body">
<nuxt-content :document="content" />
</div>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import type {
INuxtContentResult,
/* */
} from '~/lib'
import {
createVueMetaInfo,
/* */
} from '~/lib'
export interface Data {
content: INuxtContentResult
}
export interface Methods {}
export interface Computed {}
export interface Props {}
export default Vue.extend<Data, Methods, Computed, Props>({
async asyncData({ $content, error }) {
const pageKey = 'page-editorial-guideline'
const locale = 'fr-CA'
const ds = $content('')
const contents = (await ds
.where({ pageKey: { $contains: pageKey }, locale: { $eq: locale } })
.fetch()) as INuxtContentResult[]
if (contents.length !== 1) {
error({ message: 'Document not found' })
}
const content = contents[0]
return {
content,
}
},
head() {
const out = createVueMetaInfo(this.content)
return out
},
})
</script>