mirror of
https://github.com/flarum/core.git
synced 2025-07-19 07:41:22 +02:00
Extract Google font import to a head string, make overideable
Allowing headStrings to be named is a bit of a stopgap solution. Really ClientView needs to be given much more power with headStrings and footStrings as separate objects, similar to the ItemList in the JS app.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
@import url(//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,600);
|
||||
|
||||
@import "font-awesome.less";
|
||||
@fa-font-path: "../../assets/fonts";
|
||||
|
||||
|
@@ -127,6 +127,8 @@ class ClientView implements Renderable
|
||||
$this->assets = $assets;
|
||||
$this->layout = $layout;
|
||||
$this->localeJs = $localeJs;
|
||||
|
||||
$this->addHeadString('<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,600">', 'font');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,9 +166,13 @@ class ClientView implements Renderable
|
||||
*
|
||||
* @param string $string
|
||||
*/
|
||||
public function addHeadString($string)
|
||||
public function addHeadString($string, $name = null)
|
||||
{
|
||||
$this->headStrings[] = $string;
|
||||
if ($name) {
|
||||
$this->headStrings[$name] = $string;
|
||||
} else {
|
||||
$this->headStrings[] = $string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user