From 393ac1f7a436d3243dae83c5edecf95afd03bac4 Mon Sep 17 00:00:00 2001 From: Ross Phillips Date: Thu, 1 Jul 2021 15:07:31 +1200 Subject: [PATCH] Add pages path and return original config --- .eleventy.js | 1 + cloudcannon/info.njk | 2 ++ cloudcannon/inject-cloudcannon.config.js | 1 + 3 files changed, 4 insertions(+) diff --git a/.eleventy.js b/.eleventy.js index 824634e..ab84680 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -9,6 +9,7 @@ module.exports = function (eleventyConfig, defaultConfig = {}) { dir: { input: defaultConfig.dir?.input ?? '.', data: defaultConfig.dir?.data ?? '_data', // relative to input + pages: defaultConfig.dir?.pages ?? '', // relative to input includes: defaultConfig.dir?.includes ?? '_includes', // relative to input layouts: defaultConfig.dir?.layouts ?? '_includes', // relative to input } diff --git a/cloudcannon/info.njk b/cloudcannon/info.njk index d65cab7..add4673 100644 --- a/cloudcannon/info.njk +++ b/cloudcannon/info.njk @@ -3,6 +3,7 @@ eleventyExcludeFromCollections: true permalink: /_cloudcannon/info.json --- {%- set inputPath %}{% ccPath 'input' %}{% endset -%} +{%- set pagesPath %}{% ccPath 'pages' %}{% endset -%} {%- set dataPath %}{% ccPath 'data' %}{% endset -%} {%- set includesPath %}{% ccPath 'includes' %}{% endset -%} {%- set layoutsPath %}{% ccPath 'layouts' %}{% endset -%} @@ -75,6 +76,7 @@ permalink: /_cloudcannon/info.json {% if cloudcannon.uploads_dir %} "uploads": "{{ cloudcannon.uploads_dir }}", {% endif %} + "pages": {{ pagesPath | ccJsonify | safe }}, "data": {{ dataPath | ccJsonify | safe }}, "collections": "", "includes": {{ includesPath | ccJsonify | safe }}, diff --git a/cloudcannon/inject-cloudcannon.config.js b/cloudcannon/inject-cloudcannon.config.js index ceeccae..8d0a18f 100644 --- a/cloudcannon/inject-cloudcannon.config.js +++ b/cloudcannon/inject-cloudcannon.config.js @@ -13,4 +13,5 @@ module.exports = function (eleventyConfig) { const config = defaultConfig?.apply(this, arguments); eleventyConfig.addPlugin(pluginCloudCannon, eleventyConfig.cloudcannonOptions ?? config); + return config; };