Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit f143b69

Browse files
Merge branch 'release/0.11.0'
2 parents 221b524 + ce5bfad commit f143b69

File tree

6 files changed

+61
-6
lines changed

6 files changed

+61
-6
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.11.0 (March 30, 2016)
4+
5+
### Added
6+
- Added OpenGraph
7+
8+
### Fixed
9+
- Fixed RSS feed links
10+
311
## 0.10.2 (February 24, 2016)
412

513
### Added

app/components/post-meta.vue

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<template>
2+
3+
<div class="uk-form-horizontal">
4+
5+
<div class="uk-form-row">
6+
<label for="form-meta-title" class="uk-form-label">{{ 'Title' | trans }}</label>
7+
<div class="uk-form-controls">
8+
<input id="form-meta-title" 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-meta-description" class="uk-form-label">{{ 'Description' | trans }}</label>
14+
<div class="uk-form-controls">
15+
<textarea id="form-meta-description" 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>

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pagekit/blog",
33
"type": "pagekit-extension",
4-
"version": "0.10.2",
4+
"version": "0.11.0",
55
"title": "Blog",
66
"description": "A blog extensions with a built-in comment system.",
77
"license": "MIT",

index.php

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163

164164
'view.scripts' => function ($event, $scripts) {
165165
$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');
166167
}
167168

168169
]

src/Controller/SiteController.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,18 @@ public function feedAction($type = '')
8585
$site = App::module('system/site');
8686
$feed = App::feed()->create($type ?: $this->blog->config('feed.type'), [
8787
'title' => $site->config('title'),
88-
'link' => App::url('@blog', [], true),
88+
'link' => App::url('@blog', [], 0),
8989
'description' => $site->config('description'),
9090
'element' => ['language', $locale],
91-
'selfLink' => App::url('@blog/feed', [], true)
91+
'selfLink' => App::url('@blog/feed', [], 0)
9292
]);
9393

9494
if ($last = Post::where(['status = ?', 'date < ?'], [Post::STATUS_PUBLISHED, new \DateTime])->limit(1)->orderBy('modified', 'DESC')->first()) {
9595
$feed->setDate($last->modified);
9696
}
9797

9898
foreach (Post::where(['status = ?', 'date < ?'], [Post::STATUS_PUBLISHED, new \DateTime])->related('user')->limit($this->blog->config('feed.limit'))->orderBy('date', 'DESC')->get() as $post) {
99-
$url = App::url('@blog/id', ['id' => $post->id], true);
99+
$url = App::url('@blog/id', ['id' => $post->id], 0);
100100
$feed->addItem(
101101
$feed->createItem([
102102
'title' => $post->title,
@@ -133,7 +133,14 @@ public function postAction($id = 0)
133133
return [
134134
'$view' => [
135135
'title' => __($post->title),
136-
'name' => 'blog/post.php'
136+
'name' => 'blog/post.php',
137+
'og:type' => 'article',
138+
'article:published_time' => $post->date->format(\DateTime::ATOM),
139+
'article:modified_time' => $post->modified->format(\DateTime::ATOM),
140+
'article:author' => $post->user->name,
141+
'og:title' => $post->get('meta.og:title') ?: $post->title,
142+
'og:description' => $post->get('meta.og:description') ?: $post->excerpt,
143+
'og:image' => $post->get('image.src') ? App::url()->getStatic($post->get('image.src'), [], 0) : false
137144
],
138145
'$comments' => [
139146
'config' => [

webpack.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module.exports = [
99
"comments": "./app/views/comments",
1010
"post": "./app/views/post",
1111
"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"
1314
},
1415
output: {
1516
filename: "./app/bundle/[name].js"

0 commit comments

Comments
 (0)