<commit_before>module OpenGraphHelper
  def og_title(post)
    meta_tag_with_property('og:title', post_page_title(post, :length => 140))
  end

  def og_type(post)
    meta_tag_with_property('og:type', 'article')
  end

  def og_url(post)
    meta_tag_with_property('og:url', post_url(post))
  end

  def og_image(post)
    if post.photos.present?
      img_url = post.photos.first.url(:thumb_medium)
      meta_tag_with_property('og:image', img_url)
    end
  end

  def og_site_name
    meta_tag_with_property('og:site_name', 'Diaspora*')
  end

  def og_description(post)
    meta_tag_with_property('og:description', post_page_title(post, :length => 1000))
  end

  def og_page_specific_tags(post)
    [og_title(post), og_type(post), 
      og_url(post), og_image(post), 
      og_description(post)].join(' ').html_safe
  end

  def meta_tag_with_property(name, content)
    content_tag(:meta, '', :property => name, :content => content)
  end
end<commit_msg>include a default image in the og:image [ci skip]<commit_after>module OpenGraphHelper
  def og_title(post)
    meta_tag_with_property('og:title', post_page_title(post, :length => 140))
  end

  def og_type(post)
    meta_tag_with_property('og:type', 'article')
  end

  def og_url(post)
    meta_tag_with_property('og:url', post_url(post))
  end

  def og_image(post)
    img_url = post.photos.present? ? post.photos.first.url(:thumb_medium) : "#{root_url.chop}#{image_path('asterisk.png')}"
    meta_tag_with_property('og:image', img_url)
  end

  def og_site_name
    meta_tag_with_property('og:site_name', 'Diaspora*')
  end

  def og_description(post)
    meta_tag_with_property('og:description', post_page_title(post, :length => 1000))
  end

  def og_page_specific_tags(post)
    [og_title(post), og_type(post), 
      og_url(post), og_image(post), 
      og_description(post)].join(' ').html_safe
  end

  def meta_tag_with_property(name, content)
    content_tag(:meta, '', :property => name, :content => content)
  end
end
{'fraction_non_alphanumeric': 0.12895132965378825, 'fraction_numerical': 0.007024586051179127, 'mean_word_length': 4.763005780346821, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3929454', 'n_tokens_mistral': 754, 'n_tokens_neox': 715, 'n_words': 126}