|
1 | | -# Imgix Url plugin for Craft CMS |
| 1 | +# imgixurl plugin for Craft CMS 3.x |
2 | 2 |
|
3 | | -Build imgix urls, including secure images. |
| 3 | +Build imgix urls from assets, including secure images. |
4 | 4 |
|
5 | | -```twig |
6 | | -<img src="{{ craft.imgixUrl.getUrl(imageAsset, {w: 75}) }}" alt="75px Image from imgix!"> |
7 | | -``` |
| 5 | + |
| 6 | + |
| 7 | +## Requirements |
| 8 | + |
| 9 | +This plugin requires Craft CMS 3.0.0-beta.23 or later. |
8 | 10 |
|
9 | 11 | ## Installation |
10 | 12 |
|
11 | | -To install Imgix Url, follow these steps: |
| 13 | +To install the plugin, follow these instructions. |
| 14 | + |
| 15 | +1. Open your terminal and go to your Craft project: |
| 16 | + |
| 17 | + cd /path/to/project |
12 | 18 |
|
13 | | -1. Download & unzip the file and place the `imgixurl` directory into your `craft/plugins` directory |
14 | | -2. Install plugin in the Craft Control Panel under Settings > Plugins |
15 | | -3. The plugin folder should be named `imgixurl` for Craft to see it. GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads. |
16 | | -4. Copy the `config-sample.php` file to `craft/config/imgixurl.php` and make the needed changes |
| 19 | +2. Then tell Composer to load the plugin: |
17 | 20 |
|
18 | | -Imgix Url works on Craft 2.4.x and Craft 2.5.x. |
| 21 | + composer require craft-imgixurl/imgixurl |
19 | 22 |
|
20 | | -## Imgix Url Overview |
| 23 | +3. In the Control Panel, go to Settings → Plugins and click the “Install” button for imgixurl. |
21 | 24 |
|
22 | | -This is a fairly basic plugin to build imgix urls from craft image assets. In the config file, you provide a list of sources, and optionally some default settings. |
| 25 | +## imgixurl Overview |
23 | 26 |
|
24 | | -Then in your templates, you can simply output imgix urls using [any settings you'd like](https://docs.imgix.com/apis/url). |
| 27 | +-Insert text here- |
25 | 28 |
|
26 | | -The sources can optionally support [secure image tokens](https://docs.imgix.com/setup/securing-images) as well. |
| 29 | +## Configuring imgixurl |
27 | 30 |
|
28 | | -## Configuring Imgix Url |
| 31 | +-Insert text here- |
29 | 32 |
|
30 | | -#### Config file: |
31 | | -```php |
32 | | -// Copy this file to /craft/config/imgixurl.php |
| 33 | +## Using imgixurl |
33 | 34 |
|
34 | | -return array( |
35 | | - '*' => array( |
36 | | - 'defaultSettings' => array( |
37 | | - "auto" => "compress,format" |
38 | | - ), |
39 | | - 'sources' => array( |
40 | | - array( |
41 | | - 's3' => 'sampledomain.s3.amazonaws.com', |
42 | | - 'imgix' => 'https://sampledomain.imgix.net', |
43 | | - 'token' => 'abcde12345', // optional |
44 | | - // see https://docs.imgix.com/setup/securing-images for more on secure token. |
45 | | - ) |
46 | | - ) |
47 | | - ) |
48 | | - // '.dev' => array() |
49 | | - // this would allow you to turn off imgix routing on .dev domains, saving you some bandwidth. |
50 | | - // the full image url would be returned. |
51 | | -); |
52 | | -``` |
| 35 | +-Insert text here- |
53 | 36 |
|
54 | | -## Using Imgix Url |
| 37 | +## imgixurl Roadmap |
55 | 38 |
|
56 | | -```twig |
57 | | -<img src="{{ craft.imgixUrl.getUrl(imageAsset, {w: 75}) }}" alt="75px Image from imgix!"> |
58 | | -``` |
| 39 | +Some things to do, and ideas for potential features: |
59 | 40 |
|
60 | | -The plugin simply outputs a url, so it's up to you to create any markup, including responsive images. Imgix makes a lot of this very simple though, especially for [simple pixel-density cases](https://docs.imgix.com/apis/url/dpr): |
| 41 | +* Release it |
61 | 42 |
|
62 | | -```twig |
63 | | -<img |
64 | | - src="{{ craft.imgixUrl.getUrl(imageAsset, {w: 75}) }}" |
65 | | - srcset="{{ craft.imgixUrl.getUrl(imageAsset, {w: 75, dpr: 2}) }} 2x" |
66 | | - alt="75px Image and 2x image from imgix!" |
67 | | -> |
68 | | -``` |
| 43 | +Brought to you by [sprokets](https://sprokets.net) |
0 commit comments