0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

mt head部分サンプル

Posted at
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- ===== タイトル ===== -->
<mt:If tag="PageTitle">
  <title><$mt:PageTitle encode_html="1"$> | <$mt:BlogName encode_html="1"$></title>
<mt:ElseIf tag="EntryTitle">
  <title><$mt:EntryTitle encode_html="1"$> | <$mt:BlogName encode_html="1"$></title>
<mt:Else>
  <title><$mt:BlogName encode_html="1"$></title>
</mt:If>

<!-- ===== ディスクリプション ===== -->
<mt:SetVarBlock name="__meta_desc">
  <mt:If tag="PageTitle">
    <$mt:PageBody remove_html="1" trim_to="120" encode_html="1"$>
  <mt:ElseIf tag="EntryTitle">
    <$mt:EntryExcerpt remove_html="1" trim_to="120" encode_html="1"$>
  <mt:Else>
    <$mt:BlogDescription remove_html="1" trim_to="120" encode_html="1"$>
  </mt:If>
</mt:SetVarBlock>
<meta name="description" content="<$mt:Var name="__meta_desc"$>">

<!-- ===== canonical ===== -->
<link rel="canonical" href="<$mt:CanonicalURL$>">

<!-- ===== OGP / Twitter ===== -->
<mt:SetVarBlock name="__og_title">
  <mt:If tag="PageTitle">
    <$mt:PageTitle encode_html="1"$> | <$mt:BlogName encode_html="1"$>
  <mt:ElseIf tag="EntryTitle">
    <$mt:EntryTitle encode_html="1"$> | <$mt:BlogName encode_html="1"$>
  <mt:Else>
    <$mt:BlogName encode_html="1"$>
  </mt:If>
</mt:SetVarBlock>

<mt:SetVarBlock name="__og_type">
  <mt:If tag="PageTitle">article<mt:ElseIf tag="EntryTitle">article<mt:Else>website</mt:If>
</mt:SetVarBlock>

<mt:SetVarBlock name="__og_image">
  <mt:If tag="PageTitle">
    <mt:PageAssets type="image" limit="1"><$mt:AssetURL$></mt:PageAssets>
  <mt:ElseIf tag="EntryTitle">
    <mt:EntryAssets type="image" limit="1"><$mt:AssetURL$></mt:EntryAssets>
  <mt:Else>
    /img/og-default.jpg
  </mt:If>
</mt:SetVarBlock>

<meta property="og:site_name" content="<$mt:BlogName encode_html="1"$>">
<meta property="og:title" content="<$mt:Var name="__og_title"$>">
<meta property="og:type" content="<$mt:Var name="__og_type"$>">
<meta property="og:url" content="<$mt:CanonicalURL$>">
<meta property="og:image" content="<$mt:Var name="__og_image"$>">
<meta property="og:description" content="<$mt:Var name="__meta_desc"$>">

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<$mt:Var name="__og_title"$>">
<meta name="twitter:description" content="<$mt:Var name="__meta_desc"$>">
<meta name="twitter:image" content="<$mt:Var name="__og_image"$>">

<!-- ===== 更新日(あれば) ===== -->
<mt:If tag="PageModifiedDate">
  <meta name="last-modified" content="<$mt:PageModifiedDate format="%Y-%m-%dT%H:%M:%S%z"$>">
<mt:ElseIf tag="EntryModifiedDate">
  <meta name="last-modified" content="<$mt:EntryModifiedDate format="%Y-%m-%dT%H:%M:%S%z"$>">
</mt:If>

<!-- ===== CSS / JS ===== -->
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" href="<$mt:StaticWebPath$>css/style.css">
<script src="<$mt:StaticWebPath$>js/script.js" defer></script>

<!-- ===== 構造化データ(WebPage/Article を自動出し分け) ===== -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "<mt:If tag="PageTitle">WebPage<mt:ElseIf tag="EntryTitle">Article<mt:Else>WebSite</mt:If>",
  "url": "<$mt:CanonicalURL$>",
  "headline": "<mt:If tag="PageTitle"><$mt:PageTitle encode_json="1"$><mt:ElseIf tag="EntryTitle"><$mt:EntryTitle encode_json="1"$><mt:Else><$mt:BlogName encode_json="1"$></mt:If>",
  "description": "<$mt:Var name="__meta_desc"$>",
  "image": ["<$mt:Var name="__og_image"$>"],
  "datePublished": "<mt:If tag="PageDate"><$mt:PageDate format="%Y-%m-%dT%H:%M:%S%z"$><mt:ElseIf tag="EntryDate"><$mt:EntryDate format="%Y-%m-%dT%H:%M:%S%z"$><mt:Else></mt:If>",
  "dateModified": "<mt:If tag="PageModifiedDate"><$mt:PageModifiedDate format="%Y-%m-%dT%H:%M:%S%z"$><mt:ElseIf tag="EntryModifiedDate"><$mt:EntryModifiedDate format="%Y-%m-%dT%H:%M:%S%z"$><mt:Else></mt:If>",
  "publisher": {
    "@type": "Organization",
    "name": "<$mt:BlogName encode_json="1"$>"
  }
}
</script>

<!-- ===== パンくず(最低限:Home > 現在地) ===== -->
<script type="application/ld+json">
{
  "@context":"https://schema.org",
  "@type":"BreadcrumbList",
  "itemListElement":[
    {"@type":"ListItem","position":1,"name":"Home","item":"<$mt:BlogURL$>"},
    {"@type":"ListItem","position":2,"name":"<mt:If tag="PageTitle"><$mt:PageTitle encode_json="1"$><mt:ElseIf tag="EntryTitle"><$mt:EntryTitle encode_json="1"$><mt:Else><$mt:BlogName encode_json="1"$></mt:If>","item":"<$mt:CanonicalURL$>"}
  ]
}
</script>
</head>
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?