movable type as a playground

106
Movable Type as a Playground Taku AMANO MTDDC Meetup TOKYO 2014

Upload: taku-amano

Post on 08-Jul-2015

528 views

Category:

Technology


2 download

DESCRIPTION

MTDDC Meetup TOKYO 2014 のセッションでの資料です。 MT を MT たらしめている機能とはなんでしょうか。答は利用シーンによって異なると思いますが、私は代表的な機能として以下のようなものがあると考えています。 * コンテンツを書き出すためのツールであり、またコミュニティの共通言語である MTML * コンテンツとURLを結びつける枠組みである Static Publishing と Dynamic Publishing * Webサイトに雛形である Theme * ブラウザ以外の環境からのアクセスの土台である Data API このセッションではこれらの機能それぞれにスポットライトをあてて振り返りながら、プラグインを使って(実用的に)どのように遊ぶことができるかという点について、一緒に考えていきます。

TRANSCRIPT

Page 1: Movable Type as a Playground

Movable Type as a

Playground

Taku AMANO MTDDC Meetup TOKYO 2014

Page 2: Movable Type as a Playground
Page 3: Movable Type as a Playground
Page 4: Movable Type as a Playground
Page 5: Movable Type as a Playground
Page 6: Movable Type as a Playground

Movable Type as a Playground

Page 7: Movable Type as a Playground

Movable Type as a Framework

Page 8: Movable Type as a Playground

Movable Type as a 一定のルールに従って自由に

遊べる場所

Page 9: Movable Type as a Playground

Movable Type as a ルール

Page 10: Movable Type as a Playground

Movable Type as a 場所

Page 11: Movable Type as a Playground

ルールがあり 場所があるので

情報や成果を共有できる

Page 12: Movable Type as a Playground

Movable Type のルールについて 振り返りつつ

活用できる可能性を考える

Page 13: Movable Type as a Playground

今からでも間に合う

Page 14: Movable Type as a Playground

http://www.movabletype.jp/blog/mt-pludemy-award-2014.html

Page 15: Movable Type as a Playground

はじまります

Page 16: Movable Type as a Playground

MTML

Page 17: Movable Type as a Playground

<mt:Entries> <$mt:EntryDate format="%x"$> <a href="<$mt:EntryPermalink$>"> <$mt:EntryTitle$> </a></mt:Entries>

Page 18: Movable Type as a Playground

コンテンツを書き出すツールであり コミュニティの共通言語

Page 19: Movable Type as a Playground
Page 20: Movable Type as a Playground

<mt:Entries> <$mt:EntryDate format="%x"$> <a href="<$mt:EntryPermalink$>"> <$mt:EntryTitle$> </a></mt:Entries>

Page 21: Movable Type as a Playground

余談

Page 22: Movable Type as a Playground
Page 23: Movable Type as a Playground
Page 24: Movable Type as a Playground

裏側で難しいことを やっていたとしても

MTタグになっていれば 誰でも使える

Page 25: Movable Type as a Playground

新しいMTタグを覚えるだけで 今までと同じように書いて 新しいことができる

Page 26: Movable Type as a Playground

これを利用している 代表的な プラグイン

Page 27: Movable Type as a Playground

DynamicMTML

Page 28: Movable Type as a Playground

https://github.com/PowerCMS/DynamicMTML

Page 29: Movable Type as a Playground

•指定したタグの中身を動的に

•それ以外を静的に

Page 30: Movable Type as a Playground

<mt:DynamicMTML><mt:Entries> <$mt:EntryDate format="%x"$> <a href="<$mt:EntryPermalink$>"> <$mt:EntryTitle$> </a></mt:Entries><mt:DynamicMTML>

Page 31: Movable Type as a Playground

<mt:DynamicMTML><mt:Entries> <$mt:EntryDate format="%x"$> <a href="<$mt:EntryPermalink$>"> <$mt:EntryTitle$> </a></mt:Entries><mt:DynamicMTML>

Page 32: Movable Type as a Playground

<mt:DynamicMTML><mt:Entries> <$mt:EntryDate format="%x"$> <a href="<$mt:EntryPermalink$>"> <$mt:EntryTitle$> </a></mt:Entries><mt:DynamicMTML>

Page 33: Movable Type as a Playground

もう一つの例 (プラグイン)

Page 34: Movable Type as a Playground

FastestPreview

Page 35: Movable Type as a Playground
Page 36: Movable Type as a Playground
Page 37: Movable Type as a Playground

ユーザーが カスタマイズしたテンプレート

でもそのまま使える

Page 38: Movable Type as a Playground

MTMLがあるから 実現できた

Page 39: Movable Type as a Playground

<div><mt:EntryTitle /></div>

Page 40: Movable Type as a Playground

普通の書き出しのとき

Page 41: Movable Type as a Playground

<div>タイトル</div>

Page 42: Movable Type as a Playground

プレビュー用の出力のとき

Page 43: Movable Type as a Playground

<div><span data-field=“title”>タイトル</span></div>

Page 44: Movable Type as a Playground

同じ mt:EntryTitle タグから 公開用のときと

プレビュー用のときで 異なる結果を出力している

Page 45: Movable Type as a Playground

MTでは既存のタグの 動作を変更できる

Page 46: Movable Type as a Playground

<div><mt:IfPreview></mt:IfPreview><mt:EntryTitle /><mt:IfPreview></mt:IfPreview></div>

Page 47: Movable Type as a Playground

<div><mt:IfPreview></mt:IfPreview><mt:EntryTitle /><mt:IfPreview></mt:IfPreview></div>

Page 48: Movable Type as a Playground

テンプレートには 変更を加えることなく 機能を追加できる

Page 49: Movable Type as a Playground

コミュニティの共通言語

Page 50: Movable Type as a Playground
Page 51: Movable Type as a Playground

Static Publishing Dynamic Publishing

Page 52: Movable Type as a Playground

優れているところ

Page 53: Movable Type as a Playground

•安定した書き出し機能

•プログラマのいない「Web制作会社」でも

•共用のレンタルサーバーでも

•簡単に任意のURLにマッピングできる

Page 54: Movable Type as a Playground

いまいちなところ

Page 55: Movable Type as a Playground

•拡張するのがかなり面倒くさい

•カスタムフィールドアーカイブとか

•拡張できなくはないが

•プログラムをたくさん書かなければいけない

Page 56: Movable Type as a Playground

なんとかできないか

Page 57: Movable Type as a Playground

アーカイブマッピング

Page 58: Movable Type as a Playground

• 日別・週別・月別・年別 • ユーザー別 • カテゴリ別

Page 59: Movable Type as a Playground

「公開されるパス」 が同じ記事のまとまり

Page 60: Movable Type as a Playground

年別

ユーザー別

カテゴリ別

Page 61: Movable Type as a Playground

<mt:EntryDate format=“%Y” />

ユーザー別

カテゴリ別

Page 62: Movable Type as a Playground

<mt:EntryDate format=“%Y” />

<mt:EntryAuthor />

カテゴリ別

Page 63: Movable Type as a Playground

<mt:EntryDate format=“%Y” />

<mt:EntryAuthor />

<mt:EntryCategory />

Page 64: Movable Type as a Playground

「公開されるパス」 が同じなら

同じアーカイブファイル

Page 65: Movable Type as a Playground

MTでは「パス」欄に

好きなだけMTタグを書ける

Page 66: Movable Type as a Playground

MappingBasedArchive

Page 67: Movable Type as a Playground
Page 68: Movable Type as a Playground

Theme

Page 69: Movable Type as a Playground

Since 5.0

Page 70: Movable Type as a Playground

•ブログの雛形を提供する機能

•テンプレートとアーカイブマッピングの定義

•カスタムフィールドの定義

•静的なファイルの配置

• StyleCatcher •管理画面のUIを変更する機能

Page 71: Movable Type as a Playground

他にも

Page 72: Movable Type as a Playground

•ブログの設定の変更

•カテゴリの作成

•ページの雛形の作成

•など

Page 73: Movable Type as a Playground

多くの使われ方としては ブログの雛形を提供する機能

Page 74: Movable Type as a Playground

もっとできるんじゃないか

Page 75: Movable Type as a Playground

•テンプレートの開発をサポートする

•運用開始後の編集もサポートする

Page 76: Movable Type as a Playground

「ファイルへのリンク」機能 と

組み合わせる

Page 77: Movable Type as a Playground
Page 78: Movable Type as a Playground

Theme と

「ファイルへのリンク」

Page 79: Movable Type as a Playground

SyncedTheme

Page 80: Movable Type as a Playground
Page 81: Movable Type as a Playground
Page 82: Movable Type as a Playground

嬉しいこと

Page 83: Movable Type as a Playground

•テンプレートをまとめてリンク

•1つずつリンクする必要がない

•「テーマ」単位で管理できる

•複数のブログのデザインを同時に更新

Page 84: Movable Type as a Playground

Data API

Page 85: Movable Type as a Playground

Since 6.0

Page 86: Movable Type as a Playground

デフォルトの Data API Ver. 1で できること

Page 87: Movable Type as a Playground

•認証

•ユーザー情報の取得と更新

•記事の作成と更新

•アイテムのアップロード

•など

Page 88: Movable Type as a Playground

Data API Ver. 1 の 課題

Page 89: Movable Type as a Playground

•遅い

•特に CGI 環境で

•エンドポイントが少ない

•Ver. 2 ではかなり増えるらしい

Page 90: Movable Type as a Playground

APIの価値

Page 91: Movable Type as a Playground

•プログラムから利用可能な認証機能

•拡張可能なインターフェイス

Page 92: Movable Type as a Playground

Playground

Page 93: Movable Type as a Playground

MAUS

Page 94: Movable Type as a Playground

http://alfasado.net/apps/maus-ja.html

Page 95: Movable Type as a Playground

•プレビュー機能付きの Markdown エディタ

•既存記事の管理

•HTMLビュー機能

•ファイルのアップロード

•などhttp://alfasado.net/apps/maus-ja.html

Page 96: Movable Type as a Playground

MTSyncTheme.app

Page 97: Movable Type as a Playground
Page 98: Movable Type as a Playground

•テーマをローカルからMTへ同期

•ローカルに保存したテーマからプレビュー

•複数のファイルにまたがる変更にも対応

•同じテーマのブログをまとめて再構築

•など

Page 99: Movable Type as a Playground
Page 100: Movable Type as a Playground
Page 101: Movable Type as a Playground

MTSyncTheme.app の 仕組み

Page 102: Movable Type as a Playground

• SyncedTheme で Data API のエンドポイントを追加

• App でファイルの変更を監視

•変更があったらエンドポイントにリクエスト

Page 103: Movable Type as a Playground

まとめ

Page 104: Movable Type as a Playground

MTML

Static/Dynamic Publishing

Theme

Data API

Page 105: Movable Type as a Playground

Movable Type as a Playground

Page 106: Movable Type as a Playground

ありがとうございました