项目作者: megumiteam

项目描述 :
Underscores (_s) based grunt-init template for WordPress theme.
高级语言: CSS
项目地址: git://github.com/megumiteam/iemoto.git
创建时间: 2013-11-21T16:02:16Z
项目社区:https://github.com/megumiteam/iemoto

开源协议:

下载


Iemoto

This is a WordPress Starter Theme based on _s and integrated with grunt.

Iemoto follows all the fixes and feature upgrades of _s

Automate theme development process with it!

How to install

install grunt-init

If you’ve never used any grunt-init templates follow below to install grunt-init.

  1. npm install -g grunt-init

Next, create ~/.grunt-init directory.

  1. mkdir ~/.grunt-init

Install Iemoto

Get this templates via git.

  1. git clone git@github.com:megumiteam/iemoto.git ~/.grunt-init/iemoto

Or if you prefer https, try this.

  1. git clone https://github.com/megumiteam/iemoto.git ~/.grunt-init/iemoto

Sass(Compass)

Iemoto utilizes Sass and Compass to create style.css and editor-style.css.
Get them first.

gulp

You can also use gulp.js for js/sass compiling if installed.

  1. $ npm install --global gulp

Usage

Create your theme directory in wp-content/themes.

  1. mkdir wp-content/themes/my-theme

Cd to your theme directory run grunt-init iemoto to create theme files.

  1. grunt-init iemoto

By commanding above, you will be asked for some inputs such as Theme Name, Description, license and so on.

  1. $ grunt-init iemoto
  2. Running "init:iemoto" (init) task
  3. This task will create one or more files in the current directory, based on the
  4. environment and the answers to a few questions. Note that answering "?" to any
  5. question will show question-specific help and answering "none" to most questions
  6. will leave its value blank.
  7. Please answer the following:
  8. [?] Project title (Iemoto)
  9. [?] PHP function prefix (alpha and underscore characters only) (iemoto)
  10. [?] Description (This is a awesome cool plugin.)
  11. [?] Project homepage (https://digitalcube.jp/)
  12. [?] Author name (Digitalcube Co,.Ltd)
  13. [?] Author url (https://digitalcube.jp/)
  14. [?] Use gulp? (y/N)
  15. [?] Do you need to make any changes to the above before continuing? (y/N)

At the end of this procedure, you will be asked if there are any changes. Type N or enter key to create the templates.

When asked [?] Use gulp? (y/N), type y to create files you need for gulp. It’s N by default.

Then, command npm install to download files needed for grunt (or gulp) command.

  1. npm install

Files to be installed are defined in package.json file.

Once you are done to this point, you can see all the files created as below.

  1. ├── 404.php
  2. ├── archive.php
  3. ├── comments.php
  4. ├── footer.php
  5. ├── functions.php
  6. ├── Gruntfile.js (or gulpfile.js )
  7. ├── header.php
  8. ├── inc
  9. ├── custom-header.php
  10. ├── customizer.php
  11. ├── jetpack.php
  12. ├── template-functions.php
  13. └── template-tags.php
  14. ├── index.php
  15. ├── js
  16. ├── <themename>.js
  17. ├── customizer.js
  18. ├── navigation.js
  19. └── skip-link-focus-fix.js
  20. ├── languages
  21. ├── <themename>.pot
  22. ├── ja.mo
  23. ├── ja.po
  24. └── readme.txt
  25. ├── node_modules
  26. ├── package.json
  27. ├── page.php
  28. ├── README.md
  29. ├── readme.txt
  30. ├── rtl.css
  31. ├── sass
  32. ├── _normalize.scss
  33. ├── editor-style.scss
  34. ├── style.scss
  35. ├── elements
  36. ├── _elements.scss
  37. ├── _lists.scss
  38. └── _tables.scss
  39. ├── forms
  40. ├── _buttons.scss
  41. ├── _fields.scss
  42. └── _forms.scss
  43. ├── layout
  44. ├── _content-sidebar.scss
  45. └── _sidebar-content.scss
  46. ├── media
  47. ├── _captions.scss
  48. ├── _galleries.scss
  49. └── _media.scss
  50. ├── mixins
  51. └── _mixins-master.scss
  52. ├── modules
  53. ├── _accessibility.scss
  54. ├── _alignments.scss
  55. ├── _clearings.scss
  56. └── _infinite-scroll.scss
  57. ├── navigation
  58. ├── _links.scss
  59. ├── _menus.scss
  60. └── _navigation.scss
  61. ├── site
  62. ├── _site.scss
  63. ├── primary
  64. ├── _comments.scss
  65. └── _posts-and-pages.scss
  66. └── secondary
  67. └── _widgets.scss
  68. ├── typography
  69. ├── _copy.scss
  70. ├── _headings.scss
  71. └── _typography.scss
  72. └── variables-site
  73. ├── _colors.scss
  74. ├── _structure.scss
  75. ├── _typography.scss
  76. └── _variables-site.scss
  77. ├── screenshot.png
  78. ├── search.php
  79. ├── sidebar.php
  80. ├── single.php
  81. ├── style.css
  82. └── template-parts
  83. ├── content-none.php
  84. ├── content-page.php
  85. ├── content-search.php
  86. └── content.php

Create you own theme now.

Default values

You can set default values to the grunt-init prompt.

It will be more useful if there is a name and URL.

To set default values, put defaults.json and edit it.

  1. cp ~/.grunt-init/iemoto/defaults.json.sample ~/.grunt-init/defaults.json

About compiling SASS and verifying JavaScript code with grunt

When you’ve edited .js and .scss, command this.

  1. grunt

About compiling SASS and verifying JavaScript code with gulp

When you’ve edited .js and .scss, command this.

  1. gulp

You can gulp js or gulp compass to specify just js or Sass(Compass).

watch

If you utilize grunt watch or gulp watch, grunt(gulp) will watch the file editing and automatically compile and validate them.

  1. grunt watch
  2. // or
  3. gulp watch

To stop watch, type [control]+[c]

Version of javascripts and styles

Iemoto adds versions to js and css which is specified in package.json as

  1. "version": "0.1.0",

When grunt(gulp)ed, the version specified in package.json will be implemented in style.css and .js as comments, and also will be passed to wp_enqueue_style() and wp_enqueue_script().

Debug mode and Sourcemap

If WP_DEBUG is true, theme will load css/style.css, which has Sourcemap integrated, instead of style.css, which is the Sourcemap-ommited version of the css/style.css.

Sourcemap is available if your Sass version is greater than 3.3.0.

Note when you share your theme on WordPress.org directory

svn:ignore node_modules directory

Feedbacks

Feedbacks are very much welcome!

Contributors