diff options
| author | winter | 2025-02-16 19:36:51 +0000 |
|---|---|---|
| committer | winter | 2025-02-16 19:36:51 +0000 |
| commit | 5a44137ddea7b3a6d7f68cbe71594f7633d6e9a6 (patch) | |
| tree | 1583032971f5fbde6e333a4c377c2b6672dc296c /templates/note.php | |
| parent | 65dfe7aff06dfd3b044a5deb47b03d643c651ec1 (diff) | |
link previews
Diffstat (limited to 'templates/note.php')
| -rw-r--r-- | templates/note.php | 11 |
1 files changed, 11 insertions, 0 deletions
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) { </div> <?php endif; ?> + <?php + $i = 0; + foreach ($note->getLinkPreviews() as $preview) { + call_template("note_link_preview", ['preview' => $preview]); + if (++$i > MAX_PREVIEW_CARDS) + break; + } + ?> + <?php if (isset($note->summary)): ?> </details> <?php endif; ?> |
