Skip to content

Commit

Permalink
truncate OGP description
Browse files Browse the repository at this point in the history
  • Loading branch information
takahashim committed Aug 28, 2023
1 parent 2a207eb commit 01166ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/decidim/blogs/posts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% add_decidim_meta_tags({
title: translated_attribute(post.title),
description: translated_attribute(post.body),
description: translated_attribute(post.body).truncate(Rails.application.config.default_blog_ogp_description_limit),
url: post_url(post.id)
}) %>
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/decidim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@
## Set default comments limit. It's used in Decidim::Comments component. Default value is 100.
Rails.application.config.default_comments_limit = ENV.fetch("DECIDIM_COMMENTS_LIMIT", 100).to_i

## Set default OGP description length limit. It's used in Decidim::Blogs components
Rails.application.config.default_blog_ogp_description_limit = ENV.fetch("DECIDIM_BLOG_OGP_DESCRIPTION_LIMIT", 150).to_i

# Overwrite Devise.allow_unconfirmed_access_for
Devise.allow_unconfirmed_access_for = Decidim.unconfirmed_access_for

Expand Down

0 comments on commit 01166ec

Please sign in to comment.