ウェブサイトでは、新しいウィジットやボタンが作成される前に、TwitterのウィジットJavaScriptを使って全てのページに<meta>
エレメントと<link>
エレメントをインクルードすることで、ウェブサイト全体のウィジット設定を行うことができます。
<meta>
で設定されたウィジット設定は、個別のウィジットレベルで上書きすることができます。優先順位は:
Twitter Widgets Webpage PropertiesWebsites can set widget preferences across their entire website by including Widget settings specified in a
|
URL プロパティがボタンのマークアップに設定されていない場合、ツイートボタンは<link>
内に記載されたcanonical link relation of the pageをshared URLとして、使用します。
ウェブページの<head>
項目内に canonical linkを追加してください。
<link rel="canonical" href="https://dev.twitter.com/">
Canonical linkThe Tweet Button uses the canonical link relation of the page expressed in a Add a canonical link in the <link rel="canonical" href="https://dev.twitter.com/"> |
me
link relationshipトークンが付いたあなたのTwitterプロフィールページをリンクすることで、ツイートボタンのvia
プロパティを埋め込んでください。
me
link relationship は、あなたのウェブページの <head>
項目に設定してください。
<link rel="me" href="https://twitter.com/TwitterDev">
You may also set a me
relationship from an anchor element on your page, such as a Follow Button.
<a class="twitter-follow-button" rel="me" href="https://twitter.com/TwitterDev"> Follow @TwitterDev </a>
Identify the Twitter profile of the pagePopulate the Set a <link rel="me" href="https://twitter.com/TwitterDev"> You may also set a <a class="twitter-follow-button" rel="me" href="https://twitter.com/TwitterDev"> Follow @TwitterDev </a> |
Twitterでは フォローアカウントの推奨を含む、Twitterの使い勝手をより良くするために、ウェブサイトの表示データを使用することがあります。
dnt=on
を設定することで、あなたのウェブサイトの訪問者を使用状況の通知対象から除外することができます。
<meta name="twitter:dnt" content="on">
Do not trackTwitter may use website impression data to tailor Twitter experiences including suggesting accounts to follow. Your website can choose to opt-out your audience from tailored experiences informed by the content of your site by setting <meta name="twitter:dnt" content="on"> |
埋め込み型ツイートや 埋め込み型タイムラインの既定のlight
テーマ設定を上書きします。
<meta name="twitter:widgets:theme" content="dark">
既定の見え方 | テーマをdarkに設定 |
---|---|
|
|
ThemeOverride the default <meta name="twitter:widgets:theme" content="dark">
|
埋め込み型ツイート や 埋め込み型タイムラインに表示されるツイートリンクの16進カラー値を設定します。
<meta name="twitter:widgets:link-color" content="#ff00ff">
Link colorSpecify a hexadecimal color value for Tweet links displayed in an Embedded Tweet or an Embedded Timeline. <meta name="twitter:widgets:link-color" content="#ff00ff"> |
ページに表示される埋め込み型タイムラインの区切り線の色を設定します。
<meta name="twitter:widgets:border-color" content="#ff00ff">
Border colorSpecify a border color for any Embedded Timelines displayed on the page. <meta name="twitter:widgets:border-color" content="#ff00ff"> |
Content Security PolicyによってTwitterのインライン読み込みが制限されている場合、埋め込み型ツイートや埋め込み型タイムラインは制限された機能で表示されることがあります。
あなたのサイトでContent Security Policy警告を表示する機能を無効にするには、csp=on
と設定してください。
<meta name="twitter:widgets:csp" content="on">
Disable functionality which may trigger Content Security Policy warningsAn Embedded Tweet or Embedded Timeline may display with restricted capabilities when a Content Security Policy restricts inline loading of Twitter. Set <meta name="twitter:widgets:csp" content="on"> |