Movabletypeウェブページテンプレートの最適な作り方
Movabletype4のテンプレートの作り方は非常に多くのパターンがあるかと思いますが多くのサイトを作ってきて一番最適な方法がそれぞれにはあると思います。おいらの方法をメモがてらに乗っけておきます。
ウェブページテンプレート(上部のみ)
<$mt:SetVars$> title=<$mt:PageTitle encode_html="1"$> desc=<$mt:PageKeywords encode_html="1"$> folder=<$mt:FolderBaseName$> filename=<$mt:PageBaseName$> mode=page keywords= </mt:SetVars> <$mt:PageTags$> <$mt:SetVars$> tag=<$mt:TagLabel$> </mt:SetVars> <$mt:Unless name="tag" like="@"$> <$mt:If name="keywords"$> <$mt:SetVars$>keywords=<$mt:Var name="keywords"$>,<$mt:Var name="tag" encode_html="1"$></mt:SetVars> <mt:else> <$mt:SetVars$>keywords=<$mt:Var name="tag"$></mt:SetVars> </mt:If> </mt:Unless> </mt:PageTags> <$mt:Unless name="desc"$> <mt:SetVars>desc=<$mt:PageBody encode_html="1" words="255"$></mt:SetVars> </mt:Unless>
このテンプレートの便利なところはページのタイプが明確になり、SEOにも非常に柔軟というところです。descriptionはページ内を自動で255文字に丸めます。