Compare commits
22 Commits
Author | SHA1 | Date |
---|---|---|
HerrHase | c39f361697 | 1 year ago |
HerrHase | e1f6c52a12 | 1 year ago |
HerrHase | 6dcb72d83a | 1 year ago |
HerrHase | 49a21861e8 | 2 years ago |
HerrHase | 6f0a443114 | 2 years ago |
HerrHase | 741c87114b | 2 years ago |
HerrHase | 4ae23d8f63 | 2 years ago |
HerrHase | b213bf74ed | 2 years ago |
HerrHase | bbab557d8e | 2 years ago |
HerrHase | f30b3d7834 | 2 years ago |
HerrHase | 1cb628a96d | 2 years ago |
HerrHase | 2098b932b3 | 2 years ago |
HerrHase | b2af26e68f | 2 years ago |
HerrHase | 5d6aa96b59 | 2 years ago |
HerrHase | 0efa8adaab | 2 years ago |
HerrHase | 494e79c86e | 2 years ago |
HerrHase | ffbe2a5849 | 2 years ago |
HerrHase | e06ff2d08d | 2 years ago |
HerrHase | 976fd82132 | 2 years ago |
HerrHase | bacef6a2a6 | 2 years ago |
HerrHase | 92af1ee3a3 | 2 years ago |
HerrHase | d8a9d1494f | 2 years ago |
After Width: | Height: | Size: 41 KiB |
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "Data"
|
||||
media:
|
||||
src: '_images/dog-tired.webp'
|
||||
---
|
||||
## Normcore cold-pressed ramps DSA
|
||||
|
||||
Normcore cold-pressed ramps DSA yes plz hot chicken green juice succulents leggings messenger bag truffaut iceland pabst ethical godard. Semiotics air plant marfa, drinking vinegar authentic iceland pug fit cloud bread cronut kickstarter glossier crucifix tumeric. Chicharrones polaroid flexitarian, seitan lumbersexual viral fam master cleanse four dollar toast scenester. Succulents poutine vegan keffiyeh meh, health goth DIY tattooed. Praxis roof party celiac chartreuse banjo butcher you probably haven't heard of them schlitz beard. Ethical tattooed kinfolk, cliche vegan messenger bag mukbang dreamcatcher cloud bread farm-to-table gatekeep trust fund.
|
||||
|
||||
## Palo santo leggings normcore aesthetic
|
||||
|
||||
bicycle rights sartorial godard slow-carb thundercats art party cray JOMO. Truffaut four dollar toast hoodie pour-over. Fanny pack iPhone jean shorts tote bag, master cleanse succulents tbh fixie gatekeep pok pok letterpress cornhole. Dreamcatcher tattooed hot chicken gatekeep, glossier salvia 8-bit cred. Fit lomo chillwave cold-pressed humblebrag narwhal. Meggings edison bulb fanny pack irony af pug pok pok whatever vexillologist vibecession cred butcher trust fund chia.
|
||||
|
||||
## Bitters kale chips chambray activated charcoal
|
||||
|
||||
wolf keffiyeh hell of selfies. Wolf readymade shoreditch flexitarian venmo single-origin coffee, knausgaard fit actually street art cold-pressed iPhone gatekeep. Migas bruh adaptogen semiotics marfa pickled yuccie. Locavore normcore lomo, shoreditch fashion axe actually glossier iPhone photo booth blue bottle DIY XOXO williamsburg. Pinterest whatever taxidermy, kale chips prism XOXO schlitz twee tote bag woke swag. Wayfarers fashion axe heirloom humblebrag synth. Whatever succulents PBR&B, pop-up enamel pin echo park tonx stumptown taiyaki.
|
After Width: | Height: | Size: 2.3 MiB |
@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
---
|
||||
## Normcore cold-pressed ramps DSA
|
||||
|
||||
Normcore cold-pressed ramps DSA yes plz hot chicken green juice succulents leggings messenger bag truffaut iceland pabst ethical godard. Semiotics air plant marfa, drinking vinegar authentic iceland pug fit cloud bread cronut kickstarter glossier crucifix tumeric. Chicharrones polaroid flexitarian, seitan lumbersexual viral fam master cleanse four dollar toast scenester. Succulents poutine vegan keffiyeh meh, health goth DIY tattooed. Praxis roof party celiac chartreuse banjo butcher you probably haven't heard of them schlitz beard. Ethical tattooed kinfolk, cliche vegan messenger bag mukbang dreamcatcher cloud bread farm-to-table gatekeep trust fund.
|
||||
|
||||
## Palo santo leggings normcore aesthetic
|
||||
|
||||
bicycle rights sartorial godard slow-carb thundercats art party cray JOMO. Truffaut four dollar toast hoodie pour-over. Fanny pack iPhone jean shorts tote bag, master cleanse succulents tbh fixie gatekeep pok pok letterpress cornhole. Dreamcatcher tattooed hot chicken gatekeep, glossier salvia 8-bit cred. Fit lomo chillwave cold-pressed humblebrag narwhal. Meggings edison bulb fanny pack irony af pug pok pok whatever vexillologist vibecession cred butcher trust fund chia.
|
||||
|
||||
## Bitters kale chips chambray activated charcoal
|
||||
|
||||
wolf keffiyeh hell of selfies. Wolf readymade shoreditch flexitarian venmo single-origin coffee, knausgaard fit actually street art cold-pressed iPhone gatekeep. Migas bruh adaptogen semiotics marfa pickled yuccie. Locavore normcore lomo, shoreditch fashion axe actually glossier iPhone photo booth blue bottle DIY XOXO williamsburg. Pinterest whatever taxidermy, kale chips prism XOXO schlitz twee tote bag woke swag. Wayfarers fashion axe heirloom humblebrag synth. Whatever succulents PBR&B, pop-up enamel pin echo park tonx stumptown taiyaki.
|
@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
---
|
||||
## Normcore cold-pressed ramps DSA
|
||||
|
||||
Normcore cold-pressed ramps DSA yes plz hot chicken green juice succulents leggings messenger bag truffaut iceland pabst ethical godard. Semiotics air plant marfa, drinking vinegar authentic iceland pug fit cloud bread cronut kickstarter glossier crucifix tumeric. Chicharrones polaroid flexitarian, seitan lumbersexual viral fam master cleanse four dollar toast scenester. Succulents poutine vegan keffiyeh meh, health goth DIY tattooed. Praxis roof party celiac chartreuse banjo butcher you probably haven't heard of them schlitz beard. Ethical tattooed kinfolk, cliche vegan messenger bag mukbang dreamcatcher cloud bread farm-to-table gatekeep trust fund.
|
||||
|
||||
## Palo santo leggings normcore aesthetic
|
||||
|
||||
bicycle rights sartorial godard slow-carb thundercats art party cray JOMO. Truffaut four dollar toast hoodie pour-over. Fanny pack iPhone jean shorts tote bag, master cleanse succulents tbh fixie gatekeep pok pok letterpress cornhole. Dreamcatcher tattooed hot chicken gatekeep, glossier salvia 8-bit cred. Fit lomo chillwave cold-pressed humblebrag narwhal. Meggings edison bulb fanny pack irony af pug pok pok whatever vexillologist vibecession cred butcher trust fund chia.
|
||||
|
||||
## Bitters kale chips chambray activated charcoal
|
||||
|
||||
wolf keffiyeh hell of selfies. Wolf readymade shoreditch flexitarian venmo single-origin coffee, knausgaard fit actually street art cold-pressed iPhone gatekeep. Migas bruh adaptogen semiotics marfa pickled yuccie. Locavore normcore lomo, shoreditch fashion axe actually glossier iPhone photo booth blue bottle DIY XOXO williamsburg. Pinterest whatever taxidermy, kale chips prism XOXO schlitz twee tote bag woke swag. Wayfarers fashion axe heirloom humblebrag synth. Whatever succulents PBR&B, pop-up enamel pin echo park tonx stumptown taiyaki.
|
@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "Data"
|
||||
---
|
||||
## Normcore cold-pressed ramps DSA
|
||||
|
||||
Normcore cold-pressed ramps DSA yes plz hot chicken green juice succulents leggings messenger bag truffaut iceland pabst ethical godard. Semiotics air plant marfa, drinking vinegar authentic iceland pug fit cloud bread cronut kickstarter glossier crucifix tumeric. Chicharrones polaroid flexitarian, seitan lumbersexual viral fam master cleanse four dollar toast scenester. Succulents poutine vegan keffiyeh meh, health goth DIY tattooed. Praxis roof party celiac chartreuse banjo butcher you probably haven't heard of them schlitz beard. Ethical tattooed kinfolk, cliche vegan messenger bag mukbang dreamcatcher cloud bread farm-to-table gatekeep trust fund.
|
||||
|
||||
## Palo santo leggings normcore aesthetic
|
||||
|
||||
bicycle rights sartorial godard slow-carb thundercats art party cray JOMO. Truffaut four dollar toast hoodie pour-over. Fanny pack iPhone jean shorts tote bag, master cleanse succulents tbh fixie gatekeep pok pok letterpress cornhole. Dreamcatcher tattooed hot chicken gatekeep, glossier salvia 8-bit cred. Fit lomo chillwave cold-pressed humblebrag narwhal. Meggings edison bulb fanny pack irony af pug pok pok whatever vexillologist vibecession cred butcher trust fund chia.
|
||||
|
||||
## Bitters kale chips chambray activated charcoal
|
||||
|
||||
wolf keffiyeh hell of selfies. Wolf readymade shoreditch flexitarian venmo single-origin coffee, knausgaard fit actually street art cold-pressed iPhone gatekeep. Migas bruh adaptogen semiotics marfa pickled yuccie. Locavore normcore lomo, shoreditch fashion axe actually glossier iPhone photo booth blue bottle DIY XOXO williamsburg. Pinterest whatever taxidermy, kale chips prism XOXO schlitz twee tote bag woke swag. Wayfarers fashion axe heirloom humblebrag synth. Whatever succulents PBR&B, pop-up enamel pin echo park tonx stumptown taiyaki.
|
After Width: | Height: | Size: 1.5 MiB |
@ -1,8 +1,10 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "page.njk"
|
||||
title: "article"
|
||||
view: "article.njk"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
media:
|
||||
src: '_images/dog.jpg'
|
||||
---
|
||||
## Normcore cold-pressed ramps DSA
|
||||
|
@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "blog"
|
||||
view: "page.njk"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
media:
|
||||
src:
|
||||
src: '_images/dog.jpg'
|
||||
sizes:
|
||||
- width: 300
|
||||
- width: 500
|
||||
height: 100
|
||||
---
|
||||
## Normcore cold-pressed ramps DSA
|
||||
|
||||
Normcore cold-pressed ramps DSA yes plz hot chicken green juice succulents leggings messenger bag truffaut iceland pabst ethical godard. Semiotics air plant marfa, drinking vinegar authentic iceland pug fit cloud bread cronut kickstarter glossier crucifix tumeric. Chicharrones polaroid flexitarian, seitan lumbersexual viral fam master cleanse four dollar toast scenester. Succulents poutine vegan keffiyeh meh, health goth DIY tattooed. Praxis roof party celiac chartreuse banjo butcher you probably haven't heard of them schlitz beard. Ethical tattooed kinfolk, cliche vegan messenger bag mukbang dreamcatcher cloud bread farm-to-table gatekeep trust fund.
|
||||
|
||||
## Palo santo leggings normcore aesthetic
|
||||
|
||||
bicycle rights sartorial godard slow-carb thundercats art party cray JOMO. Truffaut four dollar toast hoodie pour-over. Fanny pack iPhone jean shorts tote bag, master cleanse succulents tbh fixie gatekeep pok pok letterpress cornhole. Dreamcatcher tattooed hot chicken gatekeep, glossier salvia 8-bit cred. Fit lomo chillwave cold-pressed humblebrag narwhal. Meggings edison bulb fanny pack irony af pug pok pok whatever vexillologist vibecession cred butcher trust fund chia.
|
||||
|
||||
## Bitters kale chips chambray activated charcoal
|
||||
|
||||
wolf keffiyeh hell of selfies. Wolf readymade shoreditch flexitarian venmo single-origin coffee, knausgaard fit actually street art cold-pressed iPhone gatekeep. Migas bruh adaptogen semiotics marfa pickled yuccie. Locavore normcore lomo, shoreditch fashion axe actually glossier iPhone photo booth blue bottle DIY XOXO williamsburg. Pinterest whatever taxidermy, kale chips prism XOXO schlitz twee tote bag woke swag. Wayfarers fashion axe heirloom humblebrag synth. Whatever succulents PBR&B, pop-up enamel pin echo park tonx stumptown taiyaki.
|
@ -0,0 +1,27 @@
|
||||
---
|
||||
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'
|
||||
sizes:
|
||||
- width: 300
|
||||
- width: 500
|
||||
height: 100
|
||||
---
|
||||
## Normcore cold-pressed ramps DSA
|
||||
|
||||
Normcore cold-pressed ramps DSA yes plz hot chicken green juice succulents leggings messenger bag truffaut iceland pabst ethical godard. Semiotics air plant marfa, drinking vinegar authentic iceland pug fit cloud bread cronut kickstarter glossier crucifix tumeric. Chicharrones polaroid flexitarian, seitan lumbersexual viral fam master cleanse four dollar toast scenester. Succulents poutine vegan keffiyeh meh, health goth DIY tattooed. Praxis roof party celiac chartreuse banjo butcher you probably haven't heard of them schlitz beard. Ethical tattooed kinfolk, cliche vegan messenger bag mukbang dreamcatcher cloud bread farm-to-table gatekeep trust fund.
|
||||
|
||||
## Palo santo leggings normcore aesthetic
|
||||
|
||||
bicycle rights sartorial godard slow-carb thundercats art party cray JOMO. Truffaut four dollar toast hoodie pour-over. Fanny pack iPhone jean shorts tote bag, master cleanse succulents tbh fixie gatekeep pok pok letterpress cornhole. Dreamcatcher tattooed hot chicken gatekeep, glossier salvia 8-bit cred. Fit lomo chillwave cold-pressed humblebrag narwhal. Meggings edison bulb fanny pack irony af pug pok pok whatever vexillologist vibecession cred butcher trust fund chia.
|
||||
|
||||
## Bitters kale chips chambray activated charcoal
|
||||
|
||||
wolf keffiyeh hell of selfies. Wolf readymade shoreditch flexitarian venmo single-origin coffee, knausgaard fit actually street art cold-pressed iPhone gatekeep. Migas bruh adaptogen semiotics marfa pickled yuccie. Locavore normcore lomo, shoreditch fashion axe actually glossier iPhone photo booth blue bottle DIY XOXO williamsburg. Pinterest whatever taxidermy, kale chips prism XOXO schlitz twee tote bag woke swag. Wayfarers fashion axe heirloom humblebrag synth. Whatever succulents PBR&B, pop-up enamel pin echo park tonx stumptown taiyaki.
|
||||
|
||||
![_images/dog.jpg](_images/dog.jpg)
|
@ -0,0 +1,4 @@
|
||||
title: "Test"
|
||||
language: "de"
|
||||
domain: "test.lan"
|
||||
https: true
|
@ -0,0 +1,112 @@
|
||||
const { marked } = require('marked')
|
||||
|
||||
const configStore = require('./../config.js')
|
||||
const Media = require('./../factories/media.js')
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// copy from @marked/src/helpers.js, no export possible
|
||||
function cleanUrl(sanitize, base, href) {
|
||||
if (sanitize) {
|
||||
|
||||
let prot
|
||||
|
||||
try {
|
||||
prot = decodeURIComponent(unescape(href))
|
||||
.replace(nonWordAndColonTest, '')
|
||||
.toLowerCase()
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
if (base && !originIndependentUrl.test(href)) {
|
||||
href = resolveUrl(base, href)
|
||||
}
|
||||
|
||||
try {
|
||||
href = encodeURI(href).replace(/%25/g, '%')
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
|
||||
return href
|
||||
}
|
||||
|
||||
const renderer = {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} href
|
||||
* @param {string} title
|
||||
* @param {string} text
|
||||
*/
|
||||
link(href, title, text) {
|
||||
|
||||
href = cleanUrl(this.options.sanitize, this.options.baseUrl, href)
|
||||
|
||||
if (href === null) {
|
||||
return text
|
||||
}
|
||||
|
||||
let out = '<a href="' + href + '"'
|
||||
|
||||
if (title) {
|
||||
out += ' title="' + title + '"'
|
||||
}
|
||||
|
||||
// check if url is external and add target
|
||||
if (href.match(/^(http|https):\/\//)) {
|
||||
out += ' target="_blank" rel="noopener" '
|
||||
}
|
||||
|
||||
out += '>' + text + '</a>'
|
||||
|
||||
return out
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} href
|
||||
* @param {string} title
|
||||
* @param {string} text
|
||||
*/
|
||||
image(href, title, text) {
|
||||
|
||||
href = cleanUrl(this.options.sanitize, this.options.baseUrl, href)
|
||||
|
||||
if (href === null) {
|
||||
return text
|
||||
}
|
||||
|
||||
// check if href for image is relative
|
||||
if (!href.match(/^(http|https):\/\//)) {
|
||||
const markedDirPath = configStore.get('markedDirPath')
|
||||
|
||||
// check if dirPath are exists from options
|
||||
if (markedDirPath || markedDirPath === '') {
|
||||
const media = new Media(markedDirPath)
|
||||
href = media.resolve(href)
|
||||
}
|
||||
}
|
||||
|
||||
let out = `<img src="${href}" alt="${text}"`
|
||||
|
||||
if (title) {
|
||||
out += ` title="${title}"`
|
||||
}
|
||||
|
||||
out += this.options.xhtml ? '/>' : '>'
|
||||
|
||||
return out
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = renderer
|
@ -0,0 +1,98 @@
|
||||
const { assert } = require('chai')
|
||||
const fs = require('fs')
|
||||
|
||||
const PagesQuery = require('./../src/queries/pages.js')
|
||||
const configStore = require('./../src/config.js')
|
||||
|
||||
describe('Page /index.md', function () {
|
||||
|
||||
configStore.set('source', './ressources')
|
||||
configStore.set('destination', './dist')
|
||||
|
||||
const query = new PagesQuery('./ressources');
|
||||
const results = query.find()
|
||||
|
||||
const page = results[2]
|
||||
|
||||
it('fields is Object', function() {
|
||||
assert.isObject(page)
|
||||
})
|
||||
|
||||
it('fields has Blocks', function() {
|
||||
assert.equal(page.blocks.block.length, 2)
|
||||
})
|
||||
|
||||
it('path', function() {
|
||||
assert.equal(page.path, '/index.html')
|
||||
})
|
||||
|
||||
it('permalink', function() {
|
||||
assert.equal(page.permalink, '')
|
||||
})
|
||||
|
||||
it('parsed content contains image', () => {
|
||||
assert.match(page.content, /<img src="\/assets\/88c010ea\/4ca9b5f5\/6024c57d\/05899fae\/a33d9a45\/dog.webp" alt="_images\/dog.jpg">/)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Page /blog/index.md', function () {
|
||||
|
||||
configStore.set('source', './ressources')
|
||||
configStore.set('destination', './dist')
|
||||
|
||||
const query = new PagesQuery('./ressources');
|
||||
const results = query.find()
|
||||
|
||||
const page = results[1]
|
||||
|
||||
it('fields is object', function() {
|
||||
assert.isObject(page)
|
||||
})
|
||||
|
||||
it('fields has Blocks', function() {
|
||||
assert.equal(page.blocks.block.length, 2)
|
||||
})
|
||||
|
||||
it('path', function() {
|
||||
assert.equal(page.path, '/blog/index.html')
|
||||
})
|
||||
|
||||
it('permalink', function() {
|
||||
assert.equal(page.permalink, '/blog')
|
||||
})
|
||||
|
||||
it('fields has media src', function() {
|
||||
assert.deepEqual(page.media.src, {
|
||||
"300": "/assets/a6c45d17/11bf0a4e/a2b1d75d/dc85ca56/71c63294/dog300.webp",
|
||||
"500x100": "/assets/a6c45d17/11bf0a4e/a2b1d75d/dc85ca56/71c63294/dog500x100.webp",
|
||||
"full": "/assets/a6c45d17/11bf0a4e/a2b1d75d/dc85ca56/71c63294/dog.webp"
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('Page /blog/article.md', function () {
|
||||
|
||||
configStore.set('source', './ressources')
|
||||
configStore.set('destination', './dist')
|
||||
|
||||
const query = new PagesQuery('./ressources');
|
||||
const results = query.find()
|
||||
|
||||
const page = results[0]
|
||||
|
||||
it('fields is object', function() {
|
||||
assert.isObject(page)
|
||||
})
|
||||
|
||||
it('path', function() {
|
||||
assert.equal(page.path, '/blog/article.html')
|
||||
})
|
||||
|
||||
it('permalink', function() {
|
||||
assert.equal(page.permalink, '/blog/article')
|
||||
})
|
||||
|
||||
it('fields has media src', function() {
|
||||
assert.equal(page.media.src, '/assets/a6c45d17/11bf0a4e/a2b1d75d/dc85ca56/71c63294/dog.webp')
|
||||
})
|
||||
})
|
@ -0,0 +1,34 @@
|
||||
const { assert } = require('chai')
|
||||
const fs = require('fs')
|
||||
|
||||
const PagesQuery = require('./../src/queries/pages.js')
|
||||
const configStore = require('./../src/config.js')
|
||||
const parseYamlFile = require('./../src/parsers/yaml.js')
|
||||
const Sitemap = require('./../src/factories/sitemap.js')
|
||||
|
||||
describe('Sitemap', function () {
|
||||
|
||||
configStore.set('source', './ressources')
|
||||
configStore.set('destination', './dist')
|
||||
|
||||
const file = fs.readFileSync('./ressources/site.yml', 'utf8')
|
||||
const siteConfig = parseYamlFile(file)
|
||||
|
||||
const query = new PagesQuery('./ressources')
|
||||
const results = query.find()
|
||||
|
||||
const sitemap = new Sitemap(siteConfig)
|
||||
|
||||
results.forEach((page) => {
|
||||
sitemap.addPage(page)
|
||||
})
|
||||
|
||||
// check results
|
||||
it('loc-tag with url', function() {
|
||||
assert.match(sitemap.getXmlAsString(), /<loc>https:\/\/test.lan\/blog\/article<\/loc>/)
|
||||
})
|
||||
|
||||
it('loc-tag has robotos:noindex and has missing', function() {
|
||||
assert.notMatch(sitemap.getXmlAsString(), /<loc>https:\/\/test.lan\/<\/loc>/)
|
||||
})
|
||||
})
|
Loading…
Reference in new issue