From 5a44137ddea7b3a6d7f68cbe71594f7633d6e9a6 Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 16 Feb 2025 19:36:51 +0000 Subject: link previews --- templates/note.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'templates/note.php') diff --git a/templates/note.php b/templates/note.php index 81f7e38..4cdcd94 100644 --- a/templates/note.php +++ b/templates/note.php @@ -5,6 +5,8 @@ use Digitigrade\Model\NotePrivacyScope; use Digitigrade\Model\UserAccount; use Digitigrade\UserSettings; +const MAX_PREVIEW_CARDS = 1; + $user = UserAccount::findByCurrentSession(); $prefs = $user ? new UserSettings($user) : null; $interKinds = []; @@ -89,6 +91,15 @@ if ($user != null) { + getLinkPreviews() as $preview) { + call_template("note_link_preview", ['preview' => $preview]); + if (++$i > MAX_PREVIEW_CARDS) + break; + } + ?> + summary)): ?> -- cgit v1.3