refactor: convert files from spaces to tabs

This commit is contained in:
Stefan Imhoff
2022-08-24 10:15:43 +02:00
parent 1685aa561f
commit d555778570
69 changed files with 39605 additions and 39600 deletions

View File

@@ -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));
},
};

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -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>`;
},
},
};