minor clean up
This commit is contained in:
parent
55be1e15e4
commit
87e19c32e3
4 changed files with 4 additions and 32 deletions
|
|
@ -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/*': '/'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ npm start
|
|||
|
||||
### Creating a production build
|
||||
|
||||
Minify JS, inline and minify CSS.
|
||||
Minify JS, CSS and HTML.
|
||||
|
||||
```
|
||||
npm run build
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
Loading…
Reference in a new issue