Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ jobs:
assert_no_redirect "http://localhost:8080" --request-target '/\evil.com/'
assert_no_redirect "http://localhost:8080" --request-target '///\evil.com/'
# Normal trailing-slash redirect must still work
assert_status "http://localhost:8080/platform/proxy/usage/" "302"
assert_status "http://localhost:8080/actors/proxy/usage/" "302"

echo "🧪 Checking Nginx responses... (apify-docs)"
assert_header "http://localhost:8080/" "Content-Type" "text/html"
assert_header "http://localhost:8080/" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/platform/proxy/usage" "Content-Type" "text/html"
assert_header "http://localhost:8080/platform/proxy/usage.md" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/platform/proxy/usage" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/actors/proxy/usage" "Content-Type" "text/html"
assert_header "http://localhost:8080/actors/proxy/usage.md" "Content-Type" "text/markdown"
assert_header "http://localhost:8080/actors/proxy/usage" "Content-Type" "text/markdown" -H "Accept: text/markdown"
assert_header "http://localhost:8080/img/docs-og.png" "Content-Type" "image/png"
assert_header "http://localhost:8080/img/javascript-40x40.svg" "Content-Type" "image/svg"
assert_header "http://localhost:8080/llms.txt" "Content-Type" "text/markdown"
Expand All @@ -172,7 +172,7 @@ jobs:
assert_html_md_alternate "http://localhost:8080/api/v2/dataset-get" "https://docs.apify.com/api/v2/dataset-get.md"
assert_html_md_alternate "http://localhost:8080/academy/tutorials" "https://docs.apify.com/academy/tutorials.md"
# Sanity check: a regular (non-excluded) page also has the alternate.
assert_html_md_alternate "http://localhost:8080/platform/proxy/usage" "https://docs.apify.com/platform/proxy/usage.md"
assert_html_md_alternate "http://localhost:8080/actors/proxy/usage" "https://docs.apify.com/actors/proxy/usage.md"

echo "🧪 Checking Nginx responses... (apify-sdk-js)"
assert_final_content_type "http://localhost:8080/sdk/js" "text/html"
Expand Down
189 changes: 98 additions & 91 deletions apify-docs-theme/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,123 +19,112 @@ const themeConfig = {
target: '_self',
},
items: [
// PRODUCT (left)
{
label: 'Academy',
href: `${absoluteUrl}/academy`,
activeBasePath: 'academy',
label: 'Get started',
href: `${absoluteUrl}/get-started`,
activeBasePath: 'get-started',
position: 'left',
target: '_self',
rel: 'dofollow',
},
{
label: 'Platform',
href: `${absoluteUrl}/platform`,
className: 'navbar__active',
activeBasePath: 'platform',
label: 'Actors',
href: `${absoluteUrl}/actors`,
activeBasePath: 'actors',
position: 'left',
target: '_self',
rel: 'dofollow',
},
{
label: 'API',
type: 'dropdown',
to: `${absoluteUrl}/api`,
label: 'Integrations',
href: `${absoluteUrl}/integrations`,
activeBasePath: 'integrations',
position: 'left',
target: '_self',
rel: 'dofollow',
activeBasePath: 'api',
},
{
label: 'Account',
href: `${absoluteUrl}/account`,
activeBasePath: 'account',
position: 'left',
items: [
{
label: 'Reference',
href: `${absoluteUrl}/api/v2`,
target: '_self',
rel: 'dofollow',
},
{
label: 'Client for JavaScript',
href: `${absoluteUrl}/api/client/js/docs`,
target: '_self',
rel: 'dofollow',
},
{
label: 'Client for Python',
href: `${absoluteUrl}/api/client/python/docs`,
target: '_self',
rel: 'dofollow',
},
],
target: '_self',
rel: 'dofollow',
},
{
label: 'SDK',
type: 'dropdown',
to: `${absoluteUrl}/sdk`,
activeBasePath: 'sdk',
label: 'Limits',
href: `${absoluteUrl}/limits`,
activeBasePath: 'limits',
position: 'left',
target: '_self',
rel: 'dofollow',
items: [
{
label: 'SDK for JavaScript',
href: `${absoluteUrl}/sdk/js/docs/overview`,
target: '_self',
rel: 'dofollow',
},
{
html: 'SDK for Python',
href: `${absoluteUrl}/sdk/python/docs/overview`,
target: '_self',
rel: 'dofollow',
},
],
},
{
label: 'CLI',
href: `${absoluteUrl}/cli/docs`,
label: 'Security',
href: `${absoluteUrl}/security`,
activeBasePath: 'security',
position: 'left',
activeBasePath: 'cli',
target: '_self',
rel: 'dofollow',
},
// ECOSYSTEM (right)
{
label: 'Open source',
label: 'Academy',
href: `${absoluteUrl}/academy`,
activeBasePath: 'academy',
position: 'right',
target: '_self',
rel: 'dofollow',
},
{
label: 'APIs & SDKs',
type: 'dropdown',
to: `${absoluteUrl}/open-source`,
activeBasePath: 'open-source',
to: `${absoluteUrl}/api/v2`,
activeBasePath: 'api',
position: 'right',
target: '_self',
position: 'left',
className: 'navbar__item',
rel: 'dofollow',
items: [
{
label: 'Crawlee',
href: 'https://crawlee.dev',
label: 'API Reference',
href: `${absoluteUrl}/api/v2`,
target: '_self',
rel: 'dofollow',
},
{
label: 'Fingerprint Suite',
href: 'https://github.com/apify/fingerprint-suite',
},
{
label: 'impit',
href: 'https://github.com/apify/impit',
label: 'SDK for JavaScript',
href: `${absoluteUrl}/sdk/js/docs/overview`,
target: '_self',
rel: 'dofollow',
},
{
label: 'MCP CLI',
href: 'https://github.com/apify/mcp-cli',
label: 'SDK for Python',
href: `${absoluteUrl}/sdk/python/docs/overview`,
target: '_self',
rel: 'dofollow',
},
{
label: 'Actor whitepaper',
href: 'https://whitepaper.actor',
label: 'Client for JavaScript',
href: `${absoluteUrl}/api/client/js/docs`,
target: '_self',
rel: 'dofollow',
},
{
label: 'proxy-chain',
href: 'https://github.com/apify/proxy-chain',
label: 'Client for Python',
href: `${absoluteUrl}/api/client/python/docs`,
target: '_self',
rel: 'dofollow',
},
{
label: 'Apify on GitHub',
href: 'https://github.com/apify',
label: 'CLI',
href: `${absoluteUrl}/cli/docs`,
target: '_self',
rel: 'dofollow',
},
],
},
// UTILITY (row 1 — icon class routes it there in NavbarContent)
{
href: 'https://discord.com/invite/jyEM2PRvMU',
label: 'Discord',
Expand Down Expand Up @@ -170,8 +159,14 @@ const themeConfig = {
rel: 'dofollow',
},
{
label: 'Platform',
href: `${absoluteUrl}/platform`,
label: 'Get started',
href: `${absoluteUrl}/get-started`,
target: '_self',
rel: 'dofollow',
},
{
label: 'Actors',
href: `${absoluteUrl}/actors`,
target: '_self',
rel: 'dofollow',
},
Expand Down Expand Up @@ -218,36 +213,48 @@ const themeConfig = {
],
},
{
title: 'Other',
title: 'Open source',
items: [
{
label: 'CLI',
href: `${absoluteUrl}/cli/docs`,
position: 'left',
target: '_self',
label: 'Crawlee',
href: 'https://crawlee.dev',
rel: 'dofollow',
},
{
label: 'Open source',
href: `${absoluteUrl}/open-source`,
position: 'left',
target: '_self',
rel: 'dofollow',
label: 'Fingerprint Suite',
href: 'https://github.com/apify/fingerprint-suite',
},
{
label: 'impit',
href: 'https://github.com/apify/impit',
},
{
label: 'MCP CLI',
href: 'https://github.com/apify/mcp-cli',
},
{
label: 'proxy-chain',
href: 'https://github.com/apify/proxy-chain',
},
{
label: 'Actor whitepaper',
href: 'https://whitepaper.actor',
},
{
label: 'Apify on GitHub',
href: 'https://github.com/apify',
},
],
},
{
title: 'More',
items: [
{
label: 'Crawlee',
to: 'https://crawlee.dev',
label: 'CLI',
href: `${absoluteUrl}/cli/docs`,
target: '_self',
rel: 'dofollow',
},
{
label: 'GitHub',
href: 'https://github.com/apify',
},
{
href: 'https://discord.com/invite/jyEM2PRvMU',
label: 'Discord',
Expand Down
5 changes: 4 additions & 1 deletion apify-docs-theme/src/theme/DocItemContent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ export default function DocItemContent({ children }) {
'/api/v2/logs',
'/api/v2/users',
'/api/client',
'/platform',
'/sdk',
'/cli',
'/academy',
'/get-started',
'/actors',
'/integrations',
'/account',
];

// Define paths that should not show LLMButtons (e.g., changelog pages)
Expand Down
2 changes: 1 addition & 1 deletion apify-docs-theme/src/theme/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function LayoutWrapper(props) {
</Head>
<div
style={{
'--ifm-navbar-height': subNavbar && !currentPath.startsWith('api/v2') ? '126px' : '68px',
'--ifm-navbar-height': subNavbar && !currentPath.startsWith('api/v2') ? '174px' : '116px',
margin: 0,
padding: 0,
boxSizing: 'border-box',
Expand Down
30 changes: 19 additions & 11 deletions apify-docs-theme/src/theme/Navbar/Content/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import NavbarItem from '@theme/NavbarItem';
import SearchBar from '@theme/SearchBar';
import React from 'react';

// import SearchBar from '../../SearchBar';
import NavbarCTA from '../CTA';

function NavbarItems({ items }) {
Expand All @@ -22,9 +21,9 @@ function NavbarItems({ items }) {
);
}

function NavbarContentLayout({ left, right }) {
function NavbarRow({ modifier, left, right }) {
return (
<div className="navbar__inner">
<div className={`navbar__inner navbar__row navbar__row--${modifier}`}>
<div className="navbar__container">
<div className="navbar__items">{left}</div>
<div className="navbar__items navbar__items--right">{right}</div>
Expand Down Expand Up @@ -67,13 +66,19 @@ function SubNavbar() {
) : null;
}

const isUtilityItem = (item) => typeof item?.className === 'string' && item.className.split(/\s+/).includes('icon');

export default function NavbarContent() {
const {
navbar: { items },
} = useThemeConfig();
const [leftItems, rightItems] = splitNavbarItems(items);
const searchBarItem = items.find((item) => item.type === 'search');

// Pull icon-class items (Discord, GitHub) into the utility row.
const utilityItems = rightItems.filter(isUtilityItem);
const navRightItems = rightItems.filter((item) => !isUtilityItem(item));

return (
<div
style={{
Expand All @@ -84,26 +89,29 @@ export default function NavbarContent() {
flexDirection: 'column',
}}
>
<NavbarContentLayout
left={
<>
<NavbarLogo />
<NavbarItems items={leftItems} />
</>
}
{/* Row 1: utilities (logo + search + AI + utility icons + console CTA) */}
<NavbarRow
modifier="utility"
left={<NavbarLogo />}
right={
<>
<NavbarItems items={rightItems} />
{!searchBarItem && (
<NavbarSearch>
<SearchBar />
</NavbarSearch>
)}
<NavbarItems items={utilityItems} />
<NavbarCTA />
<NavbarMobileSidebarToggle />
</>
}
/>
{/* Row 2: navigation (product zone left, ecosystem/reference right) */}
<NavbarRow
modifier="nav"
left={<NavbarItems items={leftItems} />}
right={<NavbarItems items={navRightItems} />}
/>
<SubNavbar />
</div>
);
Expand Down
Loading