diff options
| author | winter | 2025-03-15 22:08:40 +0000 |
|---|---|---|
| committer | winter | 2025-03-15 22:08:40 +0000 |
| commit | 69951643b98aea431048e1405982d56c406bb412 (patch) | |
| tree | 82b4c150cb86f027f3db59cf77cad7d94a313ea5 | |
| parent | d5dd9044632320e625ce90ae9627ebc11c7a04d6 (diff) | |
add more metadata tags to pages
| -rw-r--r-- | locale/en_GB.json | 1 | ||||
| -rw-r--r-- | templates/pages/page.php | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/locale/en_GB.json b/locale/en_GB.json index 094ac2e..f430064 100644 --- a/locale/en_GB.json +++ b/locale/en_GB.json @@ -55,6 +55,7 @@ "note.privacy.scope.public": "Public", "note.resharedBy": "Reshared by %s", "note.page.author": "By %s", + "note.page.description": "A page by %s", "note.page.created": "First published %s", "note.page.modified": "Last updated %s", "note.page.list.pageTitle": "Pages", diff --git a/templates/pages/page.php b/templates/pages/page.php index bc17664..dfc171f 100644 --- a/templates/pages/page.php +++ b/templates/pages/page.php @@ -8,7 +8,14 @@ use Digitigrade\UserSettings; $page = $note->getPage(); -call_template('skeleton', ['pageTitle' => $page->title, 'renderTitleHeading' => false], function () use ($note, $page) { ?> +call_template('skeleton', [ + 'pageTitle' => $page->title, + 'renderTitleHeading' => false, + 'ogDesc' => __f('note.page.description', $note->author->displayName), + 'ogImage' => $note->author->avatar ?? path_to_uri('/static/default-avatar.png'), + 'ogType' => 'article', + 'ogHandle' => '@' . $note->author->getFullHandle(true) +], function () use ($note, $page) { ?> <div class="notePage"> <article lang="<?= htmlspecialchars($note->language) ?>"> <h1><?= htmlspecialchars($page->title) ?></h1> |
