Skip to content

Commit

Permalink
chore: update 11ty config
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Feb 12, 2023
1 parent b2ce156 commit b32e9f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.13.0
v18.12.1
20 changes: 7 additions & 13 deletions .eleventy.cjs → eleventy.config.cjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const directoryOutputPlugin = require('@11ty/eleventy-plugin-directory-output');
const toc = require('eleventy-plugin-toc');
const markdownIt = require('markdown-it')
const SyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const DirectoryOutputPlugin = require('@11ty/eleventy-plugin-directory-output');
const TableOfContentsPlugin = require('eleventy-plugin-toc');
const markdownItAnchor = require('markdown-it-anchor')
const fs = require('fs/promises');
const path = require('path');

// const litLabsSSR11ty = require('./lit-labs-ssr-11ty.cjs');

module.exports = function(eleventyConfig) {
eleventyConfig.setLibrary('md', markdownIt({ html: true }).use(markdownItAnchor));
eleventyConfig.amendLibrary('md', md => md.use(markdownItAnchor));

eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(toc);
eleventyConfig.addPlugin(directoryOutputPlugin);
eleventyConfig.addPlugin(SyntaxHighlight);
eleventyConfig.addPlugin(TableOfContentsPlugin);
eleventyConfig.addPlugin(DirectoryOutputPlugin);

eleventyConfig.addWatchTarget('docs/*.css');

Expand Down Expand Up @@ -57,12 +54,9 @@ ${content}
`;
})

// eleventyConfig.addPlugin(litLabsSSR11ty);

// Return your Object options:
return {
templateEngineOverride: 'njk,md',
pathPrefix: process.env.CONTEXT === 'deploy-preview' ? '' : '/stripe-elements/',
dir: {
input: "docs",
output: "_site"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"build:types": "tsc --emitDeclarationOnly && cp src/*.d.ts . && cp src/lib/*.d.ts ./lib/",
"build:esbuild": "node scripts/build.js",
"build:analyze": "cem analyze",
"docs": "eleventy --config=.eleventy.cjs",
"start": "eleventy --config=.eleventy.cjs --watch --serve",
"docs": "eleventy --incremental",
"start": "eleventy --incremental --watch --serve",
"clean": "run-s clean:*",
"clean:src": "rimraf '{src,test,lib}/**/!(global).{js,js.map,d.ts}'",
"clean:index": "rimraf './!(*.config|web-*).{js,js.map,d.ts}'",
Expand Down

0 comments on commit b32e9f4

Please sign in to comment.