minor clean up

This commit is contained in:
madrilene 2022-12-21 09:34:41 +01:00
parent 55be1e15e4
commit 87e19c32e3
4 changed files with 4 additions and 32 deletions

View file

@ -101,7 +101,7 @@ module.exports = eleventyConfig => {
eleventyConfig.addPassthroughCopy(path)
);
// social icons and manifest to root directory
// social icons to root directory
eleventyConfig.addPassthroughCopy({
'src/assets/images/favicon/*': '/'
});

View file

@ -1,6 +1,6 @@
const slugify = require('slugify');
/** Converts the given string to a slug form. */
/** Converts string to a slug form. */
const slugifyString = str => {
return slugify(str, {
replacement: '-',
@ -9,7 +9,7 @@ const slugifyString = str => {
});
};
/** Helper to throw an error if the provided argument is not of the expected. */
/** throw an error if the provided argument is not of the expected. */
const throwIfNotType = (arg, expectedType) => {
if (typeof arg !== expectedType) {
throw new Error(

View file

@ -80,7 +80,7 @@ npm start
### Creating a production build
Minify JS, inline and minify CSS.
Minify JS, CSS and HTML.
```
npm run build

View file

@ -1,28 +0,0 @@
const md = require('markdown-it')();
/**
* Render content as inline markdown if single line, or full
* markdown if multiline
* @param {string} [content]
* @param {import('markdown-it').Options} [opts]
* @return {string|undefined}
*/
module.exports = (content, opts) => {
if (!content) {
return;
}
if (opts) {
md.set(opts);
}
let inline = !content.includes('\n');
// If there's quite a bit of content, we want to make sure
// it's marked up for readability purposes
if (inline && content.length > 200) {
inline = false;
}
return inline ? md.renderInline(content) : md.render(content);
};