[openstreetmap/openstreetmap-website] Use first diary entry image in Open Graph (PR #4882)

Anton Khorev notifications at github.com
Thu Jun 6 15:34:57 UTC 2024


For `/user/:name/diary/:id` pages.

Part of #1361, which also asks for descriptions but I'm not sure what to put there.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4882

-- Commit Summary --

  * Add image method to get first image from rich text
  * Set Open Graph image to first image for diary entries
  * Ensure that Open Graph image url is absolute

-- File Changes --

    M app/controllers/diary_entries_controller.rb (1)
    M app/helpers/open_graph_helper.rb (4)
    M app/models/diary_entry.rb (2)
    M app/views/layouts/_meta.html.erb (2)
    M lib/rich_text.rb (27)
    M test/controllers/diary_entries_controller_test.rb (22)
    M test/lib/rich_text_test.rb (25)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4882.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4882.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4882
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4882 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240606/f2a8dfc7/attachment.htm>


More information about the rails-dev mailing list