Skip to content

Commit c33520a

Browse files
committed
Tasks: Add lint and build-wordpress tasks
Defining a standard build-wordpress task removes some boilerplate from every site's Gruntfile.
1 parent 4628276 commit c33520a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ This module builds on top of [grunt-wordpress](https://github.com/scottgonzalez/
1010

1111
This task removes all files in the `dist/` directory.
1212

13+
### lint
14+
15+
This is an empty task list. If the site contains any lint checks, they should be defined here. For example, API sites should have the following task list:
16+
17+
```
18+
grunt.registerTask( "lint", [ "xmllint" ] );
19+
```
20+
21+
### build
22+
23+
This is a task list that must be defined per site, containing all of the build steps. A simple site would have the following task list:
24+
25+
```
26+
grunt.registerTask( "build", [ "build-pages", "build-resources" ] );
27+
```
28+
1329
### build-pages
1430

1531
This multi-task takes a list of html or markdown files, copies them to `[wordpress.dir]/posts/page/`, processes `@partial` entries and highlights the syntax in each.

tasks/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ grunt.registerTask( "clean-dist", function() {
1515
rimraf.sync( "dist" );
1616
});
1717

18+
// Define an empty lint task, to be redefined by each site with relevant lint tasks
19+
grunt.registerTask( "lint", [] );
20+
21+
grunt.registerTask( "build-wordpress", [ "check-modules", "lint", "clean-dist", "build" ] );
22+
1823
grunt.registerMultiTask( "build-pages", "Process html and markdown files as pages, include @partials and syntax higlight code snippets", function() {
1924
var task = this,
2025
taskDone = task.async(),

0 commit comments

Comments
 (0)