diff --git a/index.php b/index.php index f35076c..8f98d69 100644 --- a/index.php +++ b/index.php @@ -15,6 +15,8 @@ Kirby::plugin( name: "hobbyhome/fontawesome", extends: [ "options" => [ + "defaultFamily" => "classic", + "defaultStyle" => "solid", "assets" => [ "css" => [ 150 => Url::path(kirby()->url("media") . "/plugins/hobbyhome/fontawesome/css/fontawesome" . r(!option("debug"), ".min") . ".css", true), @@ -43,6 +45,40 @@ Kirby::plugin( return $files; }, ], + "tags" => [ + "fa" => [ + "attr" => [ + "style", + "class", + "family", + "fastyle", + "title", + ], + "html" => function ($tag) { + $html = ""; + + if ($tag->style) { + $html .= "style}\">"; + } + + $html .= "class, $tag->class . " ") . + "fa-" . r($tag->family, $tag->family, option("hobbyhome.fontawesome.defaultFamily")) . " " . + "fa-" . r($tag->fastyle, $tag->fastyle, option("hobbyhome.fontawesome.defaultStyle")) . " " . + "fa-" . $tag->value . + "\"" . + r($tag->title, " title=\"{$tag->title}\"") . + ">"; + + if ($tag->style) { + $html .= ""; + } + + return $html; + }, + ], + ], ], info: [ "authors" => [[