forked from Adleraci/adlerka.top
test inlining
This commit is contained in:
parent
3fbe49aa44
commit
b5f16cc109
@ -10,12 +10,12 @@ function inlineLocalStylesFromHref($inputString) {
|
||||
$cssContent = file_get_contents($cssFilePath);
|
||||
$cssDir = dirname($cssFilePath);
|
||||
|
||||
// $cssContent = preg_replace_callback('/url\(["\']?(\/.*?|.*?)["\']?\)/i', function($urlMatch) use ($cssDir) {
|
||||
// $url = $urlMatch[1];
|
||||
// $absolutePath = $cssDir . '/' . $url;
|
||||
// $relativePath = ltrim(substr($absolutePath, strlen($_SERVER['DOCUMENT_ROOT'])), '/');
|
||||
// return 'url("' . $relativePath . '")';
|
||||
// }, $cssContent);
|
||||
$cssContent = preg_replace_callback('/url\(["\']?(\/.*?|.*?)["\']?\)/i', function($urlMatch) use ($cssDir) {
|
||||
$url = $urlMatch[1];
|
||||
$absolutePath = $cssDir . '/' . $url;
|
||||
$relativePath = ltrim(substr($absolutePath, strlen($_SERVER['DOCUMENT_ROOT'])), '/');
|
||||
return 'url("' . $relativePath . '")';
|
||||
}, $cssContent);
|
||||
|
||||
// Minify the CSS content
|
||||
//$cssContent = minifyCss($cssContent);
|
||||
|
Loading…
Reference in New Issue
Block a user