Newer
Older
Theme that represents all DSFR components as ui patterns plugins or alters.
Mikael Meulle
committed
# Installation
No matter the solution you choose, you need to install the DSFR library such that at the end,
the following file '/libraries/dsfr/dist/dsfr.module.js' should exist in your project,
relative to the drupal root directory.
## Install Manually
You need to place the DSFR library in the `libraries/dsfr` folder.
## With Composer
### Asset Packagist
If you are using the website [Asset Packagist](https://asset-packagist.org), the package 'npm-asset/gouvfr--dsfr' can be
downloaded from this repository. The composer.json of your Drupal project can be like below.
In the example, "web" is the drupal root directory (see the rule on package "type:drupal-core").
the project 'oomphinc/composer-installers-extender' is used to relocate the package 'npm-asset/gouvfr--dsfr'.
The relocation requires that :
- composer plugin 'oomphinc/composer-installers-extender' is allowed in section 'extra.config.allow-plugins',
- the package type 'npm-asset' is declared in the "extra.installer-types" section,
- the target directory for the package 'npm-asset/gouvfr--dsfr' is declared in the "extra.installer-paths" section.
```json
{
"require": {
Marc-Antoine Marty
committed
"npm-asset/gouvfr--dsfr": "1.10.2",
Mikael Meulle
committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"composer/installers": "^2",
"oomphinc/composer-installers-extender": "2.*"
},
"repositories": {
"asset-packagist": {
"type": "composer",
"url": "https://asset-packagist.org"
}
},
"extra": {
"config": {
"allow-plugins": {
"composer/installers": true,
"oomphinc/composer-installers-extender": true
}
},
"installer-types": [
"npm-asset"
],
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/dsfr": [
"npm-asset/gouvfr--dsfr"
]
}
}
}
```
### With a composer package repository
Example:
```json
{
"require": {
Marc-Antoine Marty
committed
"gouvernementfr/dsfr": "1.10.2",
Mikael Meulle
committed
"composer/installers": "2.*"
},
"repositories": {
"dsfr": {
"type": "package",
"package": {
"name": "gouvernementfr/dsfr",
"type": "drupal-library",
Marc-Antoine Marty
committed
"version": "1.10.2",
Mikael Meulle
committed
"dist": {
"type": "zip",
Marc-Antoine Marty
committed
"url": "https://github.com/GouvernementFR/dsfr/releases/download/v1.10.2/dsfr-v1.10.2.zip"