-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e26e991
commit 66bd0a8
Showing
12 changed files
with
802 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,23 @@ | ||
The `assets` property on the options is used to calculate the relative path from any generated files (usually HTML) to whatever folder is specified in the `assets` option. For example, say you have the following template, `foo.hbs`: | ||
# options.assets | ||
|
||
```handlebars | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Foo</title> | ||
<link rel="stylesheet" href="\{{assets}}/css/styles.css"> | ||
</head> | ||
<body> | ||
\{{> body }} | ||
</body> | ||
</html> | ||
``` | ||
The `assets` property on the options is used to calculate the relative path from any generated files (usually HTML) to whatever folder is specified in the `assets` option. | ||
|
||
Note the `\{{assets}}` handlebars expression. When `foo.hbs` is rendered, this expression will be resolved with the value that is calculated from `foo`'s destination to whatever value is defined in `options.assets`. So this: | ||
**Example** | ||
|
||
Define the `assets` option in your project's [assemblefile.js](./assemblefile.md): | ||
|
||
```js | ||
assemble: { | ||
options: { | ||
assets: 'dist/public' | ||
}, | ||
site: { | ||
src: 'templates/foo.hbs', | ||
dest: 'dist/' | ||
} | ||
} | ||
assemble.option('assets', 'site/public'); | ||
``` | ||
|
||
Now you can use it in templates: | ||
|
||
```handlebars | ||
<link rel="stylesheet" href="{{assets}}/css/styles.css"> | ||
``` | ||
|
||
Results in `dist/foo.html`, with this content: | ||
Renders to: | ||
|
||
```handlebars | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Foo</title> | ||
<link rel="stylesheet" href="public/css/styles.css"> | ||
</head> | ||
<body> | ||
.... | ||
</body> | ||
</html> | ||
<link rel="stylesheet" href="site/public/css/styles.css"> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Tasks | ||
|
||
> TODO | ||
## Overview | ||
|
||
- | ||
|
||
|
||
**Examples** | ||
|
||
|
||
```js | ||
assemble.task('default', function() { | ||
assemble.src('templates/*.hbs') | ||
.pipe(assemble.dest('dist/')); | ||
}); | ||
``` | ||
|
||
**With plugins** | ||
|
||
```js | ||
assemble.task('default', function() { | ||
assemble.src('templates/*.hbs') | ||
.pipe(plugin1()) | ||
.pipe(plugin2()) | ||
.pipe(plugin3()) | ||
.pipe(assemble.dest('dist/')); | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.