From 72fc46358b361da0fa5607609c2a4872bb563f72 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 11 May 2026 14:49:11 +0300 Subject: [PATCH 1/3] docs: preview banner --- apify-docs-theme/src/config.js | 38 ++++++++++++++++++++++++--- apify-docs-theme/src/theme/custom.css | 14 ++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/apify-docs-theme/src/config.js b/apify-docs-theme/src/config.js index 073b2e547d..b3fb7373e8 100644 --- a/apify-docs-theme/src/config.js +++ b/apify-docs-theme/src/config.js @@ -285,6 +285,34 @@ const themeConfig = { async: true, defer: true, }, + announcementBar: process.env.APIFY_DOCS_ABSOLUTE_URL + ? (() => { + const absoluteUrl = new URL(process.env.APIFY_DOCS_ABSOLUTE_URL); + + const hostname = absoluteUrl.hostname; + + if (!hostname.includes('pr-') && !hostname.includes('preview')) { + return undefined; + } + + const prNumber = hostname.split('.')[0]?.split('-')[1]; + + if (!prNumber) { + return undefined; + } + + // TODO: once we support multiple preview deployments, we should pass in the repository name as an env variable + const githubUrl = `https://github.com/apify/apify-docs/pull/${prNumber}`; + + return { + id: 'apify-docs-preview-banner', + content: `You are visiting a preview build for PR ${prNumber} of the Apify Docs.`, + backgroundColor: '#B80F0A', + textColor: '#FFFFFF', + isCloseable: false, + }; + })() + : undefined, }; const plugins = [ @@ -302,7 +330,9 @@ const plugins = [ return { resolveLoader: { alias: { - 'roa-loader': require.resolve(`${__dirname}/roa-loader/`), + 'roa-loader': require.resolve( + `${__dirname}/roa-loader/` + ), }, }, }; @@ -319,8 +349,10 @@ const scripts = [ 'data-modal-title': 'Apify AI Assistant', 'data-project-color': '#666666', 'data-button-hide': 'true', - 'data-project-logo': 'https://apify.com/img/apify-logo/logomark-32x32.svg', - 'data-modal-example-questions': 'How to run an Actor?,Create a version of an Actor?', + 'data-project-logo': + 'https://apify.com/img/apify-logo/logomark-32x32.svg', + 'data-modal-example-questions': + 'How to run an Actor?,Create a version of an Actor?', 'data-modal-override-open-id': 'ask-ai-input', 'data-modal-override-open-class': 'search-input', 'data-scale-factor': '1.6', diff --git a/apify-docs-theme/src/theme/custom.css b/apify-docs-theme/src/theme/custom.css index e24afa9ceb..f9db52c4c0 100644 --- a/apify-docs-theme/src/theme/custom.css +++ b/apify-docs-theme/src/theme/custom.css @@ -967,6 +967,20 @@ nav.navbar[class*='navbarHidden'] { transform: translate3d(0, calc(-210%), 0); } +/* Pin the announcement bar to the top of the viewport and push the + navbar down so it sits below the bar instead of sliding under it. + The sibling selector keeps the navbar at top: 0 when there is no + announcement bar (e.g. production builds). */ +div[class*='announcementBar_'] { + position: sticky; + top: 0; + z-index: calc(var(--ifm-z-index-fixed) + 1); +} + +div[class*='announcementBar_'] ~ nav.navbar { + top: var(--docusaurus-announcement-bar-height); +} + .navbar__items--right a.icon, div[class*='colorModeToggle'] { display: initial; From a7e82ad4f06a75f97645cdf817c58f7723c7550a Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 11 May 2026 14:52:47 +0300 Subject: [PATCH 2/3] chore: pnpm format and lint:code:fix --- apify-docs-theme/src/config.js | 12 ++++-------- sources/platform/security.md | 12 ++++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/apify-docs-theme/src/config.js b/apify-docs-theme/src/config.js index b3fb7373e8..57eb408290 100644 --- a/apify-docs-theme/src/config.js +++ b/apify-docs-theme/src/config.js @@ -289,7 +289,7 @@ const themeConfig = { ? (() => { const absoluteUrl = new URL(process.env.APIFY_DOCS_ABSOLUTE_URL); - const hostname = absoluteUrl.hostname; + const { hostname } = absoluteUrl; if (!hostname.includes('pr-') && !hostname.includes('preview')) { return undefined; @@ -330,9 +330,7 @@ const plugins = [ return { resolveLoader: { alias: { - 'roa-loader': require.resolve( - `${__dirname}/roa-loader/` - ), + 'roa-loader': require.resolve(`${__dirname}/roa-loader/`), }, }, }; @@ -349,10 +347,8 @@ const scripts = [ 'data-modal-title': 'Apify AI Assistant', 'data-project-color': '#666666', 'data-button-hide': 'true', - 'data-project-logo': - 'https://apify.com/img/apify-logo/logomark-32x32.svg', - 'data-modal-example-questions': - 'How to run an Actor?,Create a version of an Actor?', + 'data-project-logo': 'https://apify.com/img/apify-logo/logomark-32x32.svg', + 'data-modal-example-questions': 'How to run an Actor?,Create a version of an Actor?', 'data-modal-override-open-id': 'ask-ai-input', 'data-modal-override-open-class': 'search-input', 'data-scale-factor': '1.6', diff --git a/sources/platform/security.md b/sources/platform/security.md index 389b51a2fe..c63939ed59 100644 --- a/sources/platform/security.md +++ b/sources/platform/security.md @@ -54,14 +54,14 @@ The following Apify-owned services and assets are eligible for security research #### Open source projects ([github.com/apify](https://github.com/apify)) - Crawlee: - - [JavaScript](https://github.com/apify/crawlee) - - [Python](https://github.com/apify/crawlee-python) + - [JavaScript](https://github.com/apify/crawlee) + - [Python](https://github.com/apify/crawlee-python) - Apify SDK: - - [JavaScript](https://github.com/apify/apify-sdk-js) - - [Python](https://github.com/apify/apify-sdk-python) + - [JavaScript](https://github.com/apify/apify-sdk-js) + - [Python](https://github.com/apify/apify-sdk-python) - Apify Client: - - [JavaScript](https://github.com/apify/apify-client-js) - - [Python](https://github.com/apify/apify-client-python) + - [JavaScript](https://github.com/apify/apify-client-js) + - [Python](https://github.com/apify/apify-client-python) #### Out-of-scope assets From e45ba20fb992fa2ae6b51995d805f6eb070ff181 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 11 May 2026 14:56:35 +0300 Subject: [PATCH 3/3] chore: revert md format ??? --- sources/platform/security.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/platform/security.md b/sources/platform/security.md index c63939ed59..389b51a2fe 100644 --- a/sources/platform/security.md +++ b/sources/platform/security.md @@ -54,14 +54,14 @@ The following Apify-owned services and assets are eligible for security research #### Open source projects ([github.com/apify](https://github.com/apify)) - Crawlee: - - [JavaScript](https://github.com/apify/crawlee) - - [Python](https://github.com/apify/crawlee-python) + - [JavaScript](https://github.com/apify/crawlee) + - [Python](https://github.com/apify/crawlee-python) - Apify SDK: - - [JavaScript](https://github.com/apify/apify-sdk-js) - - [Python](https://github.com/apify/apify-sdk-python) + - [JavaScript](https://github.com/apify/apify-sdk-js) + - [Python](https://github.com/apify/apify-sdk-python) - Apify Client: - - [JavaScript](https://github.com/apify/apify-client-js) - - [Python](https://github.com/apify/apify-client-python) + - [JavaScript](https://github.com/apify/apify-client-js) + - [Python](https://github.com/apify/apify-client-python) #### Out-of-scope assets