2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Rails] meta-tagsを何度更新しても反映されないのはデフォルトの文字数制限が原因だった

Last updated at Posted at 2016-05-11

http://qiita.com/nysalor/items/ef68428307f612b6b6c2
↑のような感じで何気なく使っていたmeta-tags
titleタグの末尾の文言を何度更新しても反映されず2時間くらいハマる・・・
原因はデフォルトの文字数制限だった。

initializerで設定できる。

MetaTags.configure do |c|
  c.title_limit        = 70
  c.description_limit  = 160
  c.keywords_limit     = 255
  c.keywords_separator = ', '
end

デフォルトがSEOに最適な文字数ではあるのでこれに従うもOKかな。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?