[WP Theme Dev] Iemoto と _s テンプレートの違い

memo.

[markdown]
> * [Iemoto で WordPress theme の作成を始めるまでの手順を確認する | deadwood](https://www.d-wood.com/blog/2017/05/16_8938.html)

## 比較用のテンプレートを生成する

### Iemoto

> * [megumiteam/iemoto: Underscores (_s) based grunt-init template for WordPress theme.](https://github.com/megumiteam/iemoto)
>
> Commits on Feb 18, 2017 (7375d1d44b9d91a8944a112e9432484ecde2f648)

“`prettyprinted
% grunt-init iemoto
Running “init:iemoto” (init) task
This task will create one or more files in the current directory, based on the
environment and the answers to a few questions. Note that answering “?” to any
question will show question-specific help and answering “none” to most questions
will leave its value blank.
Please answer the following:
[?] Project title (Iemoto)
[?] PHP function prefix (alpha and underscore characters only) (iemoto)
[?] Description (Megumi theme based on Underscores)
[?] Project homepage (https://www.digitalcube.jp/)
[?] Author name (DigitalCube Co.,Ltd)
[?] Author url (https://www.digitalcube.jp/)
[?] Use gulp? (y/N)
[?] Do you need to make any changes to the above before continuing? (y/N)
“`

### _s

> * [Underscores | A Starter Theme for WordPress](http://underscores.me/)
>
> Commits on Dec 25, 2016 (b330bbaba7fc62c089cdf94e52595941493882db)

_s は、サイトに同じ情報を入力し、ファイルを生成します。
Iemoto と比較すると Project homepage の入力項目がありませんでした。

## diff

_s で生成したテンプレートを iemoto_s として diff をとります。

“`prettyprinted
% diff -r iemoto iemoto_s
“`

[出力結果](https://www.d-wood.com/demo/20170516/diff.txt)

– `<` ... Iemoto にある。 - `>` … _s にある。

以下はファイル差分のみ表示。

“`prettyprinted
% diff -rq iemoto iemoto_s
Only in iemoto: .gitignore
Only in iemoto_s: .jscsrc
Only in iemoto_s: .jshintignore
Only in iemoto: .jshintrc
Files iemoto/404.php and iemoto_s/404.php differ
Only in iemoto: Gruntfile.js
Files iemoto/README.md and iemoto_s/README.md differ
Files iemoto/archive.php and iemoto_s/archive.php differ
Files iemoto/comments.php and iemoto_s/comments.php differ
Files iemoto/footer.php and iemoto_s/footer.php differ
Files iemoto/functions.php and iemoto_s/functions.php differ
Files iemoto/header.php and iemoto_s/header.php differ
Files iemoto/inc/template-tags.php and iemoto_s/inc/template-tags.php differ
Files iemoto/index.php and iemoto_s/index.php differ
Only in iemoto/js: iemoto.js
Files iemoto/languages/iemoto.pot and iemoto_s/languages/iemoto.pot differ
Only in iemoto/languages: ja.mo
Only in iemoto/languages: ja.po
Only in iemoto_s: layouts
Only in iemoto: package.json
Files iemoto/page.php and iemoto_s/page.php differ
Files iemoto/readme.txt and iemoto_s/readme.txt differ
Only in iemoto/sass: editor-style.scss
Files iemoto/sass/style.scss and iemoto_s/sass/style.scss differ
Files iemoto/search.php and iemoto_s/search.php differ
Files iemoto/sidebar.php and iemoto_s/sidebar.php differ
Files iemoto/single.php and iemoto_s/single.php differ
Files iemoto/style.css and iemoto_s/style.css differ
Files iemoto/template-parts/content-none.php and iemoto_s/template-parts/content-none.php differ
Files iemoto/template-parts/content-page.php and iemoto_s/template-parts/content-page.php differ
Files iemoto/template-parts/content-search.php and iemoto_s/template-parts/content-search.php differ
Files iemoto/template-parts/content.php and iemoto_s/template-parts/content.php differ
“`

## 要約

Iemoto

– 各 php テンプレートに [do action](https://wpdocs.osdn.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/do_action) が仕込んである。
– functions.php に調整が入っている。
– Gruntfile.js, package.json がある。
– 翻訳ファイルがある。
– (おそらく)プロジェクト用のベース iemoto.js がある。
– TinyMCE 用の editor-style.scss がある。

_s

– layouts/ がある。

### 追記:2017/05/17

こちらに詳細が載っていました。

> * [WordPressテーマ用の grunt-init テンプレート Iemoto を使ったテーマ作成 – Gatespace’s Blog](https://gatespace.jp/2014/09/01/grunt-init-iemoto/)
[/markdown]