Skip to content

Commit

Permalink
Merge pull request #32 from openeuropa/release-3.0.0
Browse files Browse the repository at this point in the history
Update CHANGELOG.md and README.md for release 3.0.0.
  • Loading branch information
ademarco authored Aug 12, 2021
2 parents cd1fdae + a80c122 commit d65f81b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [3.0.0](https://github.com/openeuropa/ecl-twig-loader/tree/) (2021-08-12)
[Full Changelog](https://github.com/openeuropa/ecl-twig-loader/compare/2.1.0...3.0.0)

**Merged pull requests:**

- EWPP-1146: Update test coverage for template prefixes. [\#28](https://github.com/openeuropa/ecl-twig-loader/pull/28) ([22Alexandra](https://github.com/22Alexandra))

## [2.1.0](https://github.com/openeuropa/ecl-twig-loader/tree/2.1.0) (2021-01-22)
[Full Changelog](https://github.com/openeuropa/ecl-twig-loader/compare/2.0.0...2.1.0)

Expand Down
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,58 @@
[![Build Status](https://drone.fpfis.eu/api/badges/openeuropa/ecl-twig-loader/status.svg)](https://drone.fpfis.eu/openeuropa/ecl-twig-loader/)
[![Packagist](https://img.shields.io/packagist/v/openeuropa/ecl-twig-loader.svg)](https://packagist.org/packages/openeuropa/ecl-twig-loader)

[Twig](http://twig.sensiolabs.org) loader for [Europa Component Library Twig implementation (ECL Twig)](https://github.com/ec-europa/ecl-twig),
[Twig](http://twig.sensiolabs.org) loader for [Europa Component Library Version 3](https://github.com/ec-europa/europa-component-library),
it allows to load components by accessing them via a configurable namespace.
For example, given you have the following ECL twig components:

For example, given you have the following ECL components:

```
/path/to/components/
├── ec-component-link
├── twig-component-link
│   └── ecl-link.html.twig
└── ec-component-language-list
   ├── ecl-language-list.html.twig
   ├── ecl-language-list-item.html.twig
   ├── ecl-language-list-overlay.html.twig
   └── ecl-language-list-splash.html.twig
└── twig-component-language-list
   ├── ecl-language-list.html.twig
   ├── ecl-language-list-grid.html.twig
   └── ecl-language-list-item.html.twig
```

If you setup the loader as follows:
If you set up the loader as follows:

```php
<?php

use \OpenEuropa\Twig\Loader\EuropaComponentLibraryLoader;

$loader = new EuropaComponentLibraryLoader(['ecl-twig'], '/components', '/path/to');
$loader = new EuropaComponentLibraryLoader(['ecl'], '/components', '/path/to');
$twig = new Twig_Environment($loader);
```

Then you can load the link component in the following way:

```twig
{% include '@ecl-twig/ec-component-link/ecl-link.html.twig' with {
link: {
{% include '@ecl/link/link.html.twig' with {
link: {
type: 'standalone',
label: 'Standalone link',
path: 'http://google.com',
icon_position: 'after'
label: 'Standalone link'
}
} %}
```

You can also use a shorter form, based on implicit naming conventions:

```twig
{% include '@ecl-twig/link' with {
{% include '@ecl/link' with {
link: {
type: 'standalone',
label: 'Standalone link',
path: 'http://google.com',
icon_position: 'after'
label: 'Standalone link'
}
} %}
```

To load sub-components append them after the component name:

```twig
{% include '@ecl-twig/language-list/language-list-splash' %}
{% include '@ecl/language-list/language-list-item' %}
```

## Installation using Docker Compose
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"extra": {
"composer-exit-on-patch-failure": true,
"enable-patching": true
},
"scripts": {
"changelog": "docker run --rm -v \"$(pwd):$(pwd)\" -w $(pwd) muccg/github-changelog-generator openeuropa/ecl-twig-loader -t $CHANGELOG_GITHUB_TOKEN --future-release=$CHANGELOG_FUTURE_RELEASE --release-branch=3.x"
}
}

0 comments on commit d65f81b

Please sign in to comment.