Commit c696f485 authored by Erick Hitter's avatar Erick Hitter

Minify final output, particularly with everything inlined

parent 10c3a1a9
......@@ -4,6 +4,7 @@
var express = require( 'express' );
var apicache = require( 'apicache' );
var cache = apicache.middleware;
var minifyHTML = require('express-minify-html');
var wpapi = require( 'wpapi' );
var handlebars = require( 'express-handlebars' );
var app = express();
......@@ -16,6 +17,21 @@ app.engine( 'handlebars', handlebars( {
} ) );
app.set( 'views', __dirname + '/render' );
app.use( minifyHTML( {
override: true,
exception_url: false,
htmlMinifier: {
html5: true,
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: false,
removeEmptyAttributes: true,
minifyCSS: true,
minifyJS: true
}
} ) );
// Domains to render
var domains = {
'ethitter.com': 'https://ethitter.com/',
......
......@@ -17,7 +17,8 @@
"express": "*",
"wpapi": "*",
"express-handlebars": "*",
"apicache": "*"
"apicache": "*",
"express-minify-html": "*"
},
"repository": {
"type": "git",
......
......@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style type="text/css">
<style>
{{> css}}
</style>
</head>
......@@ -19,7 +19,7 @@
<footer>&copy; <a href="https://ethitter.com/">erick t. hitter</a> | <a href="https://ethitter.com/contact/">Contact</a></footer>
<script src="https://s2.e15r.co/wp-includes/js/jquery/jquery.js"></script>
<script type="text/javascript">
<script>
{{> js-footer}}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment