-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #34: Add support for ForkAwesome.
- Loading branch information
Jen Lampton
committed
Aug 28, 2021
1 parent
72b65f4
commit fe3994a
Showing
3 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,9 +212,24 @@ function on_the_web_display_block($delta, $settings = array(), $contexts = array | |
} | ||
elseif ($type == 'font') { | ||
if (!module_exists('font_awesome')) { | ||
$links['#attached']['css']['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'] = array( | ||
'type' => 'external', | ||
); | ||
|
||
$version = $config->get('version'); | ||
switch ($version) { | ||
case '4.7.0': | ||
$font_url = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'; | ||
break; | ||
case '1.2.0': | ||
$font_url = 'https://cdn.jsdelivr.net/npm/[email protected]/css/fork-awesome.min.css'; | ||
break; | ||
/* @todo Support FA5 | ||
case '5.x.x': | ||
$hash = $config->get('kit_hash'); | ||
$font_url = 'https://kit.fontawesome.com/' . $hash . '.js'; | ||
break; | ||
*/ | ||
} | ||
|
||
$links['#attached']['css'][$font_url] = array('type' => 'external'); | ||
} | ||
} | ||
} | ||
|