move configuration from flags to config
This commit is contained in:
parent
6a83b98b0c
commit
585a098243
2 changed files with 4 additions and 4 deletions
|
|
@ -6,6 +6,10 @@ import { feedPlugin } from "@11ty/eleventy-plugin-rss";
|
||||||
import { IdAttributePlugin } from "@11ty/eleventy";
|
import { IdAttributePlugin } from "@11ty/eleventy";
|
||||||
|
|
||||||
export default function (eleventyConfig) {
|
export default function (eleventyConfig) {
|
||||||
|
eleventyConfig.setInputDirectory("site-src");
|
||||||
|
eleventyConfig.setLayoutsDirectory("layout");
|
||||||
|
eleventyConfig.setTemplateFormats(["mdx", "njk"]);
|
||||||
|
|
||||||
eleventyConfig.addExtension("mdx", {
|
eleventyConfig.addExtension("mdx", {
|
||||||
compile: async (str, inputPath) => {
|
compile: async (str, inputPath) => {
|
||||||
const { default: mdxContent } = await evaluate(str, {
|
const { default: mdxContent } = await evaluate(str, {
|
||||||
|
|
@ -30,7 +34,5 @@ export default function (eleventyConfig) {
|
||||||
eleventyConfig.addPassthroughCopy("site-src/*.png");
|
eleventyConfig.addPassthroughCopy("site-src/*.png");
|
||||||
eleventyConfig.addPassthroughCopy("site-src/**/*.html");
|
eleventyConfig.addPassthroughCopy("site-src/**/*.html");
|
||||||
|
|
||||||
eleventyConfig.setLayoutsDirectory("layout");
|
|
||||||
|
|
||||||
eleventyConfig.addGlobalData("layout", "page.njk");
|
eleventyConfig.addGlobalData("layout", "page.njk");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,11 @@
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
self-pkgs = self.packages.${system};
|
self-pkgs = self.packages.${system};
|
||||||
|
|
||||||
default-flags = ["--formats=mdx" "--input=site-src"];
|
|
||||||
eleventy-shortcut = { name, args ? [] }: pkgs.writeShellApplication {
|
eleventy-shortcut = { name, args ? [] }: pkgs.writeShellApplication {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
npx @11ty/eleventy \
|
npx @11ty/eleventy \
|
||||||
${pkgs.lib.escapeShellArgs default-flags} \
|
|
||||||
${pkgs.lib.escapeShellArgs args} \
|
${pkgs.lib.escapeShellArgs args} \
|
||||||
"$@"
|
"$@"
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue