Skip to content

namuit/wordless_gem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordless logo

A command line tool to help manage your Wordless-based WordPress sites.

Build Status

Premise

This is a ruby-gem, so we expect you have already installed ruby; if it isn't the case, probably you'll like to take a look to rbenv.

Wordless can't can recognize if you are inside a wordpress' dirtree if you won't be in the root dir are in any subdirectory, starting from commit df5e408. so use it from the root dir. Easy peasy.

Installation

gem install wordless

Usage

wordless help

Tasks:
  wordless clean         # Clean static assets
  wordless compile       # Compile static assets
  wordless deploy        # Deploy your WordPress site using the deploy_command defined in your Wordfile
  wordless help [TASK]   # Describe available tasks or one specific task
  wordless install       # Install the Wordless plugin into an existing WordPress installation
  wordless new [NAME]    # Download WordPress in specified directory, install the Wordless plugin and create a Wordless theme
  wordless theme [NAME]  # Create a new Wordless theme NAME

new

Create a new Wordless-enabled WordPress site in directory mysite. This downloads the latest stable release of WordPress (you can also specify a locale):

wordless new mysite
Options:
      [--force]                          # Overwrite existing WP-CLI / WP-CLI Server installation
  -l, [--locale=LOCALE]                  # WordPress locale
                                         # Default: en_US
  -b, [--bare=BARE]                      # Remove default themes and plugins
                                         # Default: true
      [--admin-user=ADMIN_USER]          # WordPress admin user
                                         # Default: admin
      [--admin-email=ADMIN_EMAIL]        # WordPress admin email
                                         # Default: admin@example.com
      [--admin-password=ADMIN_PASSWORD]  # WordPress admin password
                                         # Default: password
      [--db-user=DB_USER]                # MySQL database user
                                         # Default: root
      [--db-password=DB_PASSWORD]        # MySQL database pasword
      [--site-url=SITE_URL]              # Wordpress site URL
                                         # Default: http://localhost:8080
caveats
  • Default db-password is no password

install

If you already have WordPress installed, you can install the Wordless plugin (this currently installs from the master branch on GitHub):

wordless install

theme

Once Wordless is installed, you can create a new Wordless theme:

wordless theme mytheme

Note: don't try at home to use wordless theme .: it won't work! So call it within the wp-content/themes dir and pass a theme name as argument.

compile

Note: if you have no idea why the need to compile assets, you should read the Wordless' README.

Compile your site's static assets:

wordless compile

clean

Clean your compiled static assets:

wordless clean

deploy

Deploy your wordless installation using the deploy_command specified in your Wordfile:

wordless deploy

You can also use the refresh option -r to compile your assets before deploying and clean your assets after:

wordless deploy -r

Configuration

You can, optionally, create a Wordfile to customize the behaviour of wordless:

wordless_repo: 'git://github.com/welaika/wordless.git'
static_css:
  - 'wp-content/themes/mytheme/assets/stylesheets/screen.css'
  - 'wp-content/themes/mytheme/assets/stylesheets/print.css'
static_js:
  - 'wp-content/themes/mytheme/assets/javascripts/application.js'
  - 'wp-content/themes/mytheme/assets/javascripts/mobile.js'
deploy_command: 'wordmove push -t'

Note: remember to add screen.css and/or application.js if you want to define static_css or static_js

Caveats

  • If you attempt to download a WordPress localization that's outdated, the latest English version will be downloaded instead.
  • Not tested on Windows

Running specs

bundle install && ./bin/setup.sh && rspec

We've noticed problems running tests while using rvm; all of them solved using rbenv. We have some clues about the problem, but we are ignoring it at the moment. We have switched the CI tool to sempaphore, which use rbenv, so pull requests will be tested in a working environement.

Need more tools?

Visit Wordpress Tools.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Add some specs
  4. Commit your changes (git commit -am 'Added some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

About

Command line tool to manage Wordless themes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 86.0%
  • PHP 10.6%
  • Shell 3.4%