mirror of
https://github.com/kogakure/website-11ty-hamburg.stefanimhoff.de.git
synced 2026-02-04 04:35:29 +00:00
refactor: convert files from spaces to tabs
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
const moment = require('moment');
|
||||
|
||||
module.exports = {
|
||||
dateToFormat: function (date, format = 'MMMM Do, YYYY') {
|
||||
return moment(date).format(format);
|
||||
},
|
||||
dateToISO: function (date) {
|
||||
return moment(date).format();
|
||||
},
|
||||
sortByTitle: function (values) {
|
||||
return values
|
||||
.slice()
|
||||
.sort((a, b) => a.data.title.localeCompare(b.data.title));
|
||||
},
|
||||
dateToFormat: function (date, format = 'MMMM Do, YYYY') {
|
||||
return moment(date).format(format);
|
||||
},
|
||||
dateToISO: function (date) {
|
||||
return moment(date).format();
|
||||
},
|
||||
sortByTitle: function (values) {
|
||||
return values.slice().sort((a, b) => a.data.title.localeCompare(b.data.title));
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
const htmlmin = require('html-minifier');
|
||||
|
||||
module.exports = function (content, outputPath) {
|
||||
if (outputPath.endsWith('.html')) {
|
||||
let minified = htmlmin.minify(content, {
|
||||
useShortDoctype: true,
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
});
|
||||
if (outputPath.endsWith('.html')) {
|
||||
let minified = htmlmin.minify(content, {
|
||||
useShortDoctype: true,
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
});
|
||||
|
||||
return minified;
|
||||
}
|
||||
return minified;
|
||||
}
|
||||
|
||||
return content;
|
||||
return content;
|
||||
};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const UglifyJS = require('uglify-js');
|
||||
|
||||
module.exports = function (code) {
|
||||
let minified = UglifyJS.minify(code);
|
||||
let minified = UglifyJS.minify(code);
|
||||
|
||||
if (minified.error) {
|
||||
console.log('UglifyJS error: ', minified.error);
|
||||
return code;
|
||||
}
|
||||
if (minified.error) {
|
||||
console.log('UglifyJS error: ', minified.error);
|
||||
return code;
|
||||
}
|
||||
|
||||
return minified.code;
|
||||
return minified.code;
|
||||
};
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
const outdent = require('outdent')({
|
||||
newline: ' ',
|
||||
newline: ' ',
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
email: function (text, key = false) {
|
||||
const downloadText = 'Download public key (ProtonMail/GPG)';
|
||||
const link = outdent`
|
||||
email: function (text, key = false) {
|
||||
const downloadText = 'Download public key (ProtonMail/GPG)';
|
||||
const link = outdent`
|
||||
<a id="email" class="objuscated" href="mailto:hey (at) imhoff (dot) name">
|
||||
${text}
|
||||
</a>`;
|
||||
const keyDownload = outdent`
|
||||
const keyDownload = outdent`
|
||||
<span id="lock-box" class="lock-box hidden">
|
||||
<a
|
||||
title="${downloadText}"
|
||||
@@ -21,20 +21,20 @@ module.exports = {
|
||||
</svg>
|
||||
</a></span>`;
|
||||
|
||||
return `${link} ${key ? keyDownload : ''}`;
|
||||
},
|
||||
map: function (mid) {
|
||||
return outdent`
|
||||
return `${link} ${key ? keyDownload : ''}`;
|
||||
},
|
||||
map: function (mid) {
|
||||
return outdent`
|
||||
<iframe class="map" src="https://www.google.com/maps/d/u/0/embed?mid=${mid}" width="1000" height="500">
|
||||
</iframe>`;
|
||||
},
|
||||
youtube: function (id) {
|
||||
return outdent`
|
||||
},
|
||||
youtube: function (id) {
|
||||
return outdent`
|
||||
<div class="video-wrapper">
|
||||
<iframe src="https://www.youtube.com/embed/${id}"
|
||||
frameborder="0" allowfullscreen
|
||||
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture">
|
||||
</iframe>
|
||||
</div>`;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user