https://github.com/endroid/embed
Twig extension for embedding external resources
https://github.com/endroid/embed
Last synced: 3 months ago
JSON representation
Twig extension for embedding external resources
- Host: GitHub
- URL: https://github.com/endroid/embed
- Owner: endroid
- License: mit
- Created: 2018-04-08T11:24:55.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T23:13:41.000Z (over 1 year ago)
- Last Synced: 2025-03-18T10:21:18.118Z (over 1 year ago)
- Language: PHP
- Homepage: https://endroid.nl/
- Size: 30.3 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Embed
*By [endroid](https://endroid.nl/)*
[](https://packagist.org/packages/endroid/embed)
[](https://github.com/endroid/embed/actions)
[](https://packagist.org/packages/endroid/embed)
[](https://packagist.org/packages/endroid/embed)
Library for embedding external resources and reduce the number of requests.
Read the [blog](https://medium.com/@endroid/pdf-generation-in-symfony-3080702353b)
for more information on why I created this extension.
## Usage
This library helps you reduce the number of external resources to load by
allowing you to embed external resources via a Twig extension. You can use this
extension to embed resources like fonts, stylesheets, scripts etc.
```php
@font-face {
font-family: 'SCP';
font-weight: normal;
src: url('{{ embed('https://fontlibrary.org/scp.ttf') }}');
}
```
## Installation
Use [Composer](https://getcomposer.org/) to install the library.
``` bash
$ composer require endroid/embed
```
When you use Symfony, the [installer](https://github.com/endroid/installer)
makes sure that services are automatically wired.. If this is not the case you
can find the configuration files in the `.install/symfony` folder.
## Versioning
Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatible
changes will be kept to a minimum but be aware that these can occur. Lock
your dependencies for production and test your code when upgrading.
## License
This bundle is under the MIT license. For the full copyright and license
information please view the LICENSE file that was distributed with this source code.