From 8402627e3f683a61a17e8dc1048760eb4e74761a Mon Sep 17 00:00:00 2001 From: Ross Phillips <12723297+rphillips-cc@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:22:54 +1200 Subject: [PATCH] Sort collection_config entries by name and output, update output/disable_url --- package-lock.json | 54 +++++---- package.json | 8 +- src/index.js | 12 +- src/ssgs/eleventy.js | 6 +- src/ssgs/hugo.js | 5 +- src/ssgs/jekyll.js | 26 ++--- src/ssgs/ssg.js | 41 ++++++- toolproof_tests/eleventy/base.toolproof.yml | 8 +- .../eleventy/subfolder-source.toolproof.yml | 8 +- .../templates-in-source.toolproof.yml | 18 ++- toolproof_tests/hugo/base.toolproof.yml | 22 ++-- toolproof_tests/hugo/data-dir.toolproof.yml | 22 ++-- toolproof_tests/hugo/data-only.toolproof.yml | 4 +- .../hugo/example-site-only.toolproof.yml | 22 ++-- .../hugo/one-nested-page.toolproof.yml | 1 - .../hugo/subfolder-source.toolproof.yml | 22 ++-- toolproof_tests/jekyll/base.toolproof.yml | 103 +++++++++--------- .../jekyll/default-collections.toolproof.yml | 75 ++++++------- .../jekyll/empty-collection.toolproof.yml | 3 +- .../jekyll/page-in-subfolder.toolproof.yml | 2 +- .../single-page-in-subfolder.toolproof.yml | 3 +- toolproof_tests/jekyll/sort.toolproof.yml | 2 +- .../justice-eleventy-template.toolproof.yml | 21 ++-- toolproof_tests/simple_11ty.toolproof.yml | 3 +- toolproof_tests/vonge_jekyll.toolproof.yml | 53 ++++----- 25 files changed, 281 insertions(+), 263 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b62cd8..23b8a49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,15 +17,15 @@ "titleize": "^4.0.0" }, "devDependencies": { - "@cloudcannon/configuration-types": "0.0.12", + "@cloudcannon/configuration-types": "^0.0.13", "@types/he": "^1.2.3", "@types/js-yaml": "^4.0.9", - "@types/node": "^22.5.2", + "@types/node": "^22.5.4", "ava": "^6.1.3", "c8": "^10.1.2", - "eslint": "^9.9.1", + "eslint": "^9.10.0", "prettier": "^3.3.3", - "typescript": "^5.5.4" + "typescript": "^5.6.2" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -44,9 +44,9 @@ "dev": true }, "node_modules/@cloudcannon/configuration-types": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@cloudcannon/configuration-types/-/configuration-types-0.0.12.tgz", - "integrity": "sha512-5AO9gkG9CPpOoJO6UZ+WAxdjK0v5qd3ixLqKouKYEyTamgCpG1D1JQIkyzRXweG/ExfBjOLu8/tr7/P9Yo0dkQ==", + "version": "0.0.13", + "resolved": "https://registry.npmjs.org/@cloudcannon/configuration-types/-/configuration-types-0.0.13.tgz", + "integrity": "sha512-/93Geyamu4leQuZLRP3izxzUgTObfeGt/dUIdwW7phCArueqtC4P0gmMbkRb6dRIUWQA4R1wGa5pYMwH8AThiw==", "dev": true, "dependencies": { "@cloudcannon/snippet-types": "^1.1.11", @@ -121,9 +121,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", - "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz", + "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -138,6 +138,18 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/plugin-kit": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz", + "integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==", + "dev": true, + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -462,9 +474,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.2.tgz", - "integrity": "sha512-acJsPTEqYqulZS/Yp/S3GgeE6GZ0qYODUR8aVr/DkhHQ8l9nd4j5x1/ZJy9/gHrRlFMqkO6i0I3E27Alu4jjPg==", + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", "dev": true, "dependencies": { "undici-types": "~6.19.2" @@ -1172,16 +1184,17 @@ } }, "node_modules/eslint": { - "version": "9.9.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", - "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz", + "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.9.1", + "@eslint/js": "9.10.0", + "@eslint/plugin-kit": "^0.1.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -1204,7 +1217,6 @@ "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", @@ -3402,9 +3414,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index b307e29..cb58795 100644 --- a/package.json +++ b/package.json @@ -36,15 +36,15 @@ }, "author": "CloudCannon ", "devDependencies": { - "@cloudcannon/configuration-types": "0.0.12", + "@cloudcannon/configuration-types": "^0.0.13", "@types/he": "^1.2.3", "@types/js-yaml": "^4.0.9", - "@types/node": "^22.5.2", + "@types/node": "^22.5.4", "ava": "^6.1.3", "c8": "^10.1.2", - "eslint": "^9.9.1", + "eslint": "^9.10.0", "prettier": "^3.3.3", - "typescript": "^5.5.4" + "typescript": "^5.6.2" }, "license": "MIT", "dependencies": { diff --git a/src/index.js b/src/index.js index 0847f41..6ddaba5 100644 --- a/src/index.js +++ b/src/index.js @@ -51,11 +51,13 @@ export async function generateConfiguration(filePaths, options) { source, collections_config: options?.config?.collections_config || - ssg.generateCollectionsConfig(collectionPaths, { - source, - config, - basePath: findBasePath(collectionPaths), - }), + ssg.sortCollectionsConfig( + ssg.generateCollectionsConfig(collectionPaths, { + source, + config, + basePath: findBasePath(collectionPaths), + }), + ), paths: options?.config?.paths ?? undefined, timezone: options?.config?.timezone ?? ssg.getTimezone(), markdown: options?.config?.markdown ?? ssg.generateMarkdown(config), diff --git a/src/ssgs/eleventy.js b/src/ssgs/eleventy.js index 9347eda..0d813dd 100644 --- a/src/ssgs/eleventy.js +++ b/src/ssgs/eleventy.js @@ -69,7 +69,11 @@ export default class Eleventy extends Ssg { */ generateCollectionConfig(key, path, options) { const collectionConfig = super.generateCollectionConfig(key, path, options); - collectionConfig.output = !(path === '_data' || path.endsWith('/_data')); + + if (path === '_data' || path.endsWith('/_data')) { + collectionConfig.disable_url = true; + } + return collectionConfig; } diff --git a/src/ssgs/hugo.js b/src/ssgs/hugo.js index b0cbb2f..972f2e2 100644 --- a/src/ssgs/hugo.js +++ b/src/ssgs/hugo.js @@ -79,7 +79,10 @@ export default class Hugo extends Ssg { } const dataPath = this.getHugoDataPath(options.config); - collectionConfig.output = !(path === dataPath || path.endsWith(`/${dataPath}`)); + + if (path === dataPath || path.endsWith(`/${dataPath}`)) { + collectionConfig.disable_url = true; + } return collectionConfig; } diff --git a/src/ssgs/jekyll.js b/src/ssgs/jekyll.js index 9a0d567..b1dcec5 100644 --- a/src/ssgs/jekyll.js +++ b/src/ssgs/jekyll.js @@ -86,21 +86,6 @@ function getJekyllCollections(collections) { return formatted; } -/** - * Checks if a Jekyll collection is output. - * - * @param key {string} - * @param collection {Record | undefined} - * @returns {boolean} - */ -function isCollectionOutput(key, collection) { - if (key === 'data' || key === 'drafts' || key.endsWith('_drafts')) { - return false; - } - - return key === 'pages' || key === 'posts' || key.endsWith('_posts') || !!collection?.output; -} - export default class Jekyll extends Ssg { constructor() { super('jekyll'); @@ -145,7 +130,16 @@ export default class Jekyll extends Ssg { generateCollectionConfig(key, path, options) { const collectionConfig = super.generateCollectionConfig(key, path); - collectionConfig.output = isCollectionOutput(key, options.collection); + const isKnownOutputCollection = + key === 'pages' || + key === 'posts' || + key.endsWith('_posts') || + key === 'drafts' || + key.endsWith('_drafts'); + + if (key === 'data' || (!options.collection?.output && !isKnownOutputCollection)) { + collectionConfig.disable_url = true; + } if (options.collection?.sort_by && typeof options.collection?.sort_by === 'string') { collectionConfig.sort = { key: options.collection.sort_by }; diff --git a/src/ssgs/ssg.js b/src/ssgs/ssg.js index 45c19e7..39cfb73 100644 --- a/src/ssgs/ssg.js +++ b/src/ssgs/ssg.js @@ -358,7 +358,6 @@ export default class Ssg { path, name, icon: findIcon(name.toLowerCase()), - output: true, }; } @@ -433,6 +432,46 @@ export default class Ssg { return collectionsConfig; } + /** + * Generates collections config from a set of paths. + * + * @param collectionsConfig {import('../types').CollectionsConfig} + * @returns {import('../types').CollectionsConfig} + */ + sortCollectionsConfig(collectionsConfig) { + /** @type {import('../types').CollectionsConfig} */ + const sorted = {}; + + const sortedKeys = Object.keys(collectionsConfig).sort((a, b) => { + const aCollectionConfig = collectionsConfig[a]; + const bCollectionConfig = collectionsConfig[b]; + + if ( + a === 'pages' || + aCollectionConfig.path === '' || + (!aCollectionConfig.disable_url && bCollectionConfig.disable_url) + ) { + return -1; + } + + if ( + b === 'pages' || + bCollectionConfig.path === '' || + (!bCollectionConfig.disable_url && aCollectionConfig.disable_url) + ) { + return 1; + } + + return a.localeCompare(b); + }); + + for (const key of sortedKeys) { + sorted[key] = collectionsConfig[key]; + } + + return sorted; + } + /** * @param _config {Record | undefined} * @returns {import('@cloudcannon/configuration-types').MarkdownSettings} diff --git a/toolproof_tests/eleventy/base.toolproof.yml b/toolproof_tests/eleventy/base.toolproof.yml index 9d670cb..4ac37e7 100644 --- a/toolproof_tests/eleventy/base.toolproof.yml +++ b/toolproof_tests/eleventy/base.toolproof.yml @@ -17,20 +17,18 @@ steps: ╎ "pages": { ╎ "path": "", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "blog": { ╎ "path": "blog", ╎ "name": "Blog", - ╎ "icon": "event_available", - ╎ "output": true + ╎ "icon": "event_available" ╎ }, ╎ "data": { ╎ "path": "_data", ╎ "name": "Data", ╎ "icon": "data_usage", - ╎ "output": false + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/eleventy/subfolder-source.toolproof.yml b/toolproof_tests/eleventy/subfolder-source.toolproof.yml index a8c80ff..91235e5 100644 --- a/toolproof_tests/eleventy/subfolder-source.toolproof.yml +++ b/toolproof_tests/eleventy/subfolder-source.toolproof.yml @@ -18,20 +18,18 @@ steps: ╎ "pages": { ╎ "path": "", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "blog": { ╎ "path": "blog", ╎ "name": "Blog", - ╎ "icon": "event_available", - ╎ "output": true + ╎ "icon": "event_available" ╎ }, ╎ "data": { ╎ "path": "_data", ╎ "name": "Data", ╎ "icon": "data_usage", - ╎ "output": false + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/eleventy/templates-in-source.toolproof.yml b/toolproof_tests/eleventy/templates-in-source.toolproof.yml index 9ac0581..7266bc2 100644 --- a/toolproof_tests/eleventy/templates-in-source.toolproof.yml +++ b/toolproof_tests/eleventy/templates-in-source.toolproof.yml @@ -19,23 +19,21 @@ steps: ╎ "config": { ╎ "source": "sauce", ╎ "collections_config": { - ╎ "data": { - ╎ "path": "_data", - ╎ "name": "Data", - ╎ "icon": "data_usage", - ╎ "output": false - ╎ }, ╎ "pages": { ╎ "path": "content", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "blog": { ╎ "path": "content/blog", ╎ "name": "Blog", - ╎ "icon": "event_available", - ╎ "output": true + ╎ "icon": "event_available" + ╎ }, + ╎ "data": { + ╎ "path": "_data", + ╎ "name": "Data", + ╎ "icon": "data_usage", + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/hugo/base.toolproof.yml b/toolproof_tests/hugo/base.toolproof.yml index ade85dc..3fd1a2d 100644 --- a/toolproof_tests/hugo/base.toolproof.yml +++ b/toolproof_tests/hugo/base.toolproof.yml @@ -15,29 +15,27 @@ steps: ╎ "ssg": "hugo", ╎ "config": { ╎ "collections_config": { - ╎ "data": { - ╎ "path": "data", - ╎ "name": "Data", - ╎ "icon": "data_usage", - ╎ "output": false, - ╎ "glob": [ - ╎ "!_index.md" - ╎ ] - ╎ }, ╎ "pages": { ╎ "path": "content", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "blog": { ╎ "path": "content/blog", ╎ "name": "Blog", ╎ "icon": "event_available", - ╎ "output": true, ╎ "glob": [ ╎ "!_index.md" ╎ ] + ╎ }, + ╎ "data": { + ╎ "path": "data", + ╎ "name": "Data", + ╎ "icon": "data_usage", + ╎ "glob": [ + ╎ "!_index.md" + ╎ ], + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/hugo/data-dir.toolproof.yml b/toolproof_tests/hugo/data-dir.toolproof.yml index 175ba52..7e3a866 100644 --- a/toolproof_tests/hugo/data-dir.toolproof.yml +++ b/toolproof_tests/hugo/data-dir.toolproof.yml @@ -17,29 +17,27 @@ steps: ╎ "ssg": "hugo", ╎ "config": { ╎ "collections_config": { - ╎ "stats": { - ╎ "path": "stats", - ╎ "name": "Stats", - ╎ "icon": "stars", - ╎ "output": false, - ╎ "glob": [ - ╎ "!_index.md" - ╎ ] - ╎ }, ╎ "pages": { ╎ "path": "content", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "blog": { ╎ "path": "content/blog", ╎ "name": "Blog", ╎ "icon": "event_available", - ╎ "output": true, ╎ "glob": [ ╎ "!_index.md" ╎ ] + ╎ }, + ╎ "stats": { + ╎ "path": "stats", + ╎ "name": "Stats", + ╎ "icon": "stars", + ╎ "glob": [ + ╎ "!_index.md" + ╎ ], + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/hugo/data-only.toolproof.yml b/toolproof_tests/hugo/data-only.toolproof.yml index 658d8cc..9dd2bb3 100644 --- a/toolproof_tests/hugo/data-only.toolproof.yml +++ b/toolproof_tests/hugo/data-only.toolproof.yml @@ -15,10 +15,10 @@ steps: ╎ "path": "data", ╎ "name": "Data", ╎ "icon": "data_usage", - ╎ "output": false, ╎ "glob": [ ╎ "!_index.md" - ╎ ] + ╎ ], + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/hugo/example-site-only.toolproof.yml b/toolproof_tests/hugo/example-site-only.toolproof.yml index 4c8a2ac..732118e 100644 --- a/toolproof_tests/hugo/example-site-only.toolproof.yml +++ b/toolproof_tests/hugo/example-site-only.toolproof.yml @@ -14,29 +14,27 @@ steps: ╎ "config": { ╎ "source": "exampleSite", ╎ "collections_config": { - ╎ "data": { - ╎ "path": "data", - ╎ "name": "Data", - ╎ "icon": "data_usage", - ╎ "output": false, - ╎ "glob": [ - ╎ "!_index.md" - ╎ ] - ╎ }, ╎ "pages": { ╎ "path": "content", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "blog": { ╎ "path": "content/blog", ╎ "name": "Blog", ╎ "icon": "event_available", - ╎ "output": true, ╎ "glob": [ ╎ "!_index.md" ╎ ] + ╎ }, + ╎ "data": { + ╎ "path": "data", + ╎ "name": "Data", + ╎ "icon": "data_usage", + ╎ "glob": [ + ╎ "!_index.md" + ╎ ], + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/hugo/one-nested-page.toolproof.yml b/toolproof_tests/hugo/one-nested-page.toolproof.yml index 912a4f8..9cb3757 100644 --- a/toolproof_tests/hugo/one-nested-page.toolproof.yml +++ b/toolproof_tests/hugo/one-nested-page.toolproof.yml @@ -15,7 +15,6 @@ steps: ╎ "path": "content/blog", ╎ "name": "Content Blog", ╎ "icon": "content_copy", - ╎ "output": true, ╎ "glob": [ ╎ "!_index.md" ╎ ] diff --git a/toolproof_tests/hugo/subfolder-source.toolproof.yml b/toolproof_tests/hugo/subfolder-source.toolproof.yml index fa9c3d0..16e5479 100644 --- a/toolproof_tests/hugo/subfolder-source.toolproof.yml +++ b/toolproof_tests/hugo/subfolder-source.toolproof.yml @@ -17,29 +17,27 @@ steps: ╎ "config": { ╎ "source": "sauce", ╎ "collections_config": { - ╎ "data": { - ╎ "path": "data", - ╎ "name": "Data", - ╎ "icon": "data_usage", - ╎ "output": false, - ╎ "glob": [ - ╎ "!_index.md" - ╎ ] - ╎ }, ╎ "pages": { ╎ "path": "content", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "blog": { ╎ "path": "content/blog", ╎ "name": "Blog", ╎ "icon": "event_available", - ╎ "output": true, ╎ "glob": [ ╎ "!_index.md" ╎ ] + ╎ }, + ╎ "data": { + ╎ "path": "data", + ╎ "name": "Data", + ╎ "icon": "data_usage", + ╎ "glob": [ + ╎ "!_index.md" + ╎ ], + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/jekyll/base.toolproof.yml b/toolproof_tests/jekyll/base.toolproof.yml index 70cac5c..e81b8fa 100644 --- a/toolproof_tests/jekyll/base.toolproof.yml +++ b/toolproof_tests/jekyll/base.toolproof.yml @@ -78,41 +78,33 @@ steps: ╎ "ssg": "jekyll", ╎ "config": { ╎ "collections_config": { - ╎ "staff": { - ╎ "path": "collections/_staff", - ╎ "name": "Staff", - ╎ "icon": "people", - ╎ "output": false - ╎ }, - ╎ "collection_data": { - ╎ "path": "collections/_data", - ╎ "name": "Collection Data", - ╎ "icon": "collections", - ╎ "output": false - ╎ }, ╎ "pages": { ╎ "path": "", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, - ╎ "data": { - ╎ "path": "_data", - ╎ "name": "Data", - ╎ "icon": "data_usage", - ╎ "output": false + ╎ "drafts": { + ╎ "path": "collections/_drafts", + ╎ "name": "Drafts", + ╎ "icon": "event", + ╎ "create": { + ╎ "path": "", + ╎ "publish_to": "posts" + ╎ } ╎ }, - ╎ "data_animals": { - ╎ "path": "_data/animals", - ╎ "name": "Data Animals", - ╎ "icon": "data_array", - ╎ "output": false + ╎ "news_drafts": { + ╎ "path": "collections/news/_drafts", + ╎ "name": "News Drafts", + ╎ "icon": "drafts", + ╎ "create": { + ╎ "path": "", + ╎ "publish_to": "news_posts" + ╎ } ╎ }, - ╎ "posts": { - ╎ "path": "collections/_posts", - ╎ "name": "Posts", - ╎ "icon": "event_available", - ╎ "output": true, + ╎ "news_posts": { + ╎ "path": "collections/news/_posts", + ╎ "name": "News Posts", + ╎ "icon": "newspaper", ╎ "create": { ╎ "path": "[relative_base_path]/{date|year}-{date|month}-{date|day}-{title|slugify}.[ext]" ╎ }, @@ -122,15 +114,14 @@ steps: ╎ }, ╎ { ╎ "name": "Add Draft", - ╎ "collection": "drafts" + ╎ "collection": "news_drafts" ╎ } ╎ ] ╎ }, - ╎ "news_posts": { - ╎ "path": "collections/news/_posts", - ╎ "name": "News Posts", - ╎ "icon": "newspaper", - ╎ "output": true, + ╎ "posts": { + ╎ "path": "collections/_posts", + ╎ "name": "Posts", + ╎ "icon": "event_available", ╎ "create": { ╎ "path": "[relative_base_path]/{date|year}-{date|month}-{date|day}-{title|slugify}.[ext]" ╎ }, @@ -140,29 +131,33 @@ steps: ╎ }, ╎ { ╎ "name": "Add Draft", - ╎ "collection": "news_drafts" + ╎ "collection": "drafts" ╎ } ╎ ] ╎ }, - ╎ "drafts": { - ╎ "path": "collections/_drafts", - ╎ "name": "Drafts", - ╎ "icon": "event", - ╎ "output": false, - ╎ "create": { - ╎ "path": "", - ╎ "publish_to": "posts" - ╎ } + ╎ "collection_data": { + ╎ "path": "collections/_data", + ╎ "name": "Collection Data", + ╎ "icon": "collections", + ╎ "disable_url": true ╎ }, - ╎ "news_drafts": { - ╎ "path": "collections/news/_drafts", - ╎ "name": "News Drafts", - ╎ "icon": "drafts", - ╎ "output": false, - ╎ "create": { - ╎ "path": "", - ╎ "publish_to": "news_posts" - ╎ } + ╎ "data": { + ╎ "path": "_data", + ╎ "name": "Data", + ╎ "icon": "data_usage", + ╎ "disable_url": true + ╎ }, + ╎ "data_animals": { + ╎ "path": "_data/animals", + ╎ "name": "Data Animals", + ╎ "icon": "data_array", + ╎ "disable_url": true + ╎ }, + ╎ "staff": { + ╎ "path": "collections/_staff", + ╎ "name": "Staff", + ╎ "icon": "people", + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/jekyll/default-collections.toolproof.yml b/toolproof_tests/jekyll/default-collections.toolproof.yml index 9e5d447..baf26e7 100644 --- a/toolproof_tests/jekyll/default-collections.toolproof.yml +++ b/toolproof_tests/jekyll/default-collections.toolproof.yml @@ -17,20 +17,30 @@ steps: ╎ "pages": { ╎ "path": "", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, - ╎ "data": { - ╎ "path": "_data", - ╎ "name": "Data", - ╎ "icon": "data_usage", - ╎ "output": false + ╎ "drafts": { + ╎ "path": "_drafts", + ╎ "name": "Drafts", + ╎ "icon": "event", + ╎ "create": { + ╎ "path": "", + ╎ "publish_to": "posts" + ╎ } ╎ }, - ╎ "posts": { - ╎ "path": "_posts", - ╎ "name": "Posts", - ╎ "icon": "event_available", - ╎ "output": true, + ╎ "news_drafts": { + ╎ "path": "news/_drafts", + ╎ "name": "News Drafts", + ╎ "icon": "drafts", + ╎ "create": { + ╎ "path": "", + ╎ "publish_to": "news_posts" + ╎ } + ╎ }, + ╎ "news_posts": { + ╎ "path": "news/_posts", + ╎ "name": "News Posts", + ╎ "icon": "newspaper", ╎ "create": { ╎ "path": "[relative_base_path]/{date|year}-{date|month}-{date|day}-{title|slugify}.[ext]" ╎ }, @@ -40,15 +50,14 @@ steps: ╎ }, ╎ { ╎ "name": "Add Draft", - ╎ "collection": "drafts" + ╎ "collection": "news_drafts" ╎ } ╎ ] ╎ }, - ╎ "news_posts": { - ╎ "path": "news/_posts", - ╎ "name": "News Posts", - ╎ "icon": "newspaper", - ╎ "output": true, + ╎ "posts": { + ╎ "path": "_posts", + ╎ "name": "Posts", + ╎ "icon": "event_available", ╎ "create": { ╎ "path": "[relative_base_path]/{date|year}-{date|month}-{date|day}-{title|slugify}.[ext]" ╎ }, @@ -58,35 +67,21 @@ steps: ╎ }, ╎ { ╎ "name": "Add Draft", - ╎ "collection": "news_drafts" + ╎ "collection": "drafts" ╎ } ╎ ] ╎ }, + ╎ "data": { + ╎ "path": "_data", + ╎ "name": "Data", + ╎ "icon": "data_usage", + ╎ "disable_url": true + ╎ }, ╎ "data_animals": { ╎ "path": "_data/animals", ╎ "name": "Data Animals", ╎ "icon": "data_array", - ╎ "output": false - ╎ }, - ╎ "drafts": { - ╎ "path": "_drafts", - ╎ "name": "Drafts", - ╎ "icon": "event", - ╎ "output": false, - ╎ "create": { - ╎ "path": "", - ╎ "publish_to": "posts" - ╎ } - ╎ }, - ╎ "news_drafts": { - ╎ "path": "news/_drafts", - ╎ "name": "News Drafts", - ╎ "icon": "drafts", - ╎ "output": false, - ╎ "create": { - ╎ "path": "", - ╎ "publish_to": "news_posts" - ╎ } + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/jekyll/empty-collection.toolproof.yml b/toolproof_tests/jekyll/empty-collection.toolproof.yml index d434555..597d6a7 100644 --- a/toolproof_tests/jekyll/empty-collection.toolproof.yml +++ b/toolproof_tests/jekyll/empty-collection.toolproof.yml @@ -16,8 +16,7 @@ steps: ╎ "has_no_files": { ╎ "path": "_has_no_files", ╎ "name": "Has No Files", - ╎ "icon": "audio_file", - ╎ "output": true + ╎ "icon": "audio_file" ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/jekyll/page-in-subfolder.toolproof.yml b/toolproof_tests/jekyll/page-in-subfolder.toolproof.yml index 6066503..6659885 100644 --- a/toolproof_tests/jekyll/page-in-subfolder.toolproof.yml +++ b/toolproof_tests/jekyll/page-in-subfolder.toolproof.yml @@ -29,7 +29,7 @@ steps: ╎ "path": "webpages", ╎ "name": "Webpages", ╎ "icon": "pages", - ╎ "output": false + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/jekyll/single-page-in-subfolder.toolproof.yml b/toolproof_tests/jekyll/single-page-in-subfolder.toolproof.yml index c6d94a9..3f7360e 100644 --- a/toolproof_tests/jekyll/single-page-in-subfolder.toolproof.yml +++ b/toolproof_tests/jekyll/single-page-in-subfolder.toolproof.yml @@ -14,8 +14,7 @@ steps: ╎ "pages": { ╎ "path": "pages", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/jekyll/sort.toolproof.yml b/toolproof_tests/jekyll/sort.toolproof.yml index 59395cc..d399727 100644 --- a/toolproof_tests/jekyll/sort.toolproof.yml +++ b/toolproof_tests/jekyll/sort.toolproof.yml @@ -18,7 +18,7 @@ steps: ╎ "path": "_staff", ╎ "name": "Staff", ╎ "icon": "people", - ╎ "output": false, + ╎ "disable_url": true, ╎ "sort": { ╎ "key": "credentials" ╎ } diff --git a/toolproof_tests/justice-eleventy-template.toolproof.yml b/toolproof_tests/justice-eleventy-template.toolproof.yml index 146d3b9..1f3ee48 100644 --- a/toolproof_tests/justice-eleventy-template.toolproof.yml +++ b/toolproof_tests/justice-eleventy-template.toolproof.yml @@ -9,29 +9,26 @@ steps: ╎ "ssg": "eleventy", ╎ "config": { ╎ "collections_config": { - ╎ "data": { - ╎ "path": "_data", - ╎ "name": "Data", - ╎ "icon": "data_usage", - ╎ "output": false - ╎ }, ╎ "pages": { ╎ "path": "pages", ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "icon": "wysiwyg" ╎ }, ╎ "posts": { ╎ "path": "posts", ╎ "name": "Posts", - ╎ "icon": "event_available", - ╎ "output": true + ╎ "icon": "event_available" ╎ }, ╎ "staff_members": { ╎ "path": "staff-members", ╎ "name": "Staff Members", - ╎ "icon": "card_membership", - ╎ "output": true + ╎ "icon": "card_membership" + ╎ }, + ╎ "data": { + ╎ "path": "_data", + ╎ "name": "Data", + ╎ "icon": "data_usage", + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/simple_11ty.toolproof.yml b/toolproof_tests/simple_11ty.toolproof.yml index 09d7c6a..e240051 100644 --- a/toolproof_tests/simple_11ty.toolproof.yml +++ b/toolproof_tests/simple_11ty.toolproof.yml @@ -62,8 +62,7 @@ steps: ╎ "staff_members": { ╎ "path": "staff-members", ╎ "name": "Staff Members", - ╎ "icon": "card_membership", - ╎ "output": true + ╎ "icon": "card_membership" ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland", diff --git a/toolproof_tests/vonge_jekyll.toolproof.yml b/toolproof_tests/vonge_jekyll.toolproof.yml index c3036ba..9e390a4 100644 --- a/toolproof_tests/vonge_jekyll.toolproof.yml +++ b/toolproof_tests/vonge_jekyll.toolproof.yml @@ -10,29 +10,29 @@ steps: ╎ "config": { ╎ "source": "site", ╎ "collections_config": { + ╎ "pages": { + ╎ "path": "", + ╎ "name": "Pages", + ╎ "icon": "wysiwyg" + ╎ }, ╎ "collection_pages": { ╎ "path": "collections/_pages", ╎ "name": "Collection Pages", - ╎ "icon": "collections", - ╎ "output": true - ╎ }, - ╎ "projects": { - ╎ "path": "collections/_projects", - ╎ "name": "Projects", - ╎ "icon": "eject", - ╎ "output": true + ╎ "icon": "collections" ╎ }, - ╎ "testimonials": { - ╎ "path": "collections/_testimonials", - ╎ "name": "Testimonials", - ╎ "icon": "festival", - ╎ "output": false + ╎ "drafts": { + ╎ "path": "collections/_drafts", + ╎ "name": "Drafts", + ╎ "icon": "event", + ╎ "create": { + ╎ "path": "", + ╎ "publish_to": "posts" + ╎ } ╎ }, ╎ "posts": { ╎ "path": "collections/_posts", ╎ "name": "Posts", ╎ "icon": "event_available", - ╎ "output": true, ╎ "create": { ╎ "path": "[relative_base_path]/{date|year}-{date|month}-{date|day}-{title|slugify}.[ext]" ╎ }, @@ -46,27 +46,22 @@ steps: ╎ } ╎ ] ╎ }, - ╎ "pages": { - ╎ "path": "", - ╎ "name": "Pages", - ╎ "icon": "wysiwyg", - ╎ "output": true + ╎ "projects": { + ╎ "path": "collections/_projects", + ╎ "name": "Projects", + ╎ "icon": "eject" ╎ }, ╎ "data": { ╎ "path": "_data", ╎ "name": "Data", ╎ "icon": "data_usage", - ╎ "output": false + ╎ "disable_url": true ╎ }, - ╎ "drafts": { - ╎ "path": "collections/_drafts", - ╎ "name": "Drafts", - ╎ "icon": "event", - ╎ "output": false, - ╎ "create": { - ╎ "path": "", - ╎ "publish_to": "posts" - ╎ } + ╎ "testimonials": { + ╎ "path": "collections/_testimonials", + ╎ "name": "Testimonials", + ╎ "icon": "festival", + ╎ "disable_url": true ╎ } ╎ }, ╎ "timezone": "Pacific/Auckland",