Add a task for building templates
This commit is contained in:
parent
68378b1e86
commit
6c72e6200f
2 changed files with 52 additions and 1 deletions
|
@ -45,6 +45,16 @@ export class Settings
|
|||
*/
|
||||
private stylePath = "css";
|
||||
|
||||
/**
|
||||
* The path to the root of the template-source.
|
||||
*/
|
||||
private templateSource = "Templates";
|
||||
|
||||
/**
|
||||
* The path to save the templates to.
|
||||
*/
|
||||
private templatePath = "templates";
|
||||
|
||||
/**
|
||||
* The path to the test-directory.
|
||||
*/
|
||||
|
@ -172,6 +182,34 @@ export class Settings
|
|||
return this.RootPath(this.stylePath, ...path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a path relative to the root of the template-source.
|
||||
*
|
||||
* @param path
|
||||
* The path to join.
|
||||
*
|
||||
* @returns
|
||||
* The joined path.
|
||||
*/
|
||||
public TemplateSource(...path: string[])
|
||||
{
|
||||
return this.SourceRoot(this.templateSource, ...path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a path relative to the directory to save the templates to.
|
||||
*
|
||||
* @param path
|
||||
* The path to join.
|
||||
*
|
||||
* @returns
|
||||
* The joined path.
|
||||
*/
|
||||
public TemplatePath(...path: string[])
|
||||
{
|
||||
return this.RootPath(this.templatePath, ...path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a path relative to the test-directory.
|
||||
*
|
||||
|
|
15
gulpfile.ts
15
gulpfile.ts
|
@ -157,7 +157,8 @@ export async function Build()
|
|||
await Promise.all(
|
||||
[
|
||||
Library(),
|
||||
Theme()
|
||||
Theme(),
|
||||
Templates()
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -315,6 +316,18 @@ export async function Theme()
|
|||
|
||||
Theme.description = "Builds the theme.";
|
||||
|
||||
/**
|
||||
* Builds the templates.
|
||||
*/
|
||||
export function Templates()
|
||||
{
|
||||
return gulp.src(
|
||||
settings.TemplateSource("**")).pipe(
|
||||
gulp.dest(settings.TemplatePath()));
|
||||
}
|
||||
|
||||
Templates.description = "Builds the templates.";
|
||||
|
||||
/**
|
||||
* Stops a watch-task.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue