feat: Add webmention counts and icons for replies, likes, and reposts.
- Add new SVG icons for the "reply", "like", and "repost" actions - Update webmention info display in note template to include counts and icons for replies, likes, and reposts - Add webmention counts to FrontPageController.php and modify queries in NotesController.php - Modify WebMentionsTableSeeder.php to change URLs, commentable ID, and add new WebMentions
This commit is contained in:
parent
5bc03f36d2
commit
92098a793e
15 changed files with 179 additions and 35 deletions
|
@ -145,7 +145,7 @@ class NotesTableSeeder extends Seeder
|
|||
|
||||
$now = Carbon::now()->subHours(6);
|
||||
$noteWithTextLinkandEmoji = Note::create([
|
||||
'note' => 'I love https://duckduckgo.com 💕', // there’s a two-heart emoji at the end of this
|
||||
'note' => 'I love https://kagi.com 💕', // there’s a two-heart emoji at the end of this
|
||||
'created_at' => $now,
|
||||
]);
|
||||
DB::table('notes')
|
||||
|
|
|
@ -14,23 +14,32 @@ class WebMentionsTableSeeder extends Seeder
|
|||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// WebMention Aaron
|
||||
// WebMention reply Aaron
|
||||
WebMention::create([
|
||||
'source' => 'https://aaronpk.localhost/reply/1',
|
||||
'target' => config('app.url') . '/notes/E',
|
||||
'commentable_id' => '14',
|
||||
'target' => config('app.url') . '/notes/Z',
|
||||
'commentable_id' => '5',
|
||||
'commentable_type' => 'App\Models\Note',
|
||||
'type' => 'in-reply-to',
|
||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://aaronpk.localhost/reply/1"], "name": ["Hi too"], "author": [{"type": ["h-card"], "value": "Aaron Parecki", "properties": {"url": ["https://aaronpk.localhost"], "name": ["Aaron Parecki"], "photo": ["https://aaronparecki.com/images/profile.jpg"]}}], "content": [{"html": "Hi too", "value": "Hi too"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["https://aaronpk.loclahost/reply/1", "' . config('app.url') .'/notes/E"]}}]}',
|
||||
]);
|
||||
// WebMention Tantek
|
||||
// WebMention like Tantek
|
||||
WebMention::create([
|
||||
'source' => 'http://tantek.com/',
|
||||
'target' => config('app.url') . '/notes/D',
|
||||
'commentable_id' => '13',
|
||||
'source' => 'https://tantek.com/likes/1',
|
||||
'target' => config('app.url') . '/notes/G',
|
||||
'commentable_id' => '16',
|
||||
'commentable_type' => 'App\Models\Note',
|
||||
'type' => 'in-reply-to',
|
||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["http://tantek.com/"], "name": ["KUTGW"], "author": [{"type": ["h-card"], "value": "Tantek Celik", "properties": {"url": ["http://tantek.com/"], "name": ["Tantek Celik"]}}], "content": [{"html": "kutgw", "value": "kutgw"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["' . config('app.url') . '/notes/D"]}}]}',
|
||||
'type' => 'like-of',
|
||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://tantek.com/likes/1"], "name": ["KUTGW"], "author": [{"type": ["h-card"], "value": "Tantek Celik", "properties": {"url": ["https://tantek.com/"], "name": ["Tantek Celik"], "photo": ["https://tantek.com/photo.jpg"]}}], "content": [{"html": "kutgw", "value": "kutgw"}], "published": ["' . date(DATE_W3C) . '"], "u-like-of": ["' . config('app.url') . '/notes/G"]}}]}',
|
||||
]);
|
||||
// WebMention repost Barry
|
||||
WebMention::create([
|
||||
'source' => 'https://barryfrost.com/reposts/1',
|
||||
'target' => config('app.url') . '/notes/C',
|
||||
'commentable_id' => '12',
|
||||
'commentable_type' => 'App\Models\Note',
|
||||
'type' => 'repost-of',
|
||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://barryfrost.com/reposts/1"], "name": ["Kagi is the best"], "author": [{"type": ["h-card"], "value": "Barry Frost", "properties": {"url": ["https://barryfrost.com/"], "name": ["Barry Frost"], "photo": ["https://barryfrost.com/barryfrost.jpg"]}}], "content": [{"html": "Kagi is the Best", "value": "Kagi is the Best"}], "published": ["' . date(DATE_W3C) . '"], "u-repost-of": ["' . config('app.url') . '/notes/C"]}}]}',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue