develop
HerrHase 1 year ago
parent 0283d3d4c0
commit 3896f90c5e

@ -2,3 +2,4 @@ title: "test"
language: "en" language: "en"
domain: "test.io" domain: "test.io"
https: true https: true
description: "why"

@ -1,13 +1,9 @@
{% set posts = pageQuery.find({ orderBy: [ '-date_published' ], limit: 10, filter: { view: { _eq: 'post.njk' } } }) %} {% set posts = pageQuery.find({ orderBy: [ '-date_published' ], limit: 10, filter: { view: { _eq: 'post.njk' } } }) %}
{% set http = 'http' %} {% set http = 'http' %}
{% if (site.https) %} {% if (site.https) %}
{% set http = 'https' %} {% set http = 'https' %}
{% endif %} {% endif %}
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"

@ -78,12 +78,15 @@ class Engine {
const options = configStore.get('options') const options = configStore.get('options')
// if options minifyHtml is set, minify html // if options minifyHtml is set, minify html
if (options.minifyHtml === true) { if (options.minifyHtml === true && data.page.type === 'html') {
response = minify(response, { response = minify(response, {
removeComments: true, removeComments: true,
collapseWhitespace: true, collapseWhitespace: true,
collapseInlineTagWhitespace: true keepClosingSlash: true,
removeOptionalTags: false
}) })
} else {
response = response.replace(/^(?:[\t ]*(?:\r?\n|\r))+/gm, '')
} }
done(error, response) done(error, response)

@ -2,7 +2,7 @@ const Siteomat = require('./src/siteomat.js')
const siteomat = new Siteomat('./example/site', './example/views', { const siteomat = new Siteomat('./example/site', './example/views', {
'destination': './public', 'destination': './public',
'minifyHtml': false 'minifyHtml': true
}) })
siteomat.run() siteomat.run()
Loading…
Cancel
Save