Skip to content

Commit f84dabc

Browse files
committed
Breaking: Remove Google Fonts integration
1 parent 4769379 commit f84dabc

File tree

4 files changed

+11
-44
lines changed

4 files changed

+11
-44
lines changed

Configuration/Settings.Carbon.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
Carbon:
1010
IncludeAssets:
1111
LoadJSforCSSAsynchron: true
12-
GoogleFonts: null # e.g. 'Lato|Open+Sans:400,700', for async loading e.g. 'Lato|Open+Sans:400,700[async]'
1312
ResourceHints:
1413
DnsPrefetch: [] # Add <link rel="dns-prefetch" href="Entry" />
1514
Preconnect: [] # Add <link rel="preconnect" href="Entry" />

README.md

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ With this package, you get able to import all your CSS and Javascript assets wit
66

77
- You can define multiple files from multiple packages.
88
- You can pass the filenames as a string (comma separated) or as an array (recommended)
9-
- If you want to add attributes, add it with square brackets e.g.
9+
- If you want to add attributes, add it with square brackets e.g.
1010
`Filename.js[async data-prop data-attr="true" class="-js-loader"]`
1111
- If you want to get a file included inline, add the attribute `inline`: e.g. `Filename.css[inline]`
1212
- You can add multiple resources per line. E. g. `Slider.js,Main.css,Footer.css[async class="footer-styles"],Header[inline class="header-styles"],//ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js[async]`
@@ -23,24 +23,23 @@ In [`Carbon.IncludeAssets`](Configuration/Settings.yaml#L19) following settings
2323
| Key |  Description |
2424
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------- |
2525
| `LoadJSforCSSAsynchron` | (boolean) If true the javascript for asynchronous CSS get inlined (If needed). Defaults to `true` |
26-
| `GoogleFonts` | (string) If set, these fonts will included from Google. E.g. `Lato\|Open+Sans:400,700` Defaults to `null` |
2726
| `ResourceHints` | (array) The setting, which global [resource hints] should be added. |
2827
| `Default` | (array) The default setting for a `Packages` entry. If a key is not set within a `Packages` entry, this value will be used |
2928

3029
### Structure of Packages entry
3130

3231
In `Carbon.IncludeAssets.Packages` you can define your packages, which should output assets. The keys get sorted first by numbers, then by characters. Like that, it is possible to define a load order for you packages. A single entry can have following entries (The Defaults are stored in [`Carbon.IncludeAssets.Default`](Configuration/Settings.yaml#L30)):
3332

34-
| Key |  Description |
35-
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
36-
| `Package` | (string) The package key. If it set to `SitePackage`, it will be replaced automatically with the package key from the site package. Defaults to `SitePackage` |
37-
| `CacheBuster` | (boolean) Append a hash value from the content of the file. Defaults to `true` |
38-
| `ConditionPrototype` | (string) If set, the files get only included if the fusion prototype returns a truthy value. Defaults to `null` |
39-
| `Wrapper` | (string) If set, the generated tags will be wrapped. `{content}` will be replaced with the tags. Example: `'<!--[if lt IE 9]>{content}<![endif]-->'` |
33+
| Key |  Description |
34+
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
35+
| `Package` | (string) The package key. If it set to `SitePackage`, it will be replaced automatically with the package key from the site package. Defaults to `SitePackage` |
36+
| `CacheBuster` | (boolean) Append a hash value from the content of the file. Defaults to `true` |
37+
| `ConditionPrototype` | (string) If set, the files get only included if the fusion prototype returns a truthy value. Defaults to `null` |
38+
| `Wrapper` | (string) If set, the generated tags will be wrapped. `{content}` will be replaced with the tags. Example: `'<!--[if lt IE 9]>{content}<![endif]-->'` |
4039
| `Path` | (array) Define the files get loaded from. There are different paths for inline and linked files. Every type (`css`,`js`, `mjs`, `html`, `preloadasset`, `preloadcss`, `preloadscript` or `modulepreload`) can have a different path inside the Resources folder |
41-
| `General` | (array) Asset files who get loaded in live and backend view. Contains four entries: `Head`, `Body`, `HeadStart` and `BodyStart` |
42-
| `Backend` | (array) Asset files that get loaded only in the backend view. Contains four entries: `Head`, `Body`, `HeadStart` and `BodyStart` |
43-
| `Live` | (array) Asset files that get loaded only in the live view. Contains four entries: `Head`, `Body`, `HeadStart` and `BodyStart` |
40+
| `General` | (array) Asset files who get loaded in live and backend view. Contains four entries: `Head`, `Body`, `HeadStart` and `BodyStart` |
41+
| `Backend` | (array) Asset files that get loaded only in the backend view. Contains four entries: `Head`, `Body`, `HeadStart` and `BodyStart` |
42+
| `Live` | (array) Asset files that get loaded only in the live view. Contains four entries: `Head`, `Body`, `HeadStart` and `BodyStart` |
4443

4544
## Example
4645

@@ -50,7 +49,6 @@ Here is a small example:
5049
Carbon:
5150
IncludeAssets:
5251
LoadJSforCSSAsynchron: true
53-
GoogleFonts: "Lato|Open+Sans:400,700&display=swap[async]"
5452
ResourceHints:
5553
# Preconnect to these domains
5654
Preconnect:
@@ -190,10 +188,6 @@ The heart of this package. This prototype generates a `script`, `style`, and `li
190188
| `assetPath` | (string) The path to the file inside the Resources folder. Per default, it is set dynamically |
191189
| `wrapper` | (string) If set, the tag will be wrapped. `{content}` will be replaced with the tag. Example: `'<!--[if lt IE 9]>{content}<![endif]-->'` |
192190

193-
### [Carbon.IncludeAssets:GoogleFonts]
194-
195-
You can set the property `fonts` e.g. `Lato|Open+Sans:400,700` and the `style` tag get generated. Per default, this prototype read the [`Settings.yaml`](Configuration/Settings.yaml#L21).
196-
197191
### [Carbon.IncludeAssets:ResourceHints]
198192

199193
This prototype renders the [resource hints] for the browser. Per default, this prototype read the [`Settings.yaml`](Configuration/Settings.yaml#L22-L28). But you can also pass `preloadNodes` or `prerenderNodes` (Array, FlowQuery, or a single node) for further optimization.
@@ -203,10 +197,9 @@ This prototype renders the [resource hints] for the browser. Per default, this p
203197
If you have [Sandstorm.CookiePunch] installed, please add the following attribute to your script entry:
204198

205199
```yaml
206-
- YourJSFile.js[data-never-block]
200+
- YourJSFile.js[data-never-block]
207201
```
208202

209-
210203
## Installation
211204

212205
Most of the time, you have to make small adjustments to a package (e.g., the configuration in [`Settings.yaml`]). Because of that, it is important to add the corresponding package to the composer from your theme package. Mostly this is the site package located under `Packages/Sites/`. To install it correctly go to your theme package (e.g.`Packages/Sites/Foo.Bar`) and run following command:
@@ -231,7 +224,6 @@ The `--no-update` command prevent the automatic update of the dependencies. Afte
231224
[carbon.includeassets:case]: Resources/Private/Fusion/External/Case.fusion
232225
[carbon.includeassets:collection]: Resources/Private/Fusion/External/Collection.fusion
233226
[carbon.includeassets:file]: Resources/Private/Fusion/External/File.fusion
234-
[carbon.includeassets:googlefonts]: Resources/Private/Fusion/External/GoogleFonts.fusion
235227
[carbon.includeassets:resourcehints]: Resources/Private/Fusion/External/ResourceHints.fusion
236228
[resource hints]: https://www.smashingmagazine.com/2019/04/optimization-performance-resource-hints/
237229
[sandstorm.cookiepunch]: https://github.com/sandstorm/Sandstorm.CookiePunch

Resources/Private/Fusion/External/GoogleFonts.fusion

Lines changed: 0 additions & 23 deletions
This file was deleted.

Resources/Private/Fusion/Internal/Assets.fusion

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ prototype(Carbon.IncludeAssets:Internal.Assets) < prototype(Neos.Fusion:Componen
2323

2424
renderer = afx`
2525
<Carbon.IncludeAssets:ResourceHints @if.head={props.inHead} />
26-
<Carbon.IncludeAssets:GoogleFonts @if.head={props.inHead} />
2726
{props.filesFromPackages}
2827
<Carbon.IncludeAssets:File @if.render={props.loadAsyncCSS} file='resource://Carbon.IncludeAssets/Private/Templates/LoadCssAsync.js[inline]' />
2928
`

0 commit comments

Comments
 (0)