feat(html): minify static and dynamic html output
This commit is contained in:
parent
b6d5933433
commit
f4b6436460
18 changed files with 305 additions and 7 deletions
|
@ -7,7 +7,8 @@
|
||||||
"guzzlehttp/guzzle": "^7.9",
|
"guzzlehttp/guzzle": "^7.9",
|
||||||
"kaoken/markdown-it-php": "^14.1",
|
"kaoken/markdown-it-php": "^14.1",
|
||||||
"sokil/php-isocodes": "^4.2",
|
"sokil/php-isocodes": "^4.2",
|
||||||
"sokil/php-isocodes-db-only": "^4.0"
|
"sokil/php-isocodes-db-only": "^4.0",
|
||||||
|
"voku/html-min": "^4.5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": [
|
"start": [
|
||||||
|
|
215
composer.lock
generated
215
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "6f62ebb63bb51c04310e829e19beeab5",
|
"content-hash": "9998c1c4f0bcc7d5e58abc25de979750",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/guzzle",
|
"name": "guzzlehttp/guzzle",
|
||||||
|
@ -686,6 +686,71 @@
|
||||||
},
|
},
|
||||||
"time": "2024-02-02T08:24:43+00:00"
|
"time": "2024-02-02T08:24:43+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/css-selector",
|
||||||
|
"version": "v7.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/css-selector.git",
|
||||||
|
"reference": "601a5ce9aaad7bf10797e3663faefce9e26c24e2"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/css-selector/zipball/601a5ce9aaad7bf10797e3663faefce9e26c24e2",
|
||||||
|
"reference": "601a5ce9aaad7bf10797e3663faefce9e26c24e2",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.2"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\CssSelector\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jean-François Simon",
|
||||||
|
"email": "jeanfrancois.simon@sensiolabs.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Converts CSS selectors to XPath expressions",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/css-selector/tree/v7.2.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2024-09-25T14:21:43+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"version": "v3.5.1",
|
"version": "v3.5.1",
|
||||||
|
@ -752,6 +817,154 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-09-25T14:20:29+00:00"
|
"time": "2024-09-25T14:20:29+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "voku/html-min",
|
||||||
|
"version": "4.5.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/voku/HtmlMin.git",
|
||||||
|
"reference": "872dac444652d30791ca5d0c23fbe1e6b9cab5bc"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/voku/HtmlMin/zipball/872dac444652d30791ca5d0c23fbe1e6b9cab5bc",
|
||||||
|
"reference": "872dac444652d30791ca5d0c23fbe1e6b9cab5bc",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-dom": "*",
|
||||||
|
"php": ">=7.0.0",
|
||||||
|
"voku/simple_html_dom": "~4.8.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"voku\\": "src/voku/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Lars Moelleken",
|
||||||
|
"homepage": "https://www.moelleken.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "HTML Compressor and Minifier",
|
||||||
|
"homepage": "https://github.com/voku/HtmlMin",
|
||||||
|
"keywords": [
|
||||||
|
"compress",
|
||||||
|
"compression",
|
||||||
|
"compressor",
|
||||||
|
"html",
|
||||||
|
"minifier"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/voku/HtmlMin/issues",
|
||||||
|
"source": "https://github.com/voku/HtmlMin/tree/4.5.1"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.paypal.me/moelleken",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/voku",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://www.patreon.com/voku",
|
||||||
|
"type": "patreon"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2024-05-25T08:01:45+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "voku/simple_html_dom",
|
||||||
|
"version": "4.8.10",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/voku/simple_html_dom.git",
|
||||||
|
"reference": "716822ed52ed3a1881542be07a786270de390e99"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/voku/simple_html_dom/zipball/716822ed52ed3a1881542be07a786270de390e99",
|
||||||
|
"reference": "716822ed52ed3a1881542be07a786270de390e99",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-dom": "*",
|
||||||
|
"ext-libxml": "*",
|
||||||
|
"ext-simplexml": "*",
|
||||||
|
"php": ">=7.0.0",
|
||||||
|
"symfony/css-selector": "~3.0 || ~4.0 || ~5.0 || ~6.0 || ~7.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"voku/portable-utf8": "If you need e.g. UTF-8 fixed output."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"voku\\helper\\": "src/voku/helper/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "dimabdc",
|
||||||
|
"email": "support@titor.ru",
|
||||||
|
"homepage": "https://github.com/dimabdc",
|
||||||
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Lars Moelleken",
|
||||||
|
"homepage": "https://www.moelleken.org/",
|
||||||
|
"role": "Fork-Maintainer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Simple HTML DOM package.",
|
||||||
|
"homepage": "https://github.com/voku/simple_html_dom",
|
||||||
|
"keywords": [
|
||||||
|
"HTML Parser",
|
||||||
|
"dom",
|
||||||
|
"php dom"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/voku/simple_html_dom/issues",
|
||||||
|
"source": "https://github.com/voku/simple_html_dom/tree/4.8.10"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.paypal.me/moelleken",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/voku",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://www.patreon.com/voku",
|
||||||
|
"type": "patreon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/voku/simple_html_dom",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2024-07-03T16:05:14+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
|
|
17
config/plugins/html-config.js
Normal file
17
config/plugins/html-config.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import htmlmin from 'html-minifier-terser';
|
||||||
|
|
||||||
|
export const htmlConfig = (eleventyConfig) => {
|
||||||
|
eleventyConfig.addTransform('html-minify', (content, path) => {
|
||||||
|
if (path && (path.endsWith('.html') || path.endsWith('.php'))) {
|
||||||
|
return htmlmin.minify(content, {
|
||||||
|
collapseBooleanAttributes: true,
|
||||||
|
collapseWhitespace: true,
|
||||||
|
decodeEntities: true,
|
||||||
|
includeAutoGeneratedTags: false,
|
||||||
|
removeComments: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return content;
|
||||||
|
});
|
||||||
|
};
|
|
@ -1,4 +1,5 @@
|
||||||
import { cssConfig } from "./css-config.js";
|
import { cssConfig } from "./css-config.js";
|
||||||
|
import { htmlConfig } from "./html-config.js";
|
||||||
import { markdownLib } from "./markdown.js";
|
import { markdownLib } from "./markdown.js";
|
||||||
|
|
||||||
export default { cssConfig, markdownLib };
|
export default { cssConfig, htmlConfig, markdownLib };
|
||||||
|
|
|
@ -12,6 +12,7 @@ const appVersion = require("./package.json").version;
|
||||||
export default async function (eleventyConfig) {
|
export default async function (eleventyConfig) {
|
||||||
eleventyConfig.addPlugin(tablerIcons);
|
eleventyConfig.addPlugin(tablerIcons);
|
||||||
eleventyConfig.addPlugin(plugins.cssConfig);
|
eleventyConfig.addPlugin(plugins.cssConfig);
|
||||||
|
eleventyConfig.addPlugin(plugins.htmlConfig);
|
||||||
|
|
||||||
eleventyConfig.setQuietMode(true);
|
eleventyConfig.setQuietMode(true);
|
||||||
eleventyConfig.configureErrorReporting({ allowMissingExtensions: true });
|
eleventyConfig.configureErrorReporting({ allowMissingExtensions: true });
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "1.6.2",
|
"version": "1.7.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "1.6.2",
|
"version": "1.7.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"html-minifier-terser": "7.2.0",
|
"html-minifier-terser": "7.2.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "1.6.2",
|
"version": "1.7.0",
|
||||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
require __DIR__ . "/../../server/utils/init.php";
|
require __DIR__ . "/../../server/utils/init.php";
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
|
use voku\helper\HtmlMin;
|
||||||
|
|
||||||
$requestUri = $_SERVER["REQUEST_URI"];
|
$requestUri = $_SERVER["REQUEST_URI"];
|
||||||
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
||||||
|
@ -75,6 +76,8 @@
|
||||||
$ogImage = htmlspecialchars($artist["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
$ogImage = htmlspecialchars($artist["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
||||||
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
header("Cache-Control: public, max-age=3600");
|
header("Cache-Control: public, max-age=3600");
|
||||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
require __DIR__ . "/../server/utils/init.php";
|
require __DIR__ . "/../server/utils/init.php";
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
|
use voku\helper\HtmlMin;
|
||||||
|
|
||||||
$requestUri = $_SERVER["REQUEST_URI"];
|
$requestUri = $_SERVER["REQUEST_URI"];
|
||||||
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
||||||
|
@ -98,6 +99,8 @@
|
||||||
$ogImage = htmlspecialchars($book["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
$ogImage = htmlspecialchars($book["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
||||||
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
header("Cache-Control: public, max-age=3600");
|
header("Cache-Control: public, max-age=3600");
|
||||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
require __DIR__ . "/../../server/utils/init.php";
|
require __DIR__ . "/../../server/utils/init.php";
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
|
use voku\helper\HtmlMin;
|
||||||
|
|
||||||
$requestUri = $_SERVER["REQUEST_URI"];
|
$requestUri = $_SERVER["REQUEST_URI"];
|
||||||
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
||||||
|
@ -66,6 +67,8 @@
|
||||||
$ogImage = htmlspecialchars($genre["artists"][0]["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
$ogImage = htmlspecialchars($genre["artists"][0]["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
||||||
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
header("Cache-Control: public, max-age=3600");
|
header("Cache-Control: public, max-age=3600");
|
||||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
require __DIR__ . "/../../server/utils/init.php";
|
require __DIR__ . "/../../server/utils/init.php";
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
|
use voku\helper\HtmlMin;
|
||||||
|
|
||||||
$requestUri = $_SERVER["REQUEST_URI"];
|
$requestUri = $_SERVER["REQUEST_URI"];
|
||||||
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
||||||
|
@ -75,6 +76,8 @@
|
||||||
$ogImage = htmlspecialchars($movie["backdrop"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
$ogImage = htmlspecialchars($movie["backdrop"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
||||||
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
header("Cache-Control: public, max-age=3600");
|
header("Cache-Control: public, max-age=3600");
|
||||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
require __DIR__ . "/../../server/utils/init.php";
|
require __DIR__ . "/../../server/utils/init.php";
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
|
use voku\helper\HtmlMin;
|
||||||
|
|
||||||
$requestUri = $_SERVER["REQUEST_URI"];
|
$requestUri = $_SERVER["REQUEST_URI"];
|
||||||
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
||||||
|
@ -66,6 +67,8 @@
|
||||||
$ogImage = htmlspecialchars($show["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
$ogImage = htmlspecialchars($show["image"] . "?class=w800", ENT_QUOTES, "UTF-8");
|
||||||
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
$fullUrl = "https://www.coryd.dev" . $requestUri;
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
header("Cache-Control: public, max-age=3600");
|
header("Cache-Control: public, max-age=3600");
|
||||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{%- capture headerContent -%}
|
{%- capture headerContent -%}
|
||||||
<img class="icon" src="{{ globals.cdn_url }}{{ globals.avatar_header }}?class=w200&v={% appVersion %}" alt"{{ globals.site_name }}" />
|
<img class="icon" src="{{ globals.cdn_url }}{{ globals.avatar_header }}?class=w200&v={% appVersion %}" alt="{{ globals.site_name }}" />
|
||||||
<span>Cory</span> <span>Dransfeldt</span>
|
<span>Cory</span> <span>Dransfeldt</span>
|
||||||
{%- endcapture -%}
|
{%- endcapture -%}
|
||||||
<section class="main-title">
|
<section class="main-title">
|
||||||
|
|
|
@ -133,3 +133,13 @@ schema: artist
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
</article>
|
</article>
|
||||||
|
<?php
|
||||||
|
$html = ob_get_clean();
|
||||||
|
$htmlMin = new HtmlMin();
|
||||||
|
$htmlMin->doOptimizeAttributes(true);
|
||||||
|
$htmlMin->doRemoveComments(true);
|
||||||
|
$htmlMin->doSumUpWhitespace(true);
|
||||||
|
$htmlMin->doRemoveWhitespaceAroundTags(true);
|
||||||
|
$htmlMin->doOptimizeViaHtmlDomParser(true);
|
||||||
|
echo $htmlMin->minify($html);
|
||||||
|
?>
|
||||||
|
|
|
@ -64,3 +64,13 @@ schema: book
|
||||||
<?= parseMarkdown($book["description"]) ?>
|
<?= parseMarkdown($book["description"]) ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</article>
|
</article>
|
||||||
|
<?php
|
||||||
|
$html = ob_get_clean();
|
||||||
|
$htmlMin = new HtmlMin();
|
||||||
|
$htmlMin->doOptimizeAttributes(true);
|
||||||
|
$htmlMin->doRemoveComments(true);
|
||||||
|
$htmlMin->doSumUpWhitespace(true);
|
||||||
|
$htmlMin->doRemoveWhitespaceAroundTags(true);
|
||||||
|
$htmlMin->doOptimizeViaHtmlDomParser(true);
|
||||||
|
echo $htmlMin->minify($html);
|
||||||
|
?>
|
||||||
|
|
|
@ -40,3 +40,13 @@ schema: genre
|
||||||
<button data-toggle-button>Show more</button>
|
<button data-toggle-button>Show more</button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</article>
|
</article>
|
||||||
|
<?php
|
||||||
|
$html = ob_get_clean();
|
||||||
|
$htmlMin = new HtmlMin();
|
||||||
|
$htmlMin->doOptimizeAttributes(true);
|
||||||
|
$htmlMin->doRemoveComments(true);
|
||||||
|
$htmlMin->doSumUpWhitespace(true);
|
||||||
|
$htmlMin->doRemoveWhitespaceAroundTags(true);
|
||||||
|
$htmlMin->doOptimizeViaHtmlDomParser(true);
|
||||||
|
echo $htmlMin->minify($html);
|
||||||
|
?>
|
||||||
|
|
|
@ -56,3 +56,13 @@ schema: movie
|
||||||
<?= $movie["description"] ?>
|
<?= $movie["description"] ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</article>
|
</article>
|
||||||
|
<?php
|
||||||
|
$html = ob_get_clean();
|
||||||
|
$htmlMin = new HtmlMin();
|
||||||
|
$htmlMin->doOptimizeAttributes(true);
|
||||||
|
$htmlMin->doRemoveComments(true);
|
||||||
|
$htmlMin->doSumUpWhitespace(true);
|
||||||
|
$htmlMin->doRemoveWhitespaceAroundTags(true);
|
||||||
|
$htmlMin->doOptimizeViaHtmlDomParser(true);
|
||||||
|
echo $htmlMin->minify($html);
|
||||||
|
?>
|
||||||
|
|
|
@ -56,3 +56,13 @@ schema: show
|
||||||
<?= parseMarkdown($show["description"]) ?>
|
<?= parseMarkdown($show["description"]) ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</article>
|
</article>
|
||||||
|
<?php
|
||||||
|
$html = ob_get_clean();
|
||||||
|
$htmlMin = new HtmlMin();
|
||||||
|
$htmlMin->doOptimizeAttributes(true);
|
||||||
|
$htmlMin->doRemoveComments(true);
|
||||||
|
$htmlMin->doSumUpWhitespace(true);
|
||||||
|
$htmlMin->doRemoveWhitespaceAroundTags(true);
|
||||||
|
$htmlMin->doOptimizeViaHtmlDomParser(true);
|
||||||
|
echo $htmlMin->minify($html);
|
||||||
|
?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue