diff --git a/.frontmatter/config.cjs b/.frontmatter/config.cjs index 7c455fc7..e3cedabf 100644 --- a/.frontmatter/config.cjs +++ b/.frontmatter/config.cjs @@ -1,8 +1,26 @@ -const dnbConfig = require('@davidsneighbour/frontmatter-config'); +const dnbConfig = require("@davidsneighbour/frontmatter-config"); module.exports = async function (config) { + let resolvedDnbConfig; + + try { + resolvedDnbConfig = await (typeof dnbConfig === "function" + ? dnbConfig() + : dnbConfig); + } catch (error) { + throw new Error(`Failed to load dnbConfig: ${error.message}`); + } + + if (typeof resolvedDnbConfig !== "object") { + throw new Error("dnbConfig must resolve to an object."); + } + + if (typeof config !== "object") { + throw new Error("The provided config must be an object."); + } + return { - ...dnbConfig, + ...resolvedDnbConfig, ...config, }; }; diff --git a/.github/vale/config/vocabularies/dnb/accept.txt b/.github/vale/config/vocabularies/dnb/accept.txt index 2fa0e6da..9796c491 100644 --- a/.github/vale/config/vocabularies/dnb/accept.txt +++ b/.github/vale/config/vocabularies/dnb/accept.txt @@ -23,3 +23,5 @@ Boxicons Iconoir MIT License Lineicons +SASS +YouTube diff --git a/.vscode/settings.json b/.vscode/settings.json index 0e5bb603..37a18042 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,9 +14,6 @@ "markdown.extension.tableFormatter.normalizeIndentation": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - }, "[dotenv]": { "editor.defaultFormatter": "foxundermoon.shell-format" }, @@ -38,13 +35,13 @@ "stylelint.snippet": ["css", "less", "postcss", "scss", "sass"], "stylelint.validate": ["css", "less", "postcss", "sass", "scss"], "[jsonc]": { - "editor.defaultFormatter": "biomejs.biome" + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" }, "[shellscript]": { "editor.defaultFormatter": "foxundermoon.shell-format" }, "[markdown]": { - "editor.defaultFormatter": "yzhang.markdown-all-in-one" + "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" }, "[javascript]": { "editor.defaultFormatter": "vscode.typescript-language-features" diff --git a/frontmatter.json b/frontmatter.json index 569633ea..648d96d4 100644 --- a/frontmatter.json +++ b/frontmatter.json @@ -1,363 +1,374 @@ { - "$schema": "https://frontmatter.codes/frontmatter.schema.json", - "frontMatter.logging": "verbose", - "frontMatter.config.dynamicFilePath": "[[workspace]]/.frontmatter/config.cjs", - "frontMatter.content.pageFolders": [ - { - "contentTypes": ["blog", "music2program2", "notes-from-the-laboratory"], - "path": "[[workspace]]/content/blog", - "title": "Blog" - }, - { - "contentTypes": ["component"], - "path": "[[workspace]]/content/gohugo", - "title": "Modules" - }, - { - "contentTypes": ["tag"], - "path": "[[workspace]]/content/tags", - "title": "Tags" - } - ], - "frontmatter.content.placeholders.permalink": "/blog/{{year}}/{{slug}}/index.md", - "frontMatter.content.snippets": { - "Caption": { - "description": "caption", - "body": "{{< caption >}}", - "fields": [] - } - }, - "frontMatter.custom.scripts": [ - { - "command": "~/.nvm/versions/node/v20.18.0/bin/node", - "script": "./bin/frontmatter/screenshot-header-image.cjs", - "title": "Retrieve Screenshot" - }, - { - "command": "~/.nvm/versions/node/v20.18.0/bin/node", - "script": "./bin/frontmatter/retrieve-unsplash-header-image-info.cjs", - "title": "Retrieve Unsplash image" - }, - { - "command": "~/.nvm/versions/node/v20.18.0/bin/node", - "script": "./bin/frontmatter/create-youtube-header-image.js", - "title": "Generate social image for Youtube" - } - ], - "frontMatter.data.files": [ - { - "file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json", - "fileType": "json", - "id": "kurzschnitte", - "labelField": "title", - "schema": { - "properties": { - "description": { - "multiline": true, - "title": "Description", - "type": "string" - }, - "labels": { - "items": { - "type": "string" - }, - "type": "array" - }, - "link": { - "title": "Link", - "type": "string" - }, - "slug": { - "title": "Kurzschnitt-Post", - "type": "string" - }, - "title": { - "title": "Title", - "type": "string" - } - }, - "required": ["title", "link", "slug"], - "title": "Kurzschnitte", - "type": "object" - }, - "singleEntry": false, - "title": "Kurzschnitte" - }, - { - "file": "[[workspace]]/data/dnb/kollitsch/music.json", - "fileType": "json", - "id": "music2program2", - "labelField": "name", - "schema": { - "properties": { - "description": { - "multiline": true, - "title": "Description", - "type": "string" - }, - "genre": { - "items": { - "type": "string" - }, - "type": "array" - }, - "link": { - "title": "Link", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "slug": { - "title": "Slug", - "type": "string" - } - }, - "required": ["name", "link", "slug"], - "type": "object" - }, - "title": "Music to program to" - }, - { - "file": "[[workspace]]/data/dnb/kollitsch/blogroll.json", - "fileType": "json", - "id": "blogroll", - "labelField": "name", - "title": "Blogroll", - "schema": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "multiline": true, - "title": "Description", - "type": "string" - }, - "link": { - "title": "Link", - "type": "string" - }, - "feed": { - "title": "Feed", - "type": "string" - }, - "type": { - "title": "Type", - "type": "string", - "enum": ["blog", "podcast", "youtube"] - } - }, - "required": ["name", "link"], - "type": "object" - } - } - ], - "frontMatter.taxonomy.contentTypes": [ - { - "fields": [ - { - "name": "title", - "title": "Title", - "type": "string" - }, - { - "name": "description", - "title": "Description", - "type": "string" - }, - { - "default": "{{now}}", - "isPublishDate": true, - "name": "date", - "title": "Publishing date", - "type": "datetime" - }, - { - "name": "preview", - "title": "Content preview", - "type": "image" - }, - { - "name": "draft", - "title": "Is in draft", - "type": "draft" - }, - { - "name": "tags", - "title": "Tags", - "type": "tags" - }, - { - "name": "categories", - "title": "Categories", - "type": "categories" - } - ], - "name": "default", - "pageBundle": false, - "previewPath": null - }, - { - "fieldGroup": ["resources"], - "fields": [ - { - "name": "title", - "single": true, - "title": "Title", - "type": "string" - }, - { - "name": "description", - "title": "Description", - "type": "string" - }, - { - "default": "{{now}}", - "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", - "isPublishDate": true, - "name": "date", - "title": "Publishing date", - "type": "datetime" - }, - { - "default": "{{now}}", - "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", - "isModifiedDate": true, - "name": "lastmod", - "title": "Last modified date", - "type": "datetime" - }, - { - "name": "draft", - "title": "Draft", - "type": "draft" - }, - { - "name": "tags", - "title": "Tags", - "type": "tags" - }, - { - "name": "categories", - "title": "Categories", - "type": "categories" - }, - { - "fieldGroup": ["resources"], - "multiple": true, - "name": "resources", - "title": "Resources", - "type": "block" - } - ], - "filetype": "md", - "name": "blog", - "pageBundle": true, - "previewPath": "yyyy/{{permalink}}" - }, - { - "fields": [ - { - "name": "title", - "single": true, - "title": "Title", - "type": "string" - }, - { - "name": "description", - "single": true, - "title": "Description", - "type": "string" - }, - { - "default": "{{now}}", - "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", - "isPublishDate": true, - "name": "date", - "title": "Publishing date", - "type": "datetime" - }, - { - "default": "{{now}}", - "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", - "isModifiedDate": true, - "name": "lastmod", - "title": "Last modified date", - "type": "datetime" - }, - { - "name": "draft", - "title": "Draft", - "type": "draft" - }, - { - "name": "tags", - "title": "Tags", - "type": "tags" - }, - { - "name": "categories", - "title": "Categories", - "type": "categories" - }, - { - "fieldGroup": ["resources"], - "name": "resources", - "title": "Resources", - "type": "block" - } - ], - "name": "default", - "pageBundle": true, - "previewPath": "{{permalink}}" - } - ], - "frontMatter.taxonomy.fieldGroups": [ - { - "fields": [ - { - "isPreviewImage": true, - "name": "src", - "required": true, - "title": "Path/Filename", - "type": "image" - }, - { - "name": "title", - "single": true, - "title": "Title", - "type": "string" - }, - { - "name": "name", - "single": true, - "title": "Identifier", - "type": "string" - } - ], - "id": "resources", - "labelField": "src" - }, - { - "fields": [ - { - "name": "name", - "single": true, - "title": "Author Name", - "type": "string" - }, - { - "name": "social", - "single": true, - "title": "Social link", - "type": "string" - } - ], - "id": "author", - "labelField": "name" - } - ] + "$schema": "https://frontmatter.codes/frontmatter.schema.json", + "frontMatter.logging": "verbose", + "frontMatter.extends": [ + "https://dnbhub.xyz/frontmatter/settings.global.json" + ], + "frontMatter.framework.id": "hugo", + "frontMatter.content.publicFolder": "static", + "frontmatter.content.autoUpdateDate": true, + "frontMatter.dashboard.content.card.fields.date": true, + "frontMatter.taxonomy.noPropertyValueQuotes": ["date"], + "frontMatter.taxonomy.dateField": "publishDate", + "frontMatter.taxonomy.modifiedField": "lastmod", + "frontMatter.content.autoUpdateDate": true, + "frontMatter.taxonomy.dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", + "frontMatter.content.pageFolders": [ + { + "contentTypes": ["blog", "music2program2", "notes-from-the-laboratory"], + "path": "[[workspace]]/content/blog", + "title": "Blog" + }, + { + "contentTypes": ["component"], + "path": "[[workspace]]/content/gohugo", + "title": "Modules" + }, + { + "contentTypes": ["tag"], + "path": "[[workspace]]/content/tags", + "title": "Tags" + } + ], + "frontmatter.content.placeholders.permalink": "/blog/{{year}}/{{slug}}/index.md", + "frontMatter.content.snippets": { + "Caption": { + "description": "caption", + "body": "{{< caption >}}", + "fields": [] + } + }, + "frontMatter.custom.scripts": [ + { + "command": "~/.nvm/versions/node/v20.18.0/bin/node", + "script": "./bin/frontmatter/screenshot-header-image.cjs", + "title": "Retrieve Screenshot" + }, + { + "command": "~/.nvm/versions/node/v20.18.0/bin/node", + "script": "./bin/frontmatter/retrieve-unsplash-header-image-info.cjs", + "title": "Retrieve Unsplash image" + }, + { + "command": "~/.nvm/versions/node/v20.18.0/bin/node", + "script": "./bin/frontmatter/create-youtube-header-image.js", + "title": "Generate social image for Youtube" + } + ], + "frontMatter.data.files": [ + { + "file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json", + "fileType": "json", + "id": "kurzschnitte", + "labelField": "title", + "schema": { + "properties": { + "description": { + "multiline": true, + "title": "Description", + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "link": { + "title": "Link", + "type": "string" + }, + "slug": { + "title": "Kurzschnitt-Post", + "type": "string" + }, + "title": { + "title": "Title", + "type": "string" + } + }, + "required": ["title", "link", "slug"], + "title": "Kurzschnitte", + "type": "object" + }, + "singleEntry": false, + "title": "Kurzschnitte" + }, + { + "file": "[[workspace]]/data/dnb/kollitsch/music.json", + "fileType": "json", + "id": "music2program2", + "labelField": "name", + "schema": { + "properties": { + "description": { + "multiline": true, + "title": "Description", + "type": "string" + }, + "genre": { + "items": { + "type": "string" + }, + "type": "array" + }, + "link": { + "title": "Link", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "slug": { + "title": "Slug", + "type": "string" + } + }, + "required": ["name", "link", "slug"], + "type": "object" + }, + "title": "Music to program to" + }, + { + "file": "[[workspace]]/data/dnb/kollitsch/blogroll.json", + "fileType": "json", + "id": "blogroll", + "labelField": "name", + "title": "Blogroll", + "schema": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "multiline": true, + "title": "Description", + "type": "string" + }, + "link": { + "title": "Link", + "type": "string" + }, + "feed": { + "title": "Feed", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string", + "enum": ["blog", "podcast", "youtube"] + } + }, + "required": ["name", "link"], + "type": "object" + } + } + ], + "frontMatter.taxonomy.contentTypes": [ + { + "fields": [ + { + "name": "title", + "title": "Title", + "type": "string" + }, + { + "name": "description", + "title": "Description", + "type": "string" + }, + { + "default": "{{now}}", + "isPublishDate": true, + "name": "date", + "title": "Publishing date", + "type": "datetime" + }, + { + "name": "preview", + "title": "Content preview", + "type": "image" + }, + { + "name": "draft", + "title": "Is in draft", + "type": "draft" + }, + { + "name": "tags", + "title": "Tags", + "type": "tags" + }, + { + "name": "categories", + "title": "Categories", + "type": "categories" + } + ], + "name": "default", + "pageBundle": false, + "previewPath": null + }, + { + "fieldGroup": ["resources"], + "fields": [ + { + "name": "title", + "single": true, + "title": "Title", + "type": "string" + }, + { + "name": "description", + "title": "Description", + "type": "string" + }, + { + "default": "{{now}}", + "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", + "isPublishDate": true, + "name": "date", + "title": "Publishing date", + "type": "datetime" + }, + { + "default": "{{now}}", + "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", + "isModifiedDate": true, + "name": "lastmod", + "title": "Last modified date", + "type": "datetime" + }, + { + "name": "draft", + "title": "Draft", + "type": "draft" + }, + { + "name": "tags", + "title": "Tags", + "type": "tags" + }, + { + "name": "categories", + "title": "Categories", + "type": "categories" + }, + { + "fieldGroup": ["resources"], + "multiple": true, + "name": "resources", + "title": "Resources", + "type": "block" + } + ], + "filetype": "md", + "name": "blog", + "pageBundle": true, + "previewPath": "yyyy/{{permalink}}" + }, + { + "fields": [ + { + "name": "title", + "single": true, + "title": "Title", + "type": "string" + }, + { + "name": "description", + "single": true, + "title": "Description", + "type": "string" + }, + { + "default": "{{now}}", + "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", + "isPublishDate": true, + "name": "date", + "title": "Publishing date", + "type": "datetime" + }, + { + "default": "{{now}}", + "dateFormat": "yyyy-MM-dd'T'HH:mm:ssxxx", + "isModifiedDate": true, + "name": "lastmod", + "title": "Last modified date", + "type": "datetime" + }, + { + "name": "draft", + "title": "Draft", + "type": "draft" + }, + { + "name": "tags", + "title": "Tags", + "type": "tags" + }, + { + "name": "categories", + "title": "Categories", + "type": "categories" + }, + { + "fieldGroup": ["resources"], + "name": "resources", + "title": "Resources", + "type": "block" + } + ], + "name": "default", + "pageBundle": true, + "previewPath": "{{permalink}}" + } + ], + "frontMatter.taxonomy.fieldGroups": [ + { + "fields": [ + { + "isPreviewImage": true, + "name": "src", + "required": true, + "title": "Path/Filename", + "type": "image" + }, + { + "name": "title", + "single": true, + "title": "Title", + "type": "string" + }, + { + "name": "name", + "single": true, + "title": "Identifier", + "type": "string" + } + ], + "id": "resources", + "labelField": "src" + }, + { + "fields": [ + { + "name": "name", + "single": true, + "title": "Author Name", + "type": "string" + }, + { + "name": "social", + "single": true, + "title": "Social link", + "type": "string" + } + ], + "id": "author", + "labelField": "name" + } + ] } diff --git a/kollitsch.dev.code-workspace b/kollitsch.dev.code-workspace index 4eabf505..ebcf49da 100644 --- a/kollitsch.dev.code-workspace +++ b/kollitsch.dev.code-workspace @@ -24,33 +24,16 @@ "path": "." }, { - "name": "Theme", "path": "../hugo-darkskies" }, { - "name": "Modules", - "path": "../hugo-modules" - }, - { - "name": "Namespace", - "path": "../namespace" - }, - { - "name": "Configurations", - "path": "../configurations" - }, - { - "name": "Asylum", - "path": "../hugo-asylum" - }, - { - "path": "../hugov" + "path": "../hugo-darkskies-template" }, { - "path": "../hugor" + "path": "../hugo-modules" }, { - "path": "../hugo-darkskies-template" + "path": "../binaries" } ], "settings": {