diff --git a/app/Http/Controllers/FeedsController.php b/app/Http/Controllers/FeedsController.php
index 5d0aa8d3..74e87be6 100644
--- a/app/Http/Controllers/FeedsController.php
+++ b/app/Http/Controllers/FeedsController.php
@@ -102,12 +102,18 @@ class FeedsController extends Controller
*/
public function notesJson(): array
{
- $notes = Note::latest()->with('media', 'place')->take(20)->get();
+ $notes = Note::latest()->with('media', 'place', 'tags')->take(20)->get();
$data = [
- 'version' => 'https://jsonfeed.org/version/1',
+ 'version' => 'https://jsonfeed.org/version/1.1',
'title' => 'The JSON Feed for ' . config('user.display_name') . '’s notes',
'home_page_url' => config('app.url') . '/notes',
'feed_url' => config('app.url') . '/notes/feed.json',
+ 'authors' => [
+ [
+ 'name' => config('user.display_name'),
+ 'url' => config('app.url'),
+ ],
+ ],
'items' => [],
];
@@ -115,13 +121,13 @@ class FeedsController extends Controller
$data['items'][$key] = [
'id' => $note->longurl,
'url' => $note->longurl,
- 'content_html' => $note->content,
+ 'content_text' => $note->content,
'date_published' => $note->created_at->tz('UTC')->toRfc3339String(),
'date_modified' => $note->updated_at->tz('UTC')->toRfc3339String(),
- 'author' => [
- 'name' => config('user.display_name'),
- ],
];
+ if ($note->tags->count() > 0) {
+ $data['items'][$key]['tags'] = implode(',', $note->tags->pluck('tag')->toArray());
+ }
}
return $data;
diff --git a/app/Models/Note.php b/app/Models/Note.php
index 39d0c5e1..f854b598 100644
--- a/app/Models/Note.php
+++ b/app/Models/Note.php
@@ -144,17 +144,17 @@ class Note extends Model
*/
public function getContentAttribute(): string
{
- $note = $this->note;
+ $note = $this->getRawOriginal('note');
foreach ($this->media as $media) {
if ($media->type === 'image') {
- $note .= '
';
+ $note .= PHP_EOL . '
';
}
if ($media->type === 'audio') {
- $note .= '