This repository was archived by the owner on Dec 1, 2023. It is now read-only.
File tree 4 files changed +45
-2
lines changed
4 files changed +45
-2
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+
3
+ <div class =" uk-form-horizontal" >
4
+
5
+ <div class =" uk-form-row" >
6
+ <label for =" form-class" class =" uk-form-label" >{{ 'Title' | trans }}</label >
7
+ <div class =" uk-form-controls" >
8
+ <input id =" form-class" class =" uk-form-width-large" type =" text" v-model =" post.data.meta['og:title']" >
9
+ </div >
10
+ </div >
11
+
12
+ <div class =" uk-form-row" >
13
+ <label for =" form-class" class =" uk-form-label" >{{ 'Description' | trans }}</label >
14
+ <div class =" uk-form-controls" >
15
+ <textarea id =" form-class" class =" uk-form-width-large" rows =" 5" type =" text" v-model =" post.data.meta['og:description']" ></textarea >
16
+ </div >
17
+ </div >
18
+
19
+ </div >
20
+
21
+ </template >
22
+
23
+ <script >
24
+
25
+ module .exports = {
26
+
27
+ section: {
28
+ label: ' Meta' ,
29
+ priority: 100
30
+ },
31
+
32
+ props: [' post' ]
33
+
34
+ };
35
+
36
+ window .Post .components [' post-meta' ] = module .exports ;
37
+
38
+ </script >
Original file line number Diff line number Diff line change 163
163
164
164
'view.scripts ' => function ($ event , $ scripts ) {
165
165
$ scripts ->register ('link-blog ' , 'blog:app/bundle/link-blog.js ' , '~panel-link ' );
166
+ $ scripts ->register ('post-meta ' , 'blog:app/bundle/post-meta.js ' , '~post-edit ' );
166
167
}
167
168
168
169
]
Original file line number Diff line number Diff line change @@ -133,7 +133,10 @@ public function postAction($id = 0)
133
133
return [
134
134
'$view ' => [
135
135
'title ' => __ ($ post ->title ),
136
- 'name ' => 'blog/post.php '
136
+ 'name ' => 'blog/post.php ' ,
137
+ 'og:title ' => $ post ->get ('meta.og:title ' ) ?: $ post ->title ,
138
+ 'og:description ' => $ post ->get ('meta.og:description ' ) ?: $ post ->excerpt ,
139
+ 'og:image ' => $ post ->get ('image.src ' ) ? App::url ()->getStatic ($ post ->get ('image.src ' ), [], 0 ) : false
137
140
],
138
141
'$comments ' => [
139
142
'config ' => [
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ module.exports = [
9
9
"comments" : "./app/views/comments" ,
10
10
"post" : "./app/views/post" ,
11
11
"posts" : "./app/views/posts" ,
12
- "link-blog" : "./app/components/link-blog.vue"
12
+ "link-blog" : "./app/components/link-blog.vue" ,
13
+ "post-meta" : "./app/components/post-meta.vue"
13
14
} ,
14
15
output : {
15
16
filename : "./app/bundle/[name].js"
You can’t perform that action at this time.
0 commit comments