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
219 changes: 96 additions & 123 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: 'Academy',
href: `${absoluteUrl}/academy`,
activeBasePath: 'academy',
position: 'right',
target: '_self',
rel: 'dofollow',
},
{
label: 'Open source',
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/mcpc',
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,42 +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: 'llms.txt',
href: `${absoluteUrl}/llms.txt`,
target: '_self',
rel: 'dofollow',
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 Expand Up @@ -291,34 +292,6 @@ const themeConfig = {
async: true,
defer: true,
},
announcementBar: process.env.APIFY_DOCS_ABSOLUTE_URL
? (() => {
const parsedUrl = new URL(process.env.APIFY_DOCS_ABSOLUTE_URL);

const { hostname } = parsedUrl;

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 href="${githubUrl}" target="_blank" rel="noopener noreferrer">a preview build for PR ${prNumber}</a> of the Apify Docs.`,
backgroundColor: '#B80F0A',
textColor: '#FFFFFF',
isCloseable: false,
};
})()
: undefined,
};

const plugins = [
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 @@ -42,7 +42,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
Loading
Loading