[openstreetmap/openstreetmap-website] Set og:description meta tag to diary entry description (PR #5056)

Anton Khorev notifications at github.com
Wed Aug 7 05:48:11 UTC 2024


Uses the first paragraph with text truncated to 500 characters as an OpenGraph description on diary entry pages. Uses the default text on other pages or if no paragraph with text is found.

Fixes #1361
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Add a blank richtext description method
  * Use first paragraph as richtext description
  * Detect <p> as richtext paragraph
  * Truncate long richtext descriptions
  * Skip paragraphs with no text when looking for richtext description
  * Pass properties hash to OpenGraph helper
  * Set OpenGraph properties hash in diary entry show action
  * Set og:description meta tag to diary entry description

-- File Changes --

    M app/controllers/diary_entries_controller.rb (7)
    M app/helpers/open_graph_helper.rb (18)
    M app/views/layouts/_meta.html.erb (2)
    M lib/rich_text.rb (47)
    M test/controllers/diary_entries_controller_test.rb (22)
    M test/lib/rich_text_test.rb (52)

-- Patch Links --

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

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

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


More information about the rails-dev mailing list