Basic Usage
1. Commands for Java Developer
Command format is mvn op:command -Dparam1=val1 -Dparam2=var2 ...
.
You can execute more than one goals in one command, like mvn op:command1 op:command2 ... -Dparam1=val1 -Dparam2=var2 ...
.
Available goals of this plugin:
- op:install - Install and initialize site/blog
- op:sass-compile - Compile the SASS files into css
- op:generate - Generate static site/blog
- op:build - Generate static site/blog, same as
generate
- op:preview - Start a web server for preview, monitor the site for changes and generate whenever it does
- op:deploy - Deploy site/blog to remote or local server
- op:clean - Clean site/blog templates cache and temp files
- op:new-page - Create new page file
- op:new-post - Create new post file
- op:sass-watch - Watch the SASS for changes and compile whenever it does.
- op:wordpress-import - Import posts and pages from the XML file that exported from WordPress
Click the link to see maven document for more information about the goal.
Note
- Goal
op:generate
is same as goalop:build
. - The plugin set
goalPrefix
asop
, so we can usemvn op:install
,mvn op:generate
ormvn opoopress:install
,mvn opoopress:generate
.
OpooPress Phases
- Install & Initialize
- Core function: Install and initialize blog/site
- Goals:
op:install
,op:clean
- Build Theme
- Core function: build theme
- Goals:
op:sass-compile
,op:sass-watch
,op:new-post
,op:new-page
,op:import
- Generate Site
- Core function: generate static site
- Goals:
op:generate
,op:build
- Preview & Deploy
- Core function: no
- Goals:
op:preview
,op:deply
There are two rules for these phases:
- The previous phase core function will be executed first before the execution of any current phase goals.
- The previous phase core function will be executed first before the execution of current phase core function.
Examples:
op:preview
: the dependency chain will beop:preview -> Generate Site -> Build Theme -> Install & Initialize
, and the execution order will beInstall & Initialize -> Build Theme -> Generate Site -> Start Preview
op:new-post
: the dependency chain will beop:new-post -> Install & Initialize
, and the execution order will beInstall & Initialize -> Create new post
.
2. Commands for Non-Developer
Command format is `op command [options]
.
for Windows ONLY currently
Command list:
- install - Install and initialize site/blog
- sass-compile - Compile the SASS files into css
- generate - Generate static site/blog
- build - Generate static site/blog, same as
generate
- preview - Start a web server for preview, monitor the site for changes and generate whenever it does
- deploy - Deploy site/blog to remote or local server
- clean - Clean site/blog templates cache and temp files
- new-page - Create new page file
- new-post - Create new post file
- sass-watch - Watch the SASS for changes and compile whenever it does.
- wordpress-import - Import posts and pages from the XML file that exported from WordPress
Examples:
- Initialize a new blog:
D:\opoopress-${site.op_current_version}>op install
- Preview blog in browser:
D:\opoopress-${site.op_current_version}>op preview
- Deploy blog to server:
D:\opoopress-${site.op_current_version}>op deploy