diff --git a/package-lock.json b/package-lock.json index 0f497db..2f35870 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16273,10 +16273,10 @@ }, "packages/contentful-fakes": { "name": "@jungvonmatt/contentful-fakes", - "version": "1.4.2", + "version": "1.4.9", "license": "MIT", "dependencies": { - "@jungvonmatt/contentful-ssg": "^1.4.0", + "@jungvonmatt/contentful-ssg": "^1.4.9", "casual": "^1.6.2", "chalk": "^5.0.0", "faker": "^5.5.3", @@ -16304,7 +16304,7 @@ }, "packages/contentful-ssg": { "name": "@jungvonmatt/contentful-ssg", - "version": "1.4.0", + "version": "1.4.9", "license": "MIT", "dependencies": { "@contentful/rich-text-html-renderer": "^15.6.2", @@ -16378,7 +16378,7 @@ }, "packages/cssg-plugin-assets": { "name": "@jungvonmatt/cssg-plugin-assets", - "version": "1.4.0", + "version": "1.6.0", "license": "MIT", "dependencies": { "cli-progress": "^3.9.1", @@ -16400,10 +16400,10 @@ }, "packages/cssg-plugin-grow": { "name": "@jungvonmatt/cssg-plugin-grow", - "version": "1.4.0", + "version": "1.4.9", "license": "MIT", "dependencies": { - "@jungvonmatt/contentful-ssg": "^1.4.0" + "@jungvonmatt/contentful-ssg": "^1.4.9" }, "devDependencies": { "jest": "^27.3.0", @@ -16415,10 +16415,10 @@ }, "packages/cssg-plugin-hugo": { "name": "@jungvonmatt/cssg-plugin-hugo", - "version": "1.4.0", + "version": "1.5.2", "license": "MIT", "dependencies": { - "@jungvonmatt/contentful-ssg": "^1.4.0", + "@jungvonmatt/contentful-ssg": "^1.4.9", "fs-extra": "^10.0.0", "micromatch": "^4.0.4" } @@ -17536,7 +17536,7 @@ "@jungvonmatt/contentful-fakes": { "version": "file:packages/contentful-fakes", "requires": { - "@jungvonmatt/contentful-ssg": "^1.4.0", + "@jungvonmatt/contentful-ssg": "^1.4.9", "@types/chance": "^1.1.3", "@types/faker": "^6.6.9", "casual": "^1.6.2", @@ -17630,7 +17630,7 @@ "@jungvonmatt/cssg-plugin-grow": { "version": "file:packages/cssg-plugin-grow", "requires": { - "@jungvonmatt/contentful-ssg": "^1.4.0", + "@jungvonmatt/contentful-ssg": "^1.4.9", "jest": "^27.3.0", "rimraf": "^3.0.2", "ts-jest": "^27.0.7", @@ -17641,7 +17641,7 @@ "@jungvonmatt/cssg-plugin-hugo": { "version": "file:packages/cssg-plugin-hugo", "requires": { - "@jungvonmatt/contentful-ssg": "^1.4.0", + "@jungvonmatt/contentful-ssg": "^1.4.9", "fs-extra": "^10.0.0", "micromatch": "^4.0.4" } diff --git a/packages/cssg-plugin-hugo/index.js b/packages/cssg-plugin-hugo/index.js index 10007cb..0ad85d8 100644 --- a/packages/cssg-plugin-hugo/index.js +++ b/packages/cssg-plugin-hugo/index.js @@ -26,6 +26,7 @@ const defaultOptions = { fieldIdMenuEntries: 'entries', fieldIdMenuHide: 'hide_in_menu', fieldIdMenuPos: 'menu_pos', + fieldIdMenuId: 'name', menuRootTypes: ['page', 'folder', 'x-folder'], typeConfig: { [TYPE_CONTENT]: ['page'], @@ -431,10 +432,10 @@ export default (args) => { // Automatically build hugo menus // See https://gohugo.io/content-management/menus/ if (options.typeIdMenu && contentTypeId === options.typeIdMenu) { - const { name = 'main' } = entry.fields; + const menuId = entry.fields[options.fieldIdMenuId]; const menu = await buildMenu(transformContext, runtimeContext, options.menuDepth); - runtimeContext.menus[hugoLocaleCode(locale)][name] = menu; + runtimeContext.menus[hugoLocaleCode(locale)][menuId] = menu; } if (type === TYPE_CONTENT) {