LoginSignup
0
2

More than 5 years have passed since last update.

ツイート時にリンク先の概要や画像を表示させるための設定手順

Last updated at Posted at 2016-12-05

メモで書き留め。
スクリーンショット 2016-12-05 21.11.10.png

利用するのはTwitterの「Twitter Cards」

head内に下記のコードを参考にして入れる。

index.html
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@nytimes">
<meta name="twitter:title" content="Parade of Fans for Houston’s Funeral">
<meta name="twitter:description" content="NEWARK - The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here.">
<meta name="twitter:image" content="http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg">
プロパティ 概要
twitter:card ツイート時のカードタイプの指定(https://dev.twitter.com/cards/types)
twitter:site Twitterのアカウント(自分のアカウントでOK)
twitter:title 記事のタイトル
twiiter:description 記事の概要
twitter:image 画像のURL

画像が表示されない場合はrobots.txtに下記のコードを追加。

robots.txt
User-agent: Twitterbot
Disallow: *

Allow: /images

imagesを画像が入っているディレクトリにする。

まぁツイートボタンを入れろって話なんだけどね(笑)

0
2
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
0
2