REMOVED unneeded minification support.

REMOVED unneeded favicon support.
REMOVED extra broken template.
UPDATED to use fewer libraries.
UPDATED to v0.3.0.
This commit is contained in:
Eric Woodward 2018-07-02 19:21:42 -04:00
parent 366fdfdd88
commit 0f1b458806
4 changed files with 2 additions and 106 deletions

23
app.js
View File

@ -1,13 +1,10 @@
var
express = require('express'),
path = require('path'),
favicon = require('static-favicon'),
logger = require('morgan'),
cookieParser = require('cookie-parser'),
bodyParser = require('body-parser'),
compression = require('compression'),
minify = require('express-minify')
uglifyEs = require('uglify-es'),
routes = require('./routes/index'),
search = require('./routes/search'),
@ -35,7 +32,6 @@ app.set('views', path.join(__dirname, 'views'));
// app.set('view engine', 'jade');
app.set('view engine', 'ejs');
app.use(favicon());
app.use(logger(':req[x-forwarded-for] - [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length]'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
@ -48,25 +44,6 @@ app.use((req, res, next) => {
next();
});
app.use(compression());
app.use(function(req, res, next)
{
res.minifyOptions = res.minifyOptions || {};
res.minifyOptions.js = { output: { comments: 'some' } };
res.minifyOptions.css = { output: { comments: 'some' } };
if (/libs\.min\.js$/.test(req.url)) {
res.minifyOptions.minify = false;
}
next();
});
app.use(minify({
cache: 'minify-cache',
uglifyJsModule: uglifyEs,
sassMatch: false,
lessMatch: false,
stylusMatch: false,
coffeeScriptMatch: false
}));
app.use('/', routes);
app.use('/search/', search);

View File

@ -1,3 +0,0 @@
*
*/
!.gitignore

View File

@ -1,6 +1,6 @@
{
"name": "@mysticbits/codex-mythica",
"version": "0.2.5",
"version": "0.3.0",
"private": true,
"scripts": {
"start": "nodejs ./bin/www"
@ -12,11 +12,7 @@
"debug": "~0.7.4",
"ejs": "^2.5.7",
"express": "~4.16.0",
"express-minify": "^1.0.0",
"jade": "~1.3.0",
"morgan": "~1.0.0",
"static-favicon": "~1.0.0",
"uglify-es": "^3.3.5"
"morgan": "~1.0.0"
},
"author": {
"name": "Eric Woodward",

View File

@ -1,74 +0,0 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie lt-ie10 lt-ie9 lt-ie8" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie lt-ie10 lt-ie9" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie lt-ie10" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if gt IE 9]> <html class="no-js ie" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <![endif]-->
<!--[if !IE]>--> <html class="no-js" lang="en" xmlns:fb="http://ogp.me/ns/fb#"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="<%= site.base_uri %>/" />
<title><%= title ? title + ' | ' : ''%><%= site.title %></title>
<!-- For iPad with high-resolution Retina display running iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/images/favicons/favicon-152.png">
<!-- For iPad with high-resolution Retina display running iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/images/favicons/favicon-144.png">
<!-- For iPhone with high-resolution Retina display running iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/images/favicons/favicon-120.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/images/favicons/favicon-114.png">
<!-- For first- and second-generation iPad: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/images/favicons/favicon-72.png">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="/images/favicons/favicon-57.png">
<!-- Additional Sizes -->
<link rel="icon" href="/images/favicons/favicon-128.png" sizes="128x128">
<link rel="icon" href="/images/favicons/favicon-96.png" sizes="96x96">
<link rel="icon" href="/images/favicons/favicon-64.png" sizes="64x64">
<link rel="icon" href="/images/favicons/favicon-48.png" sizes="48x48">
<link rel="icon" href="/images/favicons/favicon-32.png" sizes="32x32">
<link rel="icon" href="/images/favicons/favicon-124.png" sizes="24x24">
<link rel="icon" href="/images/favicons/favicon-16.png" sizes="16x16">
<link rel="shortcut icon" href="/images/favicons/favicon-16.png" />
<meta name="description" content="">
<meta name="author" content="<%= author.name %>">
<meta name="generator" content="Express"/>
<meta name="keywords" content="">
<meta name="robots" content="">
<!-- Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:url" content="" /> <!-- TODO: Fix this -->
<meta property="og:site_name" content="<%= site.title %>" />
<meta property="og:title" content="<%= (title || site.title) %>" />
<% if (card && card.image) { %>
<meta property="og:image" content="<%= card.image %>"/>
<% } %>
<% if (description) { %>
<meta property="og:description" content="<%= description %>" />
<% } %>
<!-- Twitter Card -->
<% if (card && card.image) { %>
<meta name="twitter:card" content="summary_large_image">
<% } else { %>
<meta name="twitter:card" content="summary" />
<% } %>
<meta name="twitter:url" content="" /> <!-- TODO: add uri -->
<meta name="twitter:title" content="(title || site.title) %>" />
<meta name="twitter:description" content="">
<meta name="twitter:image:src" content="">
<% if (author && author.twitter) { %>
<meta name="twitter:creator" content="<%= author.twitter %>">
<% } %>
<link rel="start" href="<%= site.base_uri %>/"/>
<!-- <link rel="contents" href="/sitemap.xml" title="Sitemap"/> --> <!-- TODO: add uri -->
<link rel="canonical" href=""/> <!-- TODO: add uri -->
<link rel="stylesheet" href="/styles/styles.<%= site.version -%>.min.css" type="text/css" />
</head>