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

Commit 9b25d11

Browse files
committed
Updated stopping public/ from being "cleaned" page
Broke our a separate Node Version Tab This is part of pattern-lab/patternlab-node#70 for version 1.0.0 release prep
1 parent fc6eb9f commit 9b25d11

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

patternlabsite/docs/advanced-clean-public.md

+49-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22
layout: docs
33
title: Stopping public/ from Being "Cleaned" | Pattern Lab
44
heading: Stopping `public/` from Being "Cleaned"
5+
languages:
6+
- language: php
7+
- language: node
58
---
69

7-
**Note:** *The cleanPublic configuration option was introduced in v0.7.0 of the PHP version of Pattern Lab.*
10+
<!--- start php -->
11+
12+
<div class="tab-panel" id="php">
13+
<h2 class="language-title">php</h2>
14+
15+
{% capture m %}
816

17+
**Note:** *The cleanPublic configuration option was introduced in v0.7.0 of the PHP version of Pattern Lab.*
918

1019
By default the PHP version of Pattern Lab deletes most of the files and directories found in `public/` when generating your site or starting the watch. Developers are supposed to use `source/` to store their files. This includes static assets like images, JavaScript and CSS. When generating your site the PHP version of Pattern Lab moves all of the static assets found in `source/` to `public/` (_after cleaning it_) so there shouldn't be a reason not to use `source/`.
1120

@@ -14,4 +23,42 @@ That said, developers might be more comfortable storing their static assets in `
1423
1. Open `config/config.ini`.
1524
2. Change the `cleanPublic` from `"true"` to `"false"`
1625

17-
When you next generate your site or start the watch `public/` will no longer be cleaned.
26+
When you next generate your site or start the watch `public/` will no longer be cleaned.
27+
28+
{% endcapture %}
29+
{{ m | markdownify }}
30+
31+
</div>
32+
33+
<!--- end php -->
34+
35+
36+
<!--- start node -->
37+
38+
<div class="tab-panel" id="node">
39+
<h2 class="language-title">node</h2>
40+
41+
{% capture m %}
42+
43+
By default the Node version of Pattern Lab deletes or overwrites most of the files and directories found in `public/` when generating your site or starting the watch. Developers are supposed to use `source/` to store their files. The build process and the copy task found in the [Gruntfile]() or [Gulpfile]() work in concert to move everything from `source/` to `public/`, including static assets like images, JavaScript and CSS. When generating your site the Node version of Pattern Lab moves all of the static assets found in `source/` to `public/` (_after cleaning it_) so there shouldn't be a reason not to use `source/`.
44+
45+
That said, developers might be more comfortable storing their static assets in `public/`. In order to turn-off the automatic overwriting of the `public/` directory:
46+
47+
If you use grunt...
48+
49+
1. Remove all or portions of the `copy` task from your gruntfile to stop overwriting of the assets you want to remain in `public/`
50+
2. Inside `builder/patternlab_grunt.js`, change the flag inside calls to patternlab.build(true) and patternlab.build_patterns_only(true) to `false`.
51+
52+
If you use gulp...
53+
54+
1. Remove all or portions of the `cp:assettype` tasks from your gulpfile to stop overwriting of the assets you want to remain in `public/`, or alternatively alter the gulp tasks at the bottom of the gulpfile.
55+
2. Remove the `clean` tasks as a prerequisite from all other tasks, both in the gulpfile and in `builder/patternlab-gulp.js`
56+
57+
When you next generate your site or start the watch `public/` will no longer be cleaned.
58+
59+
{% endcapture %}
60+
{{ m | markdownify }}
61+
62+
</div>
63+
64+
<!--- end node -->

0 commit comments

Comments
 (0)