Skip to content

Commit

Permalink
adds elevently to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
atralice committed Feb 15, 2022
1 parent 238b56f commit 7ec31e0
Show file tree
Hide file tree
Showing 136 changed files with 19,087 additions and 670 deletions.
73 changes: 73 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
const eleventyNavigationPlugin = require('@11ty/eleventy-navigation')
const toBootstrapNav = require('eleventy-navigation-bootstrap')
const pluginTOC = require('eleventy-plugin-toc')
const markdownIt = require('markdown-it')
const markdownItAnchor = require('markdown-it-anchor')
const markdownItHighlightJS = require('markdown-it-highlightjs')
const readerBar = require('henry-reader-bar')
const readingTime = require('henry-reading-time')

const mdOptions = {
html: true,
breaks: true,
linkify: true,
typographer: true,
}

const mdAnchorOpts = {
permalink: true,
permalinkClass: 'anchor-link',
permalinkSymbol: '',
level: [1, 2, 3, 4],
}

module.exports = function (eleventyConfig) {
eleventyConfig.setLibrary(
'md',
markdownIt(mdOptions)
.use(markdownItAnchor, mdAnchorOpts)
.use(markdownItHighlightJS)
)

eleventyConfig.addPlugin(eleventyNavigationPlugin)
eleventyConfig.addPlugin(readingTime)
eleventyConfig.addPlugin(readerBar)
eleventyConfig.addPlugin(syntaxHighlight)

eleventyConfig.addPlugin(pluginTOC, {
tags: ['h2', 'h3'],
ul: true,
})

eleventyConfig.addLinter(
'Spelling check',
function (content, inputPath, outputPath) {
let words = 'lenght, .lenght, .rigth'.split(',')

// Eleventy 1.0+: use this.inputPath and this.outputPath instead
if (inputPath.endsWith('.md')) {
for (let word of words) {
let regexp = new RegExp('\\b(' + word + ')\\b', 'gi')
if (content.match(regexp)) {
console.warn(`Spelling check (${inputPath}) Found: ${word}`)
}
}
}
}
)

eleventyConfig.addPassthroughCopy('_src/assets')
eleventyConfig.addPassthroughCopy("_src/localStyles")

eleventyConfig.addNunjucksFilter('bootstrapNav', toBootstrapNav)

return {
dir: {
layouts: '/_src/layouts',
data: '/_src/data',
output: '_dist',
},
}
}

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
.idea
node_modules
package-lock.json

# Eleventy build
_dist
_cache
/_src/localStyles

Loading

0 comments on commit 7ec31e0

Please sign in to comment.