Skip to content

Commit f35fdfb

Browse files
committed
feature #33 Moved web assets to web/ and implemented a pure PHP compression solution for CSS and JS files (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #33). Discussion ---------- Moved web assets to web/ and implemented a pure PHP compression solution for CSS and JS files This fixes #5 Commits ------- b9d2f1e Moved web assets to web/ and implemented a pure PHP compression solution for CSS and JS files
2 parents 269991e + b9d2f1e commit f35fdfb

18 files changed

+319
-7685
lines changed

CONTRIBUTING.ms

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Contributing
2+
============
3+
4+
The Symfony Demo application is an open source project. Contributions made by
5+
the community are welcome. Send us your ideas, code reviews, pull requests and
6+
feature requests to help us improve this project. All contributions must follow
7+
the [usual Symfony contribution requirements](http://symfony.com/doc/current/contributing/index.html).
8+
9+
Web Assets Management
10+
---------------------
11+
12+
This project manages its web assets in a special way to allow them to work
13+
without configuring any option, installing any tool or executing any command.
14+
If your contribution changes CSS styles or JavaScript code in any way, make
15+
sure to regenerate the `web/css/app.css` and `web/js/app.js` files. To do so,
16+
uncomment the Assetic blocks in the `app/Resources/views/base.html.twig` and
17+
execute the following command:
18+
19+
```bash
20+
$ php app/console assetic:dump --no-debug
21+
```

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ $ cd symfony-demo/
4848
$ php app/console server:run
4949
```
5050

51-
This command will start a web server for the Symfony application. Now you can access
52-
the application in your browser at <http://localhost:8000>. You can stop the built-in
53-
web server by pressing `Ctrl + C` while you're in the terminal.
51+
This command will start a web server for the Symfony application. Now you can
52+
access the application in your browser at <http://localhost:8000>. You can
53+
stop the built-in web server by pressing `Ctrl + C` while you're in the
54+
terminal.
5455

5556
> **NOTE**
5657
>
Binary file not shown.
Binary file not shown.

app/Resources/assets/fonts/font-awesome/fontawesome-webfont.svg

Lines changed: 0 additions & 565 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-25 KB
Binary file not shown.
Binary file not shown.
-24.9 KB
Binary file not shown.
-24.1 KB
Binary file not shown.

app/Resources/views/base.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{% block stylesheets %}
1313
{# uncomment the following lines to compile SCSS assets with Assetic
1414
15-
{% stylesheets output="css/app.css"
15+
{% stylesheets filter="scssphp" output="css/app.css"
1616
"%kernel.root_dir%/Resources/assets/scss/bootstrap.scss"
1717
"%kernel.root_dir%/Resources/assets/scss/font-awesome.scss"
1818
"%kernel.root_dir%/Resources/assets/css/*.css"
@@ -133,10 +133,10 @@
133133
{% endblock %}
134134

135135
{% block javascripts %}
136-
{# uncomment the following lines to compile JavaScript assets with Assetic
137-
{% javascripts output="js/app.js"
138-
"%kernel.root_dir%/Resources/assets/js/jquery-2.1.4.min.js"
139-
"%kernel.root_dir%/Resources/assets/js/bootstrap-3.3.4.min.js"
136+
{# uncomment the following lines to combine and minimize JavaScript assets with Assetic
137+
{% javascripts filter="?jsqueeze" output="js/app.js"
138+
"%kernel.root_dir%/Resources/assets/js/jquery-2.1.4.js"
139+
"%kernel.root_dir%/Resources/assets/js/bootstrap-3.3.4.js"
140140
"%kernel.root_dir%/Resources/assets/js/highlight.pack.js" %}
141141
<script src="{{ asset_url }}"></script>
142142
{% endjavascripts %}

app/config/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ assetic:
5050
debug: "%kernel.debug%"
5151
use_controller: false
5252
bundles: [ ]
53-
#java: /usr/bin/java
5453
filters:
5554
cssrewrite: ~
56-
sass:
57-
bin: "/usr/bin/sass"
58-
apply_to: "\.scss$"
55+
jsqueeze: ~
56+
scssphp:
57+
# the formatter must be the FQCN (don't use the 'compressed' value)
58+
formatter: "Leafo\\ScssPhp\\Formatter\\Compressed"
5959

6060
# Doctrine Configuration (used to access databases and manipulate their information)
6161
doctrine:

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"erusev/parsedown" : "~1.5",
1616
"incenteev/composer-parameter-handler" : "~2.0",
1717
"ircmaxell/password-compat" : "~1.0",
18+
"leafo/scssphp" : "~0.1.",
19+
"patchwork/jsqueeze" : "~1.0",
1820
"sensio/distribution-bundle" : "~3.0.12",
1921
"sensio/framework-extra-bundle" : "~3.0",
2022
"symfony/assetic-bundle" : "~2.3",

composer.lock

Lines changed: 103 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)