File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 3
3
[ ![ Latest Stable Version] ( https://poser.pugx.org/nochso/html-compress-twig/v/stable )] ( https://packagist.org/packages/nochso/html-compress-twig )
4
4
[ ![ License] ( https://poser.pugx.org/nochso/html-compress-twig/license )] ( LICENSE )
5
5
6
- A Twig extension for [ WyriHaximus/HtmlCompress] ( https://github.com/WyriHaximus/HtmlCompress ) .
6
+ A [ Twig] ( http://twig.sensiolabs.org/ ) extension for [ WyriHaximus/HtmlCompress] ( https://github.com/WyriHaximus/HtmlCompress ) .
7
7
8
- Currently supported twig features are:
8
+ Currently supported Twig features are:
9
9
10
- * Tags
10
+ * Tag
11
11
* ` {% htmlcompress %} ... {% endhtmlcompress %} `
12
+ * Function
13
+ * ` {{ htmlcompress('some html') }} `
14
+ * Filter
15
+ * ` {{ content|markdown|htmlcompress }} `
12
16
13
- The HTML, inline CSS and Javascript will be compressed.
17
+ Any HTML, inline CSS and Javascript will be compressed.
14
18
15
19
* [ Installation] ( #installation )
16
20
* [ Usage] ( #usage )
@@ -38,10 +42,9 @@ $twig->addExtension(new \nochso\HtmlCompressTwig\Extension());
38
42
Then use it in your templates:
39
43
40
44
```
41
- // layout.twig
42
- {% htmlcompress %}
43
- ...
44
- {% endhtmlcompress %}
45
+ {% htmlcompress %}{% endhtmlcompress %}
46
+ {{ htmlcompress('<ul > <li >') }}
47
+ {{ '<ul > <li >'|htmlcompress }}
45
48
```
46
49
47
50
**Compression is disabled by Twig's `debug` setting.** This is to make development easier, however you can always
@@ -57,7 +60,7 @@ $twig->addExtension(new \nochso\HtmlCompressTwig\Extension(true));
57
60
58
61
## History
59
62
60
- ### 0.1.0 - 2015-10-??
63
+ ### 0.1.0 - 2015-10-05
61
64
First public release.
62
65
63
66
## License
You can’t perform that action at this time.
0 commit comments