Skip to content

Commit 3ff4328

Browse files
Increment version and update README
1 parent 1ae333a commit 3ff4328

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This gem uses [PhantomJS](https://github.com/colszowka/phantomjs-gem) and [Penth
1414
Add `critical-path-css-rails` to your Gemfile:
1515

1616
```
17-
gem 'critical-path-css-rails', '~> 0.1.0'
17+
gem 'critical-path-css-rails', '~> 0.2.0'
1818
```
1919

2020
Download and install by running:
@@ -23,24 +23,26 @@ Download and install by running:
2323
bundle install
2424
```
2525

26-
Create the rake task that will generate your critical CSS
26+
Run the generator to install the rake task and configuration file:
2727

2828
```
2929
rails generator critical_path_css:install
3030
```
3131

32-
This adds the following file:
32+
The generator adds the following files:
3333

34+
* `config/critical_path_css.yml`
3435
* `lib/tasks/critical_path_css.rake`
3536

3637

3738
## Usage
3839

39-
First, you'll need to configue a few variables in the rake task: `lib/tasks/critical_path_css.rake`
40+
First, you'll need to configue a few things in the YAML file: `config/critical_path_css.yml`
4041

41-
* `@base_url`: Change the url's here to match your Production and Development base URL, respectively.
42-
* `@routes`: List the routes that you would like to generate the critical CSS for. (i.e. /resources, /resources/show/1, etc.)
43-
* `@main_css_path`: Inside of the generate task, you'll need to define the path to the application's main CSS. The gem assumes your CSS lives in `RAILS_ROOT/public`. If your main CSS file is in `RAILS_ROOT/public/assets/main.css`, you would set the variable to `/assets/main.css`.
42+
* `manifest_name`: If you're using the asset pipeline, add the manifest name.
43+
* `css_path`: If you're not using the asset pipeline, you'll need to define the path to the application's main CSS. The gem assumes your CSS lives in `RAILS_ROOT/public`. If your main CSS file is in `RAILS_ROOT/public/assets/main.css`, you would set the variable to `/assets/main.css`.
44+
* `routes`: List the routes that you would like to generate the critical CSS for. (i.e. /resources, /resources/show/1, etc.)
45+
* `base_url`: Add your application's URL for the necessary environments.
4446

4547

4648
Before generating the CSS, ensure that your application is running (viewable from a browser) and the main CSS file exists. Then in a separate tab, run the rake task to generate the critical CSS.
@@ -57,15 +59,15 @@ rake critical_path_css:generate
5759

5860
To load the generated critical CSS into your layout, in the head tag, insert:
5961

60-
```html
62+
```HTML+ERB
6163
<style>
6264
<%= CriticalPathCss.fetch(request.path) %>
6365
</style>
6466
```
6567

6668
A simple example using loadcss-rails looks like:
6769

68-
```html
70+
```HTML+ERB
6971
<style>
7072
<%= CriticalPathCss.fetch(request.path) %>
7173
</style>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module CriticalPathCSS
22
module Rails
3-
VERSION = '0.1.0'
3+
VERSION = '0.2.0'
44
PENTHOUSE_VERSION = '0.3.4'
55
end
66
end

0 commit comments

Comments
 (0)