diff --git a/assets/banners.json b/assets/banners.json new file mode 100644 index 0000000..3dee802 --- /dev/null +++ b/assets/banners.json @@ -0,0 +1,19 @@ +{ + "//": [ + "Banner that shows at the top of the docs pages.", + "Nothing shows right now because there is no 'index' entry.", + "To put a banner up, copy 'example' below into 'index' and edit the text. Remove 'index' again to take it down.", + "text is required. link, type, startDate and endDate are optional.", + "type is one of 'default' (blue), 'warning' (orange), 'error' (red).", + "startDate and endDate are ISO dates that limit when the banner shows." + ], + "websiteBanners": { + "example": { + "text": "webpack 5.x.0 is now available, read the release notes", + "link": "/blog/posts/your-release-post", + "type": "default", + "startDate": "2026-01-01T00:00:00.000Z", + "endDate": "2026-01-08T00:00:00.000Z" + } + } +} diff --git a/scripts/html/doc-kit.config.mjs b/scripts/html/doc-kit.config.mjs index d58f2d2..6e5348b 100644 --- a/scripts/html/doc-kit.config.mjs +++ b/scripts/html/doc-kit.config.mjs @@ -44,7 +44,7 @@ export default { web: { project: 'webpack', useAbsoluteURLs: true, - remoteConfigUrl: null, + remoteConfigUrl: '/assets/banners.json', title: VERSION ? `Webpack ${MAJOR_VERSION} Documentation` : 'Webpack', editURL: 'https://github.com/webpack/webpack-doc-kit/blob/main/pages/{path}.md',