Compare commits
15 Commits
Author | SHA1 | Date |
---|---|---|
HerrHase | f74151e219 | 1 year ago |
HerrHase | c979f99439 | 2 years ago |
HerrHase | 1df2e66e07 | 2 years ago |
HerrHase | fcb839b342 | 2 years ago |
HerrHase | 2d70977a35 | 2 years ago |
HerrHase | 6061232da1 | 2 years ago |
HerrHase | ed9ed08aec | 2 years ago |
HerrHase | b8f88a0d22 | 2 years ago |
HerrHase | 8b97ae802b | 2 years ago |
HerrHase | 061ed2ab18 | 2 years ago |
HerrHase | 6f7c7a8263 | 2 years ago |
HerrHase | cf4733ca72 | 2 years ago |
HerrHase | 018dbacdea | 2 years ago |
HerrHase | 832d3e2055 | 2 years ago |
HerrHase | 51232d9fb6 | 2 years ago |
Before Width: | Height: | Size: 66 KiB |
@ -1,17 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "page.njk"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
---
|
||||
## 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.
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "blog.njk"
|
||||
meta:
|
||||
description: "La"
|
||||
---
|
@ -1,21 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "page.njk"
|
||||
meta:
|
||||
description: "La"
|
||||
media:
|
||||
teaser:
|
||||
src: "_images/test.jpeg"
|
||||
alt: "cold-pressed"
|
||||
---
|
||||
## 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.
|
@ -1,6 +0,0 @@
|
||||
posts:
|
||||
orderBy:
|
||||
- '-date_published'
|
||||
filter:
|
||||
view:
|
||||
_eq: 'post.njk'
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "post.njk"
|
||||
date_published: "09.10.2022"
|
||||
excerpt: "jjj"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
---
|
||||
## 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.
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "post.njk"
|
||||
date_published: "10.10.2022"
|
||||
excerpt: "ddd"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
tags:
|
||||
- xxx
|
||||
---
|
||||
## 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.
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "page.njk"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
robots: "index, nofollow"
|
||||
---
|
@ -1 +0,0 @@
|
||||
lkjlkjlkj
|
@ -1 +0,0 @@
|
||||
kljkljlkj
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "page.njk"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
robots: "index, nofollow"
|
||||
---
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
title: "rss"
|
||||
view: "rss.njk"
|
||||
type: "xml"
|
||||
---
|
@ -1,5 +0,0 @@
|
||||
title: "test"
|
||||
language: "en"
|
||||
domain: "test.io"
|
||||
https: true
|
||||
description: "why"
|
@ -1,15 +0,0 @@
|
||||
{% extends('layout.njk') %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{% set posts = pageQuery.find({ orderBy: [ '-date_published' ], limit: 2, filter: { tags: { _in: [ 'tok', 'xxx' ] } } }) %}
|
||||
|
||||
{% for post in posts %}
|
||||
<a class="post" href="{{ post.path }}">
|
||||
<h2 class="post__title">
|
||||
{{ post.title }}
|
||||
</h2>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
@ -1,30 +0,0 @@
|
||||
{# handle meta in templates #}
|
||||
|
||||
{% macro meta(page, site) %}
|
||||
{% if (page.meta) %}
|
||||
|
||||
{% set hasCannocial = false %}
|
||||
|
||||
{% for key, content in page.meta %}
|
||||
<meta name="{{ key }}" content="{{ content }}" />
|
||||
|
||||
{# check for index in robots if set page has canonical #}
|
||||
{% if (key === 'robots' and content.indexOf('index') !== -1 and content.indexOf('noindex') === -1) %}
|
||||
{% set hasCannocial = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# check if page has canonical #}
|
||||
{% if (hasCannocial) %}
|
||||
{% set http = 'http' %}
|
||||
|
||||
{% if (site.https) %}
|
||||
{% set http = site.https %}
|
||||
{% endif %}
|
||||
|
||||
<link href="{{ http }}://{{ site.domain }}{{ page.path }}" rel="canonical">
|
||||
<link rel="alternate" href="{{ http }}://{{ site.domain }}{{ page.path }}" hreflang="{{ site.language }}">
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endmacro %}
|
@ -1,54 +0,0 @@
|
||||
{% import "helpers/meta.njk" as helpers %}
|
||||
|
||||
<!doctype html>
|
||||
<html lang="{{ site.language }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
{{ site.title }} | {{ page.title }}
|
||||
</title>
|
||||
|
||||
{{ helpers.meta(page, site) }}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="{{ asset('/css/styles.css') }}" rel="stylesheet" type="text/css">
|
||||
|
||||
{% block addHead %}{% endblock %}
|
||||
|
||||
</head>
|
||||
<body class="site-body">
|
||||
|
||||
<header class="site-header">
|
||||
<div class="bar">
|
||||
<div class="bar__start">
|
||||
<h1 class="site-header__title">
|
||||
{{ page.title }}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="site-main">
|
||||
<div class="container">
|
||||
<div class="grid">
|
||||
<div class="col-12">
|
||||
{% block main %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="container">
|
||||
<div class="grid">
|
||||
<div class="col-12">
|
||||
MIT License
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="{{ asset('/js/app.js') }}"></script>
|
||||
{% block addFooter %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
@ -1,5 +0,0 @@
|
||||
{% extends('layout.njk') %}
|
||||
|
||||
{% block main %}
|
||||
{{ page.content | safe }}
|
||||
{% endblock %}
|
@ -1,5 +0,0 @@
|
||||
{% extends('layout.njk') %}
|
||||
|
||||
{% block main %}
|
||||
{{ page.content | safe }}
|
||||
{% endblock %}
|
@ -1,51 +0,0 @@
|
||||
{% set posts = pageQuery.find({ orderBy: [ '-date_published' ], limit: 10, filter: { view: { _eq: 'post.njk' } } }) %}
|
||||
{% set http = 'http' %}
|
||||
{% if (site.https) %}
|
||||
{% set http = 'https' %}
|
||||
{% endif %}
|
||||
<?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/"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
|
||||
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
|
||||
>
|
||||
<channel>
|
||||
<title>{{ site.title }}</title>
|
||||
<atom:link href="{{ http }}://{{ site.domain }}{{ page.path }}" rel="self" type="application/rss+xml" />
|
||||
<link>{{ http }}://{{ site.domain }}</link>
|
||||
|
||||
{% if site.description %}
|
||||
<description>{{ site.description }}</description>
|
||||
{% endif %}
|
||||
|
||||
<lastBuildDate>{{ dayjs() }}</lastBuildDate>
|
||||
<language>{{ site.language }}-{{ site.language | upper }}</language>
|
||||
<sy:updatePeriod>hourly</sy:updatePeriod>
|
||||
<sy:updateFrequency>1</sy:updateFrequency>
|
||||
<generator>https://gitea.node001.net/HerrHase/siteomat-webpack-plugin</generator>
|
||||
{% for post in posts %}
|
||||
<item>
|
||||
<title>{{ post.title }}</title>
|
||||
<link>{{ http }}://{{ site.domain }}{{ post.path }}</link>
|
||||
<pubDate>{{ dayjs(post.date_published) }}</pubDate>
|
||||
|
||||
{% if post.excerpt %}
|
||||
<description>
|
||||
{{ post.excerpt }}
|
||||
</description>
|
||||
{% endif %}
|
||||
|
||||
<content:encoded>
|
||||
<![CDATA[
|
||||
{{ post.content | safe }}
|
||||
]]>
|
||||
</content:encoded>
|
||||
|
||||
<guid>{{ http }}://{{ site.domain }}{{ post.path }}</guid>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</channel>
|
||||
</rss>
|
File diff suppressed because it is too large
Load Diff
@ -1,36 +1,15 @@
|
||||
{
|
||||
"name": "@helpers/siteomat-webpack-plugin",
|
||||
"version": "0.4.0",
|
||||
"name": "@site-o-mat/webpack-plugin",
|
||||
"version": "0.5.0",
|
||||
"build": "webpack",
|
||||
"author": "Björn Hase <me@herr-hase.wtf>",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@gitea.node001.net:HerrHase/siteomat-webpack-plugin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
"url": "git@gitea.node001.net:site-o-mat/webpack-plugin.git"
|
||||
},
|
||||
"description": "A Webpack Plugin for generating a Website as Html-Files from a Markdown File Structure",
|
||||
"dependencies": {
|
||||
"@helpers/siteomat-query": "^0.1.0",
|
||||
"assign-deep": "^1.0.1",
|
||||
"crypto": "^1.0.1",
|
||||
"dayjs": "^1.11.6",
|
||||
"fast-xml-parser": "^4.0.11",
|
||||
"html-minifier": "^4.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"lodash.orderby": "^4.6.0",
|
||||
"marked": "^4.1.1",
|
||||
"mkdirp": "^1.0.4",
|
||||
"nunjucks": "^3.2.3",
|
||||
"sharp": "^0.31.1",
|
||||
"slugify": "^1.6.5",
|
||||
"yaml": "^2.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.7",
|
||||
"mocha": "^10.2.0"
|
||||
"@site-o-mat/core": "^0.5.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
---
|
||||
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.
|
@ -1,14 +0,0 @@
|
||||
---
|
||||
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.
|
@ -1,17 +0,0 @@
|
||||
---
|
||||
title: "health goth DIY tattooed"
|
||||
view: "page.njk"
|
||||
meta:
|
||||
description: "DSA yes plz hot chicken green juice"
|
||||
---
|
||||
## 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.
|
@ -1,52 +0,0 @@
|
||||
/**
|
||||
* ConfigStore
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author Björn Hase <me@herr-hase.wtf>
|
||||
* @license http://opensource.org/licenses/MIT The MIT License
|
||||
* @link https://gitea.node001.net/HerrHase/siteomat-webpack-plugin.git
|
||||
*
|
||||
*/
|
||||
class ConfigStore {
|
||||
|
||||
constructor() {
|
||||
if (!ConfigStore.instance) {
|
||||
ConfigStore.instance = this;
|
||||
this._data = {}
|
||||
}
|
||||
|
||||
return ConfigStore.instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* set value by key
|
||||
*
|
||||
* @param {String} key
|
||||
* @param {String|Object} value
|
||||
*
|
||||
*/
|
||||
set(key, value) {
|
||||
this._data[key] = value
|
||||
}
|
||||
|
||||
/**
|
||||
* get value by key
|
||||
*
|
||||
* @param {String} key
|
||||
* @return {String|Object}
|
||||
*/
|
||||
get(key) {
|
||||
|
||||
if (!this._data?.[key]) {
|
||||
throw new Error(key + ' not found in ConfigStore!')
|
||||
}
|
||||
|
||||
return this._data[key]
|
||||
}
|
||||
}
|
||||
|
||||
// create instance
|
||||
const instance = new ConfigStore();
|
||||
|
||||
module.exports = instance
|
@ -1,53 +0,0 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
const Media = require('./../factories/media.js')
|
||||
|
||||
/**
|
||||
* asset - checks manifest.json for given path and return
|
||||
* file path with id for cache busting
|
||||
*
|
||||
*
|
||||
* @param {String} publicPath
|
||||
*
|
||||
*/
|
||||
|
||||
function asset(staticPath) {
|
||||
|
||||
// getting basePath
|
||||
let result = staticPath
|
||||
|
||||
// path to mix-manifest
|
||||
const file = path.join(path.resolve()) + 'mix-manifest.json'
|
||||
|
||||
if (fs.existsSync(file)) {
|
||||
|
||||
const manifest = fs.readFileSync(file)
|
||||
const files = JSON.parse(manifest)
|
||||
|
||||
if (files[staticPath]) {
|
||||
result = files[staticPath]
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* asset - checks manifest.json for given path and return
|
||||
* file path with id for cache busting
|
||||
*
|
||||
*
|
||||
* @param {String} publicPath
|
||||
*
|
||||
*/
|
||||
|
||||
async function resize(src, sizes, options, done)
|
||||
{
|
||||
const media = new Media()
|
||||
|
||||
src = await media.resize(src, sizes, options)
|
||||
done(null, src)
|
||||
}
|
||||
|
||||
module.exports = { asset, resize }
|
@ -1,99 +0,0 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const sharp = require('sharp')
|
||||
const mkdirp = require('mkdirp')
|
||||
const crypto = require('crypto')
|
||||
const slugify = require('slugify')
|
||||
|
||||
const configStore = require('./../config.js')
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Media {
|
||||
|
||||
constructor() {
|
||||
this._DIR_ASSETS = '/assets/'
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} src
|
||||
* @param {object} sizes
|
||||
* @param {Object} [options={}]
|
||||
* @return {string}
|
||||
*
|
||||
*/
|
||||
async resize(src, sizes, options = {}) {
|
||||
|
||||
this._extension = path.extname(src)
|
||||
this._filename = slugify(path.basename(src, this._extension))
|
||||
|
||||
this._process = await sharp(configStore.get('source') + '/' + src)
|
||||
|
||||
// resize without options and with options
|
||||
if (Object.getOwnPropertyNames(options).length === 0) {
|
||||
await this._process
|
||||
.resize(sizes)
|
||||
} else {
|
||||
this._process
|
||||
.resize(sizes, options)
|
||||
}
|
||||
|
||||
// optimize
|
||||
this._optimize()
|
||||
|
||||
const fileBuffer = await this._process
|
||||
.toBuffer()
|
||||
|
||||
const relativeDestinationPath = this._DIR_ASSETS + this._resolveRelativeDestinationPath(fileBuffer)
|
||||
|
||||
// create directories and write file
|
||||
mkdirp.sync(configStore.get('destination') + relativeDestinationPath)
|
||||
fs.writeFileSync(configStore.get('destination') + relativeDestinationPath + '/' + this._filename + this._extension, fileBuffer)
|
||||
|
||||
return relativeDestinationPath + '/' + this._filename + this._extension
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO much nicer to add a hook system so behavior can be change
|
||||
*
|
||||
*
|
||||
* @param {string} extension
|
||||
*
|
||||
*/
|
||||
_optimize() {
|
||||
if (this._extension === '.gif') {
|
||||
this._process
|
||||
.gif({
|
||||
reoptimise: true
|
||||
})
|
||||
} else {
|
||||
|
||||
// change extension
|
||||
this._extension = '.webp'
|
||||
this._process
|
||||
.webp({
|
||||
lossless: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* resolve path to write file, hash will be get = fileBuffer and
|
||||
*
|
||||
*
|
||||
* @param {object} fileBuffer
|
||||
* @return {string}
|
||||
*
|
||||
*/
|
||||
_resolveRelativeDestinationPath(fileBuffer) {
|
||||
const hash = crypto.createHash('sha1')
|
||||
hash.update(fileBuffer)
|
||||
|
||||
return hash.digest('hex').match(new RegExp('.{1,8}', 'g')).join('/')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Media
|
@ -1,111 +0,0 @@
|
||||
const { XMLParser, XMLBuilder, XMLValidator} = require('fast-xml-parser')
|
||||
const dayjs = require('dayjs')
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Björn Hase <me@herr-hase.wtf>
|
||||
* @license http://opensource.org/licenses/MIT The MIT License
|
||||
* @link https://gitea.node001.net/HerrHase/siteomat-webpack-plugin.git
|
||||
*
|
||||
*/
|
||||
class Sitemap {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {[type]} site
|
||||
* @param {[type]} pages
|
||||
*
|
||||
*/
|
||||
constructor(site) {
|
||||
this._site = site
|
||||
this._urls = []
|
||||
}
|
||||
|
||||
/**
|
||||
* adding page to urls of sitemap, check if page is valid for sitemap
|
||||
*
|
||||
* @param {object} page
|
||||
*
|
||||
*/
|
||||
addPage(page) {
|
||||
if (this._isValid(page)) {
|
||||
this._urls.push({
|
||||
loc: 'https://' + this._site.domain + page.pathname + '/' + page.filename,
|
||||
lastmod: dayjs().format()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get xml as string
|
||||
*
|
||||
* @return {string}
|
||||
*
|
||||
*/
|
||||
getXmlAsString() {
|
||||
return this._createXml(this._urls)
|
||||
}
|
||||
|
||||
/**
|
||||
* check if robots has a noindex
|
||||
*
|
||||
* @param {object} page
|
||||
* @return {boolean}
|
||||
*
|
||||
*/
|
||||
_isValid(page) {
|
||||
|
||||
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.type !== 'html') {
|
||||
result = false
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* create xml with urls and return it as string
|
||||
*
|
||||
* @param {object} urls
|
||||
* @return {string}
|
||||
*
|
||||
*/
|
||||
_createXml(urls) {
|
||||
|
||||
// builder for XML
|
||||
const builder = new XMLBuilder({
|
||||
format: true,
|
||||
processEntities: false,
|
||||
ignoreAttributes: false,
|
||||
attributeNamePrefix: '@'
|
||||
})
|
||||
|
||||
const xmlString = builder.build({
|
||||
'?xml': {
|
||||
'@version': '1.0',
|
||||
'@encoding': 'UTF-8'
|
||||
},
|
||||
'urlset': {
|
||||
'@xmlns': 'http://www.sitemaps.org/schemas/sitemap/0.9',
|
||||
'url': urls
|
||||
}
|
||||
})
|
||||
|
||||
return xmlString
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Sitemap
|
@ -1,42 +0,0 @@
|
||||
const yaml = require('js-yaml')
|
||||
const { marked } = require('marked')
|
||||
|
||||
/**
|
||||
* parse string of file, parse yaml and parse markdown
|
||||
*
|
||||
* @author Björn Hase <me@herr-hase.wtf>
|
||||
* @license http://opensource.org/licenses/MIT The MIT License
|
||||
* @link https://gitea.node001.net/HerrHase/siteomat-webpack-plugin.git
|
||||
*
|
||||
*/
|
||||
|
||||
function parseMarkdownFile(fileString) {
|
||||
|
||||
// regex get yaml section and markdown
|
||||
// thanks to, https://github.com/getgrav/grav
|
||||
const regex = new RegExp(/^(---\n(.+?)\n---){0,}(.*)$/gs)
|
||||
const matches = regex.exec(fileString)
|
||||
|
||||
const result = {
|
||||
fields: undefined,
|
||||
content: ''
|
||||
}
|
||||
|
||||
// check if yaml section not exists throw error
|
||||
if (matches?.[2]) {
|
||||
try {
|
||||
result.fields = yaml.load(matches[2])
|
||||
} catch (error) {
|
||||
throw new Error('Yaml has errors!')
|
||||
}
|
||||
}
|
||||
|
||||
// if markdown section exits parse it to html 6565
|
||||
if (matches?.[3]) {
|
||||
result.content = marked.parse(matches[3])
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
module.exports = parseMarkdownFile
|
@ -1,25 +0,0 @@
|
||||
const yaml = require('js-yaml')
|
||||
|
||||
/**
|
||||
* parse string of file and only parse yaml
|
||||
*
|
||||
* @author Björn Hase <me@herr-hase.wtf>
|
||||
* @license http://opensource.org/licenses/MIT The MIT License
|
||||
* @link https://gitea.node001.net/HerrHase/siteomat-webpack-plugin.git
|
||||
*
|
||||
*/
|
||||
|
||||
function parseYamlFile(file) {
|
||||
|
||||
let config
|
||||
|
||||
try {
|
||||
config = yaml.load(file)
|
||||
} catch (error) {
|
||||
throw new Error('parseYamlFile: Yaml has errors!')
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
module.exports = parseYamlFile
|
@ -1,130 +0,0 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const BlockFactory = require('./../factories/block.js')
|
||||
|
||||
/**
|
||||
* search, filter and find pages
|
||||
*
|
||||
*
|
||||
* @author Björn Hase <me@herr-hase.wtf>
|
||||
* @license http://opensource.org/licenses/MIT The MIT License
|
||||
* @link https://gitea.node001.net/HerrHase/siteomat-webpack-plugin.git
|
||||
*
|
||||
*/
|
||||
|
||||
class Blocks {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {string} dirPath
|
||||
*
|
||||
*/
|
||||
constructor(dirPath) {
|
||||
|
||||
this.FILE_EXTENSION = '.md'
|
||||
this.DIRECTORY_BLOCKS = '_blocks'
|
||||
|
||||
this._dirPath = dirPath + '/' + this.DIRECTORY_BLOCKS;
|
||||
this._results = {}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return {array}
|
||||
*/
|
||||
find() {
|
||||
|
||||
if (fs.existsSync(this._dirPath)) {
|
||||
this._findFiles(this._dirPath)
|
||||
}
|
||||
|
||||
return this._results
|
||||
}
|
||||
|
||||
/**
|
||||
* find files
|
||||
*
|
||||
* @param {string} dirPath
|
||||
* @param {Object} [parent = '']
|
||||
*
|
||||
*/
|
||||
_findFiles(dirPath, parent = '') {
|
||||
|
||||
//
|
||||
const files = fs.readdirSync(dirPath, {
|
||||
withFileTypes: true
|
||||
})
|
||||
|
||||
files.forEach((file) => {
|
||||
|
||||
// skip for file that is not markdown
|
||||
if (file.isFile() && path.extname(file.name) !== this.FILE_EXTENSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if directory going deep
|
||||
if (file.isDirectory()) {
|
||||
this._findFiles(dirPath, parent + '/' + file.name)
|
||||
}
|
||||
|
||||
// get file
|
||||
const fileString = this._getFile(file, dirPath + parent)
|
||||
|
||||
// skip if empty
|
||||
if (!fileString) {
|
||||
return;
|
||||
}
|
||||
|
||||
// create page object and add to page
|
||||
const block = new BlockFactory(fileString)
|
||||
const blockname = this._parseBlockname(file.name)
|
||||
|
||||
if (!this._results[blockname]) {
|
||||
this._results[blockname] = []
|
||||
}
|
||||
|
||||
this._results[blockname].push(block.get())
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* remove '.md' and also ordering number = filename
|
||||
*
|
||||
* @param {string} filename
|
||||
* @return {string}
|
||||
*
|
||||
*/
|
||||
_parseBlockname(filename) {
|
||||
const regex = new RegExp(/[-_]?[0-9]*\b.md\b$/)
|
||||
return filename.replace(regex, '')
|
||||
}
|
||||
|
||||
/**
|
||||
* get file content
|
||||
*
|
||||
* @param {string} slug
|
||||
* @param {string} sourcePath
|
||||
* @return {mixed}
|
||||
*
|
||||
*/
|
||||
_getFile(file, dirPath) {
|
||||
|
||||
// file
|
||||
let result = null
|
||||
|
||||
// path of file, first try with slug
|
||||
let filePath = dirPath + '/' + file.name
|
||||
|
||||
if (fs.existsSync(filePath) && file.isFile()) {
|
||||
result = fs.readFileSync(filePath, 'utf8')
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports =Blocks
|
@ -1,188 +0,0 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const {
|
||||
Filter, orderBy, reduce
|
||||
} = require('@helpers/siteomat-query')
|
||||
|
||||
const PageFactory = require('./../factories/page.js')
|
||||
const BlocksQuery = require('./../queries/blocks.js')
|
||||
|
||||
/**
|
||||
* Pages - search, filter and find pages
|
||||
*
|
||||
* @author Björn Hase <me@herr-hase.wtf>
|
||||
* @license http://opensource.org/licenses/MIT The MIT License
|
||||
* @link https://gitea.node001.net/HerrHase/siteomat-webpack-plugin.git
|
||||
*
|
||||
*/
|
||||
|
||||
class Pages {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {string} dirPath
|
||||
*
|
||||
*/
|
||||
constructor(dirPath) {
|
||||
|
||||
// constants
|
||||
this.FILE_EXTENSION = '.md'
|
||||
this.FILE_INDEX = 'index'
|
||||
this.DIRECTORY_BLOCKS = '_blocks'
|
||||
|
||||
// default options for find
|
||||
this._options = {
|
||||
parent: '',
|
||||
deep: -1
|
||||
}
|
||||
|
||||
this._dirPath = dirPath
|
||||
this._results = []
|
||||
}
|
||||
|
||||
/**
|
||||
* find pages
|
||||
*
|
||||
* @param {Object} [options={}]
|
||||
* @return {array}
|
||||
*
|
||||
*/
|
||||
find(options = {}) {
|
||||
this._results = []
|
||||
this._count = 0
|
||||
|
||||
options = Object.assign({}, this._options, options)
|
||||
|
||||
if (options.filter) {
|
||||
this._filter = new Filter(options.filter)
|
||||
}
|
||||
|
||||
this._findFiles(this._dirPath, options)
|
||||
|
||||
//
|
||||
if (options.orderBy && options.orderBy.length > 0) {
|
||||
this.results = orderBy(options.orderBy, this._results)
|
||||
}
|
||||
|
||||
if (options.limit || options.offset) {
|
||||
this._results = reduce(options, this._results)
|
||||
}
|
||||
|
||||
return this._results
|
||||
}
|
||||
|
||||
/**
|
||||
* find files
|
||||
*
|
||||
* @param {[type]} dirPath [description]
|
||||
* @param {Object} [parameters={}] [description]
|
||||
* @param {Object} [options={}] [description]
|
||||
* @return {[type]}
|
||||
*
|
||||
*/
|
||||
_findFiles(dirPath, options) {
|
||||
|
||||
// getting all files
|
||||
const files = fs.readdirSync(dirPath + options.parent, {
|
||||
withFileTypes: true
|
||||
})
|
||||
|
||||
files.forEach((file) => {
|
||||
|
||||
// skip for file that is not markdown
|
||||
if (file.isFile() && path.extname(file.name) !== this.FILE_EXTENSION ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// skip for file that is index but not root
|
||||
if (file.isFile() && file.name === (this.FILE_INDEX + this.FILE_EXTENSION) && options.parent !== '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// skip for directory that contains partials
|
||||
if (file.isDirectory() && file.name === this.DIRECTORY_BLOCKS) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if directory going deep
|
||||
if (file.isDirectory() && (options.deep > 0 || options.deep === -1)) {
|
||||
|
||||
if (options.deep > 0) {
|
||||
options.deep--
|
||||
}
|
||||
|
||||
const childrenOptions = Object.assign({}, options, {
|
||||
'parent': options.parent + '/' + file.name
|
||||
})
|
||||
|
||||
this._findFiles(dirPath, childrenOptions)
|
||||
}
|
||||
|
||||
// get file
|
||||
const content = this._getFile(file, dirPath + options.parent)
|
||||
|
||||
// skip if empty
|
||||
if (!content) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check if
|
||||
const blocks = this._getBlocks(dirPath + options.parent + '/' + file.name)
|
||||
|
||||
// create page object and add to page
|
||||
const page = new PageFactory(file, options.parent, content, blocks)
|
||||
|
||||
// check for filters and skip
|
||||
if (this._filter && !this._filter.validate(page.get())) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._results.push(page.get())
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {string} dirPath
|
||||
* @return {array}
|
||||
*
|
||||
*/
|
||||
_getBlocks(dirPath) {
|
||||
const blocksQuery = new BlocksQuery(dirPath)
|
||||
return blocksQuery.find()
|
||||
}
|
||||
|
||||
/**
|
||||
* get file content
|
||||
*
|
||||
* @param {string} slug
|
||||
* @param {string} sourcePath
|
||||
* @return {mixed}
|
||||
*
|
||||
*/
|
||||
_getFile(file, dirPath) {
|
||||
|
||||
// file
|
||||
let result = null
|
||||
|
||||
// path of file, first try with slug
|
||||
let filePath = dirPath + '/' + file.name
|
||||
|
||||
if (fs.existsSync(filePath) && file.isFile()) {
|
||||
result = fs.readFileSync(filePath, 'utf8')
|
||||
} else {
|
||||
filePath = dirPath + '/' + file.name + '/' + this.FILE_INDEX + this.FILE_EXTENSION
|
||||
|
||||
if (fs.existsSync(filePath)) {
|
||||
result = fs.readFileSync(filePath, 'utf8')
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Pages
|
@ -1,8 +0,0 @@
|
||||
const Siteomat = require('./src/siteomat.js')
|
||||
|
||||
const siteomat = new Siteomat('./example/site', './example/views', {
|
||||
'destination': './public',
|
||||
'minifyHtml': false
|
||||
})
|
||||
|
||||
siteomat.run()
|
@ -1,24 +0,0 @@
|
||||
const { assert } = require('chai')
|
||||
const fs = require('fs')
|
||||
|
||||
describe('Blocks', function () {
|
||||
|
||||
// get function parseMarkdownFile
|
||||
const BlocksQuery = require('./../src/queries/blocks.js')
|
||||
|
||||
const blocksQuery = new BlocksQuery('./ressources')
|
||||
const results = blocksQuery.find()
|
||||
|
||||
// check results
|
||||
it('block is array', function() {
|
||||
assert.isArray(results.block)
|
||||
})
|
||||
|
||||
it('block has length of 2', function() {
|
||||
assert.equal(results.block.length, 2)
|
||||
})
|
||||
|
||||
it('title in first block are equal', function() {
|
||||
assert.equal(results.block[0].title, 'health goth DIY tattooed')
|
||||
})
|
||||
})
|
@ -1,41 +0,0 @@
|
||||
const { assert } = require('chai')
|
||||
const fs = require('fs')
|
||||
|
||||
describe('Parser Markdown', function () {
|
||||
|
||||
// default file
|
||||
const markdownData = fs.readFileSync('./ressources/default.md', 'utf8')
|
||||
|
||||
// get function parseMarkdownFile
|
||||
const parseMarkdownFile = require('./../src/parsers/markdown.js')
|
||||
|
||||
// start parsing
|
||||
const result = parseMarkdownFile(markdownData)
|
||||
|
||||
// check results
|
||||
it('fields exists', function() {
|
||||
assert.notEqual(result.fields, undefined)
|
||||
})
|
||||
|
||||
it('fields is object', function() {
|
||||
assert.isObject(result.fields)
|
||||
})
|
||||
|
||||
it('fields are valid', function() {
|
||||
assert.deepEqual(result.fields, {
|
||||
title: 'health goth DIY tattooed',
|
||||
view: 'page.njk',
|
||||
meta: {
|
||||
description: 'DSA yes plz hot chicken green juice'
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('content exists', function() {
|
||||
assert.notEqual(result.content, '')
|
||||
})
|
||||
|
||||
it('content has html', function() {
|
||||
assert.match(result.content, /<h2 id="normcore-cold-pressed-ramps-dsa">Normcore cold-pressed ramps DSA<\/h2>/)
|
||||
})
|
||||
})
|
Loading…
Reference in new issue