https://github.com/jpdevries/generator-yomonger
Yeoman Generator for MODX Manager Themes
https://github.com/jpdevries/generator-yomonger
Last synced: 12 months ago
JSON representation
Yeoman Generator for MODX Manager Themes
- Host: GitHub
- URL: https://github.com/jpdevries/generator-yomonger
- Owner: jpdevries
- License: mit
- Created: 2013-11-22T07:32:52.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-22T02:14:17.000Z (about 12 years ago)
- Last Synced: 2025-03-30T20:01:33.337Z (12 months ago)
- Language: CSS
- Size: 907 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
yomonger
========
[1]:http://yeoman.io/generators.html
[2]:https://github.com/modxcms/revolution/tree/develop/_build/templates/default#contribution-guides
[3]:http://devries.jp/blog/2013/11/22/meet-yomonger/#watch-screencast

Meet yomonger (yo-modx-manager), a friendly little monster that lives in your computer. He loves three things:
* asking you a couple questions
* bootstrapping your [MODX Manager theme][2]
* being a [Yeoman generator][1]
## Getting Started
The first thing we need to do, is make sure yomonger is happy. He is self consious about not being installed on every computer, but once he is setup on yours he is quickly satisfied. If you need some more convicing, you can [watch a 3min screencast][3] on Yomonger in action.
From your terminal, run:
```bash
npm install -g yo generator-yomonger
```
Now that you've installed yo and generator-yomonger globally you can use it from within any directory. While yomonger can occupy any directory, he'd much prefer to be within a local MODX install so he knows his way around a bit. So if you have one, let's head there and make our own theme. We'll call it `custom-theme`.
#### Creating a Theme Directory
```bash
# go to wherever your MODX install is
cd ~/Sites/modx/revolution/
# make a template directory
mkdir manager/templates/custom-theme
```
_Note: Manually creating the theme directory is optional. Yomonger will take it upon himself if necessary, but he just wants to make sure you know where your stuff will wind up._
Great, that is where yomonger will assume he should create your project. Let's get him focused on the task at hand.
#### Creating a build directory
```bash
# go to wherever your MODX install is
cd ~/Sites/modx/revolution/
# make a build directory
cd _build/templates
mkdir custom-theme && cd $_
```
We are almost ready to let yomonger do his thing. But first, make note of your `manager/templates/custom-theme` directory relative to your build directory. It should be `../../../manager/templates/custom-theme`. By default yomonger will hop up three directories (you should see him do it to) and then scurry into the `manager/templates` directory looking for a folder with the name of your theme. If you want him to go somewhere else, you can tell him so but not until he asks.
## Generating a Project
From the terminal, run:
```bash
yo yomonger
```
You'll be greated by a friendly fellow named yeoman and then be asked several questions. Choose your answers carefully and let's meet back here when you are through.
```bash
_-----_
| |
|--(o)--| .--------------------------.
`---------´ | Welcome to Yeoman, |
( _´U`_ ) | ladies and gentlemen! |
/___A___\ '__________________________'
| ~ |
__'.___.'__
´ ` |° ´ Y `
```
...
Well hello there. That didn't take log. Let's see if he generated all your stuff.
```bash
├── .editorconfig
├── .jshintrc
├── bower.json
├── Gruntfile.js
├── package.json
```
He snuck a little something in there didn't he? Well probably that's because you told him to. If you asked for Sass you'll have a `sass` directory:
```bash
├── sass
│ ├── index.scss
│ ├── login.scss
```
If you asked to start with the included Sass files of the default manager theme he moved several files into place for you. Did you give him a tip?
```bash
├── sass
│ ├── _box-sizing.scss
│ ├── __buttons.scss
│ ├── _colors-and-vars.scss
│ ├── _forms.scss
│ ├── _help.scss
│ ├── _image-set.scss
│ ├── _navbar.scss
│ ├── _tabs.scss
│ ├── _tree.scss
│ ├── _uberbar.scss
│ ├── _utility.scss
│ ├── _xtheme-modx.scss
│ ├── components
│ ├── _components.scss
│ ├── _primary-button.scss
│ ├── _shaded-box.scss
│ ├── index.scss
│ ├── index.scss
```
If you went with Less or raw CSS, well you know what you got.
## Building a Project
Now yomonger is a little compulsive, so he probably already did this for you. That's why you saw a bunch of npm stuff get installed. Let's have a look at what he did.
First he installed your node dependencies for you like this:
```bash
npm install
```
Then he just couldn't stand it, and had to see if your project would build successfully. Awesome, you got the works, all the grunt tasks you expect when [contributing to the default Manager theme](https://github.com/modxcms/revolution/tree/develop/_build/templates/default).
```bash
grunt build
```
Grunt Commands
----------------------------
__Build__
Fetch dependencies (such as bourbon), move items into place and compile by running:
```bash
grunt build
```
__Watch__
Watch files for changes type the following:
```bash
grunt
```
_Note: grunt is now watching files for changes. When Sass files are changed CSS will automatically be generated.
Install the LiveReload [browser extension](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-) to inject CSS changes without a page refresh._
__Expand__
Compile Sass using expanded output style for development by running:
```bash
grunt expand
```