Skip to content

Commit

Permalink
Merge branch 'craft-4' of https://github.com/verbb/hyper into craft-4
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Mar 5, 2023
2 parents 9b0f638 + fed0daa commit 45f11da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/get-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ return [
'*' => [
'embedClientSettings' => [],
'embedHeaders' => [],
'embedDetectorsSettings' => [],
],
];
```

## Configuration options
- `embedClientSettings` - Define any [settings](https://github.com/oscarotero/Embed#settings) to pass to the Curl Client for Embed links.
- `embedHeaders` - Define any [headers](https://github.com/oscarotero/Embed#settings) to pass to the Curl Client for Embed links.
- `embedDetectorsSettings` - Define any [settings](https://github.com/oscarotero/Embed#settings) to pass to the detectors for Embed links.

## Control Panel
You can also manage configuration settings through the Control Panel by visiting Settings → Hyper.
2 changes: 2 additions & 0 deletions src/links/Embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public function getSerializedValues(): array
$crawler->addDefaultHeaders($settings->embedHeaders);

$embed = new \Embed\Embed($crawler);
$embed->setSettings($settings->embedDetectorsSettings);

$info = $embed->get($url);

$values['linkValue'] = Json::decode(Json::encode([
Expand Down
1 change: 1 addition & 0 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ class Settings extends Model

public array $embedClientSettings = [];
public array $embedHeaders = [];
public array $embedDetectorsSettings = [];

}

0 comments on commit 45f11da

Please sign in to comment.