summaryrefslogtreecommitdiffstats
path: root/release-notes
diff options
context:
space:
mode:
authorXavier Vello <xavier.vello@gmail.com>2024-07-10 20:29:35 +0200
committerEarl Warren <earl-warren@noreply.codeberg.org>2024-07-10 20:29:35 +0200
commit147ae2c5be028fc02632804f60d29992019dc918 (patch)
tree4117b3c549e65868002eb4efec3abcca513ec64f /release-notes
parentMerge pull request 'docs(release-notes): fix artifact range requests [skip ci... (diff)
downloadforgejo-147ae2c5be028fc02632804f60d29992019dc918.tar.xz
forgejo-147ae2c5be028fc02632804f60d29992019dc918.zip
Fix opengraph meta for wiki pages (#4427)
Fixes https://codeberg.org/forgejo/forgejo/issues/4417 by adding a conditional branch to the `head_opengraph` template to match wiki pages. I tried to be consistent with the other types: - `og:title` is the wiki page title - `og:url` is built via `{{AppUrl}}{{.Link}}` like it is done for commit and file views. This has the caveat of doubling the slash (see test below). Should we `{{trimSuffix "/" AppUrl}}` to remove this, if sprig is available? - `og:description` is the repository description to match GH behaviour. Also, the first sentences of the page might not be descriptive enough. Should we prefix the repo description with the repo name? - `og:type` and `og:image` are common Added a `TestOpenGraphProperties` integration test using existing fixtures. Coverage is not 100% but can be improved later. ## Output on a test repo ```html <meta property="og:title" content="Project architecture"> <meta property="og:url" content="http://localhost:3000//xvello/wiki-test/wiki/Project-architecture"> <meta property="og:description" content="description for a test project"> <meta property="og:type" content="object"> <meta property="og:image" content="http://localhost:3000/avatars/3dd4d1e4eef065d1b4ad4bdb081ab6e7"> ``` Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4427 Co-authored-by: Xavier Vello <xavier.vello@gmail.com> Co-committed-by: Xavier Vello <xavier.vello@gmail.com>
Diffstat (limited to 'release-notes')
-rw-r--r--release-notes/9.0.0/fix/4427.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/release-notes/9.0.0/fix/4427.md b/release-notes/9.0.0/fix/4427.md
new file mode 100644
index 0000000000..3556a8f13d
--- /dev/null
+++ b/release-notes/9.0.0/fix/4427.md
@@ -0,0 +1 @@
+Fixed social media previews for links to wiki pages.