Skip to content

Commit 56edac3

Browse files
committed
Build improvements
1 parent 0ed3ae1 commit 56edac3

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

Gruntfile.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,19 @@ module.exports = function (grunt)
105105
dest: 'public/'
106106
}
107107
]
108-
}
108+
},
109+
// Copy mockups to mockups directory and design patterns doc to public (root) directory.
110+
html: {
111+
files: [
112+
{
113+
expand: true,
114+
cwd: '<%= paths.src.mockups %>',
115+
src: '**',
116+
dest: '<%= paths.dest.mockups %>'
117+
},
118+
{'public/design-patterns.html': 'src/docs/design-patterns.html'}
119+
]
120+
},
109121
},
110122

111123
// Check code quality of Gruntfile.js and site-specific JavaScript using JSHint.
@@ -152,37 +164,31 @@ module.exports = function (grunt)
152164
}
153165
},
154166

155-
// Generate filename timestamps within templates/mockup files.
167+
// Generate filename timestamps and version numbers.
156168
replace: {
157169
theme: {
158170
options: {
159171
patterns: [
160172
{
161173
match: 'timestamp',
162174
replacement: '<%= opt.timestamp %>'
175+
},
176+
{
177+
match: 'version',
178+
replacement: '<%= pkg.version %>'
163179
}
164180
]
165181
},
166182
files: [
167-
// Copy mockups to mockups directory.
168-
{
169-
expand: true,
170-
cwd: '<%= paths.src.mockups %>',
171-
src: '**',
172-
dest: '<%= paths.dest.mockups %>'
173-
},
174-
// Copy design patterns doc to public (root) directory.
175-
{
176-
src: 'src/docs/design-patterns.html',
177-
dest: 'public/design-patterns.html'
178-
},
179183
// Copy Textpattern templates to themes directory.
180184
{
181185
expand: true,
182186
cwd: '<%= paths.src.templates %>',
183-
src: '**',
187+
src: ['**', '!manifest.json'],
184188
dest: '<%= paths.dest.templates %>'
185-
}
189+
},
190+
// Generate version number automatically in theme manifest.json file.
191+
{'<%= paths.dest.templates %>manifest.json': '<%= paths.src.templates %>manifest.json'}
186192
]
187193
}
188194
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "textpattern-com",
33
"description": "Official website of the Textpattern project.",
4-
"version": "1.6.2",
4+
"version": "1.6.3",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/textpattern/textpattern-com-website"

src/templates/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Textpattern.com",
33
"txp-type": "textpattern-theme",
4-
"version": "1.6.2",
4+
"version": "@@version",
55
"description": "Textpattern.com site theme.",
66
"author": "Phil Wareham",
77
"author_uri": "https://github.com/textpattern/textpattern-com-website"

0 commit comments

Comments
 (0)