bnomei/kirby3-htmlhead

View on GitHub
snippets/htmlhead/link-preconnect.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

$urls = $urls ?? [];
foreach ($urls as $url) {
    if (!$url || strlen(trim($url)) === 0) {
        continue;
    }
    $options['rel'] = 'preconnect';
    $options['href'] = $url;

    echo Html::tag('link', null, $options) . PHP_EOL;
}