develop
HerrHase 1 year ago
parent c4ba30213f
commit 443145063f

@ -5,6 +5,8 @@ date_published: "10.10.2022"
excerpt: "ddd"
meta:
description: "DSA yes plz hot chicken green juice"
tags:
- f
---
## Normcore cold-pressed ramps DSA

@ -2,7 +2,7 @@
{% block main %}
{% set posts = pageQuery.find({ orderBy: [ '-date_published' ], limit: 2, filter: { view: { _eq: 'post.njk' } } }) %}
{% set posts = pageQuery.find({ orderBy: [ '-date_published' ], limit: 2, filter: { tags: { _in: [ 'tok', 'xxx' ] } } }) %}
{% for post in posts %}
<a class="post" href="{{ post.path }}">

@ -3,7 +3,8 @@
{% if (site.https) %}
{% set http = 'https' %}
{% 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:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"

@ -57,9 +57,8 @@ class Engine {
/**
* render
*
* @param {string} view
* @param {object} data
* @return {string}
* @param {object} page
* @param {function} done
*
*/
render(page, done) {
@ -77,7 +76,7 @@ class Engine {
const options = configStore.get('options')
// if options minifyHtml is set, minify html
// if options minifyHtml is set, minify html, but only if page has type html
if (options.minifyHtml === true && data.page.type === 'html') {
response = minify(response, {
removeComments: true,
@ -85,6 +84,8 @@ class Engine {
keepClosingSlash: true,
removeOptionalTags: false
})
// remove empty lines
} else {
response = response.replace(/^(?:[\t ]*(?:\r?\n|\r))+/gm, '')
}

@ -75,59 +75,69 @@ class Pages {
let isValid = true
for (const [key, value] of Object.entries(options.filter)) {
// equal
if (value['_eq'] && result[key] !== value['_eq']) {
isValid = false
}
if (value['_neq'] && result[key] === value['_eq']) {
// not equal
if (value['_neq'] && result[key] === value['_neq']) {
isValid = false
}
/**
// in
if (value['_in'] && Array.isArray(value['_in'])) {
if (value['_in'] && value['_in'].indexOf(result[key]) !== -1) {
// if result no exists
if (!result[key]) {
isValid = false
}
if (value['_nin'] && value['_nin'].indexOf(result[key]) === -1) {
isValid = false
}
if (Array.isArray(result[key])) {
if (value['_lt'] && result[key] < value['_lt']) {
isValid = false
let found = false
result[key].forEach((v, index) => {
if (value['_in'].indexOf(v) !== -1) {
found = true
}
})
if (value['_lte'] && result[key] <= value['_lte']) {
if (!found) {
isValid = false
}
if (value['_gt'] && result[key] > value['_gt']) {
} else {
if (value['_in'].indexOf(result[key]) === -1) {
isValid = false
}
}
}
if (value['_gte'] && result[key] >= value['_gt']) {
if (value['_lt'] && result[key] < value['_lt']) {
isValid = false
}
if (value['_null'] && result[key]) {
if (value['_lte'] && result[key] <= value['_lte']) {
isValid = false
}
if (value['_nnull'] && !result[key]) {
if (value['_gt'] && result[key] > value['_gt']) {
isValid = false
}
if (value['_contains'] && !result[key]) {
if (value['_gte'] && result[key] >= value['_gte']) {
isValid = false
}
if (value['_ncontains'] && !result[key]) {
if (value['_null'] && result[key]) {
isValid = false
}
if (value['_regex'] && result[key].test(value['_regex'])) {
if (value['_nnull'] && !result[key]) {
isValid = false
}*/
}
}
return isValid

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