@live-change/content-frontend 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -58,75 +58,77 @@
|
|
|
58
58
|
const canonicalUrl = `https://${canonicalUrlDomain}/${canonical.value?.path ?? ''}`
|
|
59
59
|
|
|
60
60
|
let ogImage = []
|
|
61
|
-
if(m
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
if(m) {
|
|
62
|
+
if (m.ogImage) {
|
|
63
|
+
const image = m.ogImage
|
|
64
|
+
ogImage = [
|
|
65
|
+
{property: 'og:image', content: `https://${canonicalUrlDomain}/api/image/image/${image.id}`},
|
|
66
|
+
{property: 'og:image:width', content: image.width},
|
|
67
|
+
{property: 'og:image:height', content: image.height},
|
|
68
|
+
{property: 'og:image:type', content: 'image/' + image.extension}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
72
|
+
useMeta({
|
|
73
|
+
title: m.title,
|
|
74
|
+
description: m.description,
|
|
75
|
+
link: [
|
|
76
|
+
{rel: 'canonical', href: canonicalUrl}
|
|
77
|
+
],
|
|
78
|
+
meta: [
|
|
79
|
+
metaProperty('og:title', m.og.title),
|
|
80
|
+
metaProperty('og:description', m.og.description),
|
|
81
|
+
...ogImage,
|
|
82
|
+
metaProperty('og:determiner', m.og.determiner),
|
|
83
|
+
metaProperty('og:locale', m.og.locale),
|
|
84
|
+
...metaProperties('og:locale:alternate', m.og.localeAlternate),
|
|
85
|
+
metaProperty('og:type', m.og.type),
|
|
86
|
+
|
|
87
|
+
metaProperty('og:music:duration', m.og.music.duration),
|
|
88
|
+
...metaPropertiesObjects('og:music:album', m.og.music.album),
|
|
89
|
+
...metaPropertiesObjects('og:music:song', m.og.music.song),
|
|
90
|
+
...metaProperties('og:music:musician', m.og.music.duration),
|
|
91
|
+
metaProperty('og:music:release_date', m.og.music.releaseDate),
|
|
92
|
+
...metaProperties('og:music:creator', m.og.music.creator),
|
|
93
|
+
|
|
94
|
+
metaProperty('og:video:duration', m.og.video.duration),
|
|
95
|
+
metaProperty('og:viceo:release_date', m.og.video.releaseDate),
|
|
96
|
+
...metaPropertiesObjects('og:video:duration', m.og.video.actors),
|
|
97
|
+
...metaProperties('og:video:director', m.og.video.director),
|
|
98
|
+
...metaProperties('og:video:writer', m.og.video.writer),
|
|
99
|
+
...metaProperties('og:video:series', m.og.video.series),
|
|
100
|
+
...metaProperties('og:video:tag', m.og.video.tag),
|
|
101
|
+
|
|
102
|
+
...metaProperties('og:profile:first_name', m.og.profile.firstName),
|
|
103
|
+
...metaProperties('og:profile:last_name', m.og.profile.lastName),
|
|
104
|
+
...metaProperties('og:profile:username', m.og.profile.username),
|
|
105
|
+
...metaProperties('og:profile:gender', m.og.profile.gender),
|
|
106
|
+
|
|
107
|
+
metaProperty('og:article:published_time', m.og.article.publishedTime),
|
|
108
|
+
metaProperty('og:article:modified_time', m.og.article.modifiedTime),
|
|
109
|
+
metaProperty('og:article:expiration_time', m.og.article.expirationTime),
|
|
110
|
+
...metaProperties('og:article:author', m.og.article.author),
|
|
111
|
+
metaProperty('og:article:section', m.og.article.section),
|
|
112
|
+
...metaProperties('og:article:tag', m.og.article.tag),
|
|
113
|
+
|
|
114
|
+
...metaProperties('og:book:author', m.og.book.author),
|
|
115
|
+
metaProperty('og:book:isbn', m.og.book.isbn),
|
|
116
|
+
metaProperty('og:book:release_date', m.og.book.releaseDate),
|
|
117
|
+
...metaProperties('og:book:tag', m.og.book.tag),
|
|
118
|
+
|
|
119
|
+
{property: 'og:url', content: canonicalUrl},
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
/* { property: 'og:url', content: m.url },
|
|
123
|
+
{ property: 'og:type', content: 'website' },
|
|
124
|
+
{ property: 'twitter:card', content: 'summary_large_image' },
|
|
125
|
+
{ property: 'twitter:title', content: metadata.value.title },
|
|
126
|
+
{ property: 'twitter:description', content: metadata.value.description },
|
|
127
|
+
{ property: 'twitter:image', content: metadata.value.image },
|
|
128
|
+
{ property: 'twitter:url', content: metadata.value.url }*/
|
|
129
|
+
].filter(x => !!x)
|
|
130
|
+
})
|
|
131
|
+
}
|
|
130
132
|
</script>
|
|
131
133
|
|
|
132
134
|
<style scoped>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="absolute top-0 right-0 pr-4 max-h-0 flex align-items-center z-5">
|
|
3
|
+
<router-link :to="{ name: 'content:pageEditor', params: { pageId: target } }" class="no-underline">
|
|
4
|
+
<Button icon="pi pi-pencil"
|
|
5
|
+
class="p-button p-button-icon-only p-button-rounded p-button-warning mr-2" />
|
|
6
|
+
</router-link>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import Button from 'primevue/button'
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
path: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
target: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
import { toRefs } from "@vueuse/core"
|
|
25
|
+
|
|
26
|
+
const { target } = toRefs(props)
|
|
27
|
+
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
|
|
32
|
+
</style>
|
|
@@ -5,12 +5,17 @@
|
|
|
5
5
|
<LimitedAccess :requiredRoles="['writer']" objectType="content_Page" :object="target" hidden>
|
|
6
6
|
<PageAdminButtons :page="target" :style="style" :class="clazz" :name="urlPath.value" />
|
|
7
7
|
</LimitedAccess>
|
|
8
|
-
<Content objectType="content_Page" :object="target" />
|
|
8
|
+
<Content objectType="content_Page" :object="target" class="w-full" />
|
|
9
9
|
</template>
|
|
10
10
|
<template #notFound="{ path, style, class: clazz }">
|
|
11
11
|
<NotFoundAdminButtons v-if="canCreatePage" :path="urlPath" :style="style" :class="clazz" />
|
|
12
12
|
<NotFound :style="style" :class="clazz" />
|
|
13
13
|
</template>
|
|
14
|
+
<template #notAuthorized="{ path, style, class: clazz, target, access }">
|
|
15
|
+
<NotAuthorizedAdminButtons v-if="(access?.roles ?? []).includes('writer')"
|
|
16
|
+
:path="urlPath" :style="style" :class="clazz" :target="target" />
|
|
17
|
+
<NotAuthorized :style="style" :class="clazz" />
|
|
18
|
+
</template>
|
|
14
19
|
</ResolveUrl>
|
|
15
20
|
</template>
|
|
16
21
|
|
|
@@ -18,8 +23,9 @@
|
|
|
18
23
|
import Button from "primevue/button"
|
|
19
24
|
import PageAdminButtons from "./PageAdminButtons.vue"
|
|
20
25
|
import NotFoundAdminButtons from "./NotFoundAdminButtons.vue"
|
|
26
|
+
import NotAuthorizedAdminButtons from "./NotAuthorizedAdminButtons.vue"
|
|
21
27
|
|
|
22
|
-
import { ResolveUrl, NotFound } from "@live-change/url-frontend"
|
|
28
|
+
import { ResolveUrl, NotFound, NotAuthorized } from "@live-change/url-frontend"
|
|
23
29
|
import { LimitedAccess } from "@live-change/access-control-frontend";
|
|
24
30
|
import Content from "./Content.vue"
|
|
25
31
|
import Metadata from "./Metadata.vue"
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
:config="contentConfig" type="page" v-model:saveState="saveState" v-model:version="version">
|
|
27
27
|
<template #menuEnd="{}">
|
|
28
28
|
|
|
29
|
-
<
|
|
29
|
+
<router-link :to="{name: 'content:pagePreview', params: { page: pageId }}" target="_blank"
|
|
30
|
+
class="no-underline">
|
|
31
|
+
<Button icon="pi pi-eye" label="Preview" class="p-button-secondary p-button-sm mr-1 mb-1" />
|
|
32
|
+
</router-link>
|
|
30
33
|
|
|
31
34
|
<div class="p-buttonset mr-1 mb-1 border-round">
|
|
32
35
|
<button type="button"
|
|
@@ -129,7 +132,7 @@
|
|
|
129
132
|
acceptClass: 'p-button-danger',
|
|
130
133
|
accept: async () => {
|
|
131
134
|
api.actions.content.publish({
|
|
132
|
-
objectType: 'content_Page', object: pageId.value, version: snapshotVersion, type: '
|
|
135
|
+
objectType: 'content_Page', object: pageId.value, version: snapshotVersion, type: 'page'
|
|
133
136
|
}).then(() => {
|
|
134
137
|
toast.add({ severity: 'success', summary: 'Published', detail: 'Page published', life: 3000 })
|
|
135
138
|
}).catch(e => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/content-frontend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "lcli memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"author": "",
|
|
64
64
|
"license": "ISC",
|
|
65
65
|
"description": "",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "6faf9721eb991a0d08289aa9a7914479afb893fb"
|
|
67
67
|
}
|