Skip to content

Commit

Permalink
Merge branch 'master' into v1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
husseinalhammad committed May 8, 2019
2 parents 34b5ab7 + 69aa3e7 commit 86643c9
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,30 @@ In this example, CSS files need to be in `assets/css` and `src/css`, and Javascr
└── perch
```

The `perch_get_css()` and `perch_get_javascript()` functions have several options you can use giving you a lot of flexibility to control what gets inserted into your document and in what order. For more details check the [Function Reference](https://grabapipit.com/pipits/feathers/pinion/docs/functions) page.
The `perch_get_css()` and `perch_get_javascript()` functions have several options you can use giving you a lot of flexibility to control what gets inserted into your document and in what order. For more details check the [Function Reference](https://grabapipit.com/pipits/feathers/pinion/docs/functions) page.


### Cache Busting

If you want to use Pinion's cache busting feature, you need to add the following to your `.htaccess` file:

```php
RewriteRule ^(.+)\.(\d+)\.(js|css)$ $1.$3 [L]
```

If you are using Runway, make sure to add it before `RewriteCond %{REQUEST_URI} !^/perch`:

```php
# Perch Runway
RewriteEngine On
RewriteRule ^(.+)\.(\d+)\.(js|css)$ $1.$3 [L]
RewriteCond %{REQUEST_URI} !^/perch
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /perch/core/runway/start.php [L]
```

If you are already handling renaming your file with a task manager like Gulp or Grunt (using `gulp-cache-bust` or `grunt-cache-bust`), then there's no need to use this feature.

If you are adding a version to your file name (e.g. `styles.v2.0.css`), then you shouldn't to use this feature.

If your files are named like `styles.css`, this is for you.

0 comments on commit 86643c9

Please sign in to comment.