diff --git a/.cspell/codeberg.txt b/.cspell/codeberg.txt new file mode 100644 index 0000000..afb831d --- /dev/null +++ b/.cspell/codeberg.txt @@ -0,0 +1,2 @@ +Codeberg +Forgejo diff --git a/.ecrc b/.ecrc new file mode 100644 index 0000000..8cd5898 --- /dev/null +++ b/.ecrc @@ -0,0 +1,3 @@ +{ + "Exclude": ["LICENSE", ".git*"] +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ea56647 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +tab_width = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false +indent_size = 1 + +[Makefile] +indent_style = tab diff --git a/.eleventy.js b/.eleventy.js index 571921d..5a669c9 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,81 +1,85 @@ -const navigationPlugin = require("@11ty/eleventy-navigation") -const syntaxHighlightingPlugin = require("@11ty/eleventy-plugin-syntaxhighlight") +const navigationPlugin = require('@11ty/eleventy-navigation'); +const syntaxHighlightingPlugin = require('@11ty/eleventy-plugin-syntaxhighlight'); const markdownIt = require('markdown-it'); const tableOfContentsPlugin = require('@uncenter/eleventy-plugin-toc'); const markdownItClass = require('@toycode/markdown-it-class'); -const markdownItAnchor = require('markdown-it-anchor') +const markdownItAnchor = require('markdown-it-anchor'); const library = require('@fortawesome/fontawesome-svg-core').library; const icon = require('@fortawesome/fontawesome-svg-core').icon; const fas = require('@fortawesome/free-solid-svg-icons').fas; const { execSync } = require('child_process'); -module.exports = function(eleventyConfig) { - eleventyConfig.addPlugin(navigationPlugin) - eleventyConfig.addPlugin(syntaxHighlightingPlugin) +module.exports = function (eleventyConfig) { + eleventyConfig.addPlugin(navigationPlugin); + eleventyConfig.addPlugin(syntaxHighlightingPlugin); - eleventyConfig.addPassthroughCopy("assets") - eleventyConfig.addPassthroughCopy("fonts") + eleventyConfig.addPassthroughCopy('assets'); + eleventyConfig.addPassthroughCopy('fonts'); // Font Awesome Icons - library.add(fas) - eleventyConfig.addShortcode("fas_icon", function(args) { - var fas_svg = icon({ prefix: 'fas', iconName: args }); - return `${fas_svg.html}`; + library.add(fas); + eleventyConfig.addShortcode('fas_icon', function (args) { + var fas_svg = icon({ prefix: 'fas', iconName: args }); + return `${fas_svg.html}`; }); const mapping = { - h2: 'content-title',h3: 'content-title',h4: 'content-title',h5: 'content-title',h6: 'content-title', + h2: 'content-title', + h3: 'content-title', + h4: 'content-title', + h5: 'content-title', + h6: 'content-title', table: 'table', - blockquote: 'alert' + blockquote: 'alert', }; - + const mdOptions = { linkify: false, html: true }; - const mdAnchorOpts = { + const mdAnchorOpts = { permalink: markdownItAnchor.permalink.headerLink(), - permalinkClass: 'ml-5', permalinkSymbol: '#', level: [1, 2, 3, 4] - } - + permalinkClass: 'ml-5', + permalinkSymbol: '#', + level: [1, 2, 3, 4], + }; + eleventyConfig.setLibrary( 'md', - markdownIt(mdOptions) - .use(markdownItClass, mapping) - .use(markdownItAnchor, mdAnchorOpts) - ) - - eleventyConfig.addPairedShortcode("admonition", function(content, type, title) { - let titleStr = ""; - if(title) { + markdownIt(mdOptions).use(markdownItClass, mapping).use(markdownItAnchor, mdAnchorOpts), + ); + + eleventyConfig.addPairedShortcode('admonition', function (content, type, title) { + let titleStr = ''; + if (title) { titleStr = title; - } else if(type) { + } else if (type) { titleStr = type.substring(0, 1).toUpperCase() + type.substring(1).toLowerCase(); } else { - titleStr = "Info"; + titleStr = 'Info'; } - - return `