Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit c9f1866

Browse files
committed
Updated pattern-managing-assets page
This is part of pattern-lab/patternlab-node#70 for version 1.0.0 release prep
1 parent 507a584 commit c9f1866

File tree

1 file changed

+18
-43
lines changed

1 file changed

+18
-43
lines changed

patternlabsite/docs/pattern-managing-assets.md

+18-43
Original file line numberDiff line numberDiff line change
@@ -58,57 +58,32 @@ Static assets like Javascript and CSS **are not** added automagically to your pa
5858

5959
{% capture m %}
6060

61-
Assets for patterns, including JavaScript, CSS, and images, should be stored in the `source/` directory. The Node version of Pattern Lab will move these assets to the `public/` directory for you when you generate your site or when you watch the `source/` directory for changes. You can name and nest your assets however you like. Pattern Lab Node ships with a `Gruntfile.js` task, `copy,` that can copy your assets for you. It looks like this:
61+
Assets for patterns, including JavaScript, CSS, and images, should be stored in the `source/` directory. The Node version of Pattern Lab will move these assets to the `public/` directory for you when you generate your site or when you watch the `source/` directory for changes. You can name and nest your assets however you like. Pattern Lab Node ships with copy tasks in the `Gruntfile.js` or `Gulpfile.js` that copy your assets for you. Here's an example of the from the `Gruntfile`:
6262

6363

64-
copy: {
64+
copy: {
6565
main: {
66-
files: [
67-
{
68-
expand: true,
69-
cwd: './source/js/',
70-
src: '*',
71-
dest: './public/js/'
72-
},
73-
{
74-
expand: true,
75-
cwd: './source/css/',
76-
src: 'style.css',
77-
dest: './public/css/'
78-
},
79-
{
80-
expand: true,
81-
cwd: './source/images/',
82-
src: ['*.png', '*.jpg', '*.gif', '*.jpeg'],
83-
dest: './public/images/'
84-
},
85-
{
86-
expand: true,
87-
cwd: './source/images/sample/',
88-
src: ['*.png', '*.jpg', '*.gif', '*.jpeg'],
89-
dest: './public/images/sample/'
90-
},
91-
{
92-
expand: true,
93-
cwd: './source/fonts/',
94-
src: '*',
95-
dest: './public/fonts/'
96-
},
97-
{
98-
expand: true,
99-
cwd: './source/_data/',
100-
src: 'annotations.js',
101-
dest: './public/data/'
102-
}
103-
]
66+
files: [
67+
{ expand: true, cwd: './source/js/', src: '*', dest: './public/js/'},
68+
{ expand: true, cwd: './source/css/', src: '*.css', dest: './public/css/' },
69+
{ expand: true, cwd: './source/images/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/' },
70+
{ expand: true, cwd: './source/images/sample/', src: ['*.png', '*.jpg', '*.gif', '*.jpeg'], dest: './public/images/sample/'},
71+
{ expand: true, cwd: './source/fonts/', src: '*', dest: './public/fonts/'},
72+
{ expand: true, cwd: './source/_data/', src: 'annotations.js', dest: './public/data/' }
73+
]
74+
},
75+
css: {
76+
files: [
77+
{ expand: true, cwd: './source/css/', src: '*.css', dest: './public/css/' }
78+
]
10479
}
105-
}
80+
},
10681

107-
This structure is meant to be extended to suit your purposes. Change targets, move files, or ignore certain filetypes altogether. **Note**: If you make changes to `Gruntfile.js`, such as to copy a new directory, and have [auto re-generation and browser reload enabled](/docs/node/advanced-auto-reloading-the-browser.html), you will need to stop and start your grunt tasks to pick up the changes.
82+
This structure is meant to be extended to suit your purposes. Change targets, move files, or ignore certain filetypes altogether. **Note**: If you make changes to `Gruntfile.js` or `Gulpfile.js`, such as to copy a new directory, and have [auto re-generation and browser reload enabled](/docs/node/advanced-auto-reloading-the-browser.html), you will need to stop and start your tasks to pick up the changes.
10883

10984
{% endcapture %}
11085
{{ m | markdownify }}
11186

11287
</div>
11388

114-
<!--- end node -->
89+
<!--- end node -->

0 commit comments

Comments
 (0)