main v0.3.2
HerrHase 1 year ago
parent f30b3d7834
commit bbab557d8e

@ -1,6 +1,6 @@
{
"name": "@site-o-mat/core",
"version": "0.3.1",
"version": "0.3.2",
"build": "webpack",
"author": "Björn Hase <me@herr-hase.wtf>",
"main": "index.js",

@ -3,6 +3,7 @@ title: "health goth DIY tattooed"
view: "page.njk"
meta:
description: "DSA yes plz hot chicken green juice"
robots: "noindex"
media:
src:
src: '_images/dog.jpg'

@ -59,14 +59,8 @@ class Sitemap {
let result = true
if (page.meta) {
page.meta = Object.entries(page.meta)
page.meta.forEach((meta) => {
if (meta['name'] === 'robots' && meta['content'].includes('noindex')) {
result = false
return;
}
})
if (page.meta && page.meta.robots && page.meta.robots.includes('noindex')) {
result = false
}
if (page.extensions !== 'html') {

@ -39,7 +39,8 @@ describe('Parser Markdown', function () {
title: 'health goth DIY tattooed',
view: 'page.njk',
meta: {
description: 'DSA yes plz hot chicken green juice'
description: 'DSA yes plz hot chicken green juice',
robots: 'noindex'
}
})
})

@ -27,4 +27,8 @@ describe('Sitemap', function () {
it('loc-tag with url', function() {
assert.match(sitemap.getXmlAsString(), /<loc>https:\/\/test.lan\/blog\/article.html<\/loc>/)
})
it('loc-tag has robotos:noindex and has missing', function() {
assert.notMatch(sitemap.getXmlAsString(), /<loc>https:\/\/test.lan\/index.html<\/loc>/)
})
})

Loading…
Cancel
Save