うるう年の時は日付を366にする
function leap_year($leap_year) {
if(($leap_year % 4 == 0) && ($leap_year % 100 != 0 || $leap_year % 400 == 0)) {
$leap_year = "366";
} else {
$leap_year = "365";
}
return $leap_year;
}
といった関数を定義しておいて
$leap_year_days = leap_year($year);
とすれば$leap_year_daysに365 or 366が入る。
meta
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="imagetoolbar" content="false" /> <meta name="robots" content="index,follow,noindex,nofollow" /> <meta name="keywords" content="" lang="ja,en" /> <meta name="description" content="" lang="ja,en" /> <meta name="author" content="" /> <meta name="copyright" content="©" /> <meta name="date" content="YYYY-mm-dd-THH:MM:SS+09:00" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="refresh" content="10;URL=" />
metaタグまとめ。
テンプレートで分岐
<mt:If name="main_index"> <mt:Ignore>メインページ</mt:Ignore> <mt:Include module="main_index" /> <mt:ElseIf name="archive_index"> <mt:Ignore>アーカイブページ</mt:Ignore> <mt:Include module="archive_index" /> <mt:ElseIf name="category_archive"> <mt:Ignore>カテゴリー別ブログ記事リスト</mt:Ignore> <mt:Include module="category_archive" /> <mt:ElseIf name="datebased_archive"> <mt:Ignore>ブログ記事リスト</mt:Ignore> <mt:Include module="datebased_archive" /> <mt:ElseIf name="entry_template"> <mt:Ignore>ブログ記事 (entry_archiveだと記事の確認画面でテンプレートが機能しない)</mt:Ignore> <mt:Include module="entry_template" /> <mt:ElseIf name="page_template"> <mt:Ignore>ウェブページ (page_archiveだとウェブページの確認画面でテンプレートが機能しない) </mt:Ignore> <mt:Include module="page_template" /> <mt:ElseIf name="comment_preview_template"> <mt:Ignore>コメントプレビュー</mt:Ignore> <mt:Include module="comment_preview_template" /> <mt:ElseIf name="comment_response_template"> <mt:Ignore>コメント完了</mt:Ignore> <mt:Include module="comment_response_template" /> <mt:ElseIf name="search_results"> <mt:Ignore>検索結果</mt:Ignore> <mt:Include module="search_results" /> <mt:Else> <mt:Ignore>カスタムインデックステンプレート</mt:Ignore> <mt:Include module="other_template" /> </mt:If>
よく使うやつだけ。
さらに詳しいのは、
アーカイブテンプレートに設定される予約変数 | Movable Type 4 ドキュメント
このサイトのテンプレート変更
公式テンプレート?のSoft-mochaというのをいろいろ変更してみた。
CSS3をちょっとだけ。
a { transition:all 0.3s ease-in-out; -moz-transition:all 0.3s ease-in-out; -webkit-transition:all 0.3s ease-in-out; } h1 { -moz-transform: rotate(-5deg); -webkit-transform: rotate(-5deg); transform: rotate(-5deg); } pre { -webkit-border-radius: 5px; -moz-border-radius: 5px; }