Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"link-fragments": false,
"no-duplicate-heading": {
"siblings_only": true
}
},
"no-bare-urls": false
}
4 changes: 2 additions & 2 deletions apify-docs-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"access": "public"
},
"dependencies": {
"@apify/docs-search-modal": "^1.0.26",
"@docusaurus/theme-common": "^2.4.1",
"@apify/docs-search-modal": "^1.1.0",
"@docusaurus/theme-common": "^3.5.2",
"@stackql/docusaurus-plugin-hubspot": "^1.1.0",
"axios": "^1.7.4",
"babel-loader": "^9.1.3",
Expand Down
6 changes: 3 additions & 3 deletions apify-docs-theme/src/theme/DocBreadcrumbs/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Link from '@docusaurus/Link';
import { ThemeClassNames } from '@docusaurus/theme-common';
import {
useSidebarBreadcrumbs,
useHomePageRoute,
} from '@docusaurus/theme-common/internal';
} from '@docusaurus/plugin-content-docs/client';
import { ThemeClassNames } from '@docusaurus/theme-common';
import { useHomePageRoute } from '@docusaurus/theme-common/internal';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought the /internal imports are no longer allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understood, the Docusaurus team removed some theme-common package dependencies, as they didn't make sense from the "big-picture" POV. The theme-common/internal module was reexporting some of the symbols from those dependencies, which then indeed stopped working.

The useHomePageRoute hook is defined inside of theme-common, though, so it still works. Honestly, I don't really like importing something called internal either, but... as long as it works, I guess I'm fine?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sure, that's why I gave you the checkmark right ahead, build is passing, so it's fine.

import { translate } from '@docusaurus/Translate';
import HomeBreadcrumbItem from '@theme/DocBreadcrumbs/Items/Home';
import clsx from 'clsx';
Expand Down
2 changes: 1 addition & 1 deletion apify-docs-theme/src/theme/DocSidebarItem/Link/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import clsx from 'clsx';
import { ThemeClassNames } from '@docusaurus/theme-common';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import { isActiveSidebarItem } from '@docusaurus/theme-common/internal';
import { isActiveSidebarItem } from '@docusaurus/plugin-content-docs/client';
import Link from '@docusaurus/Link';
import isInternalUrl from '@docusaurus/isInternalUrl';
import IconExternalLink from '@theme/Icon/ExternalLink';
Expand Down
2 changes: 1 addition & 1 deletion apify-docs-theme/src/theme/NavbarItem/ComponentTypes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import HtmlNavbarItem from '@theme/NavbarItem/HtmlNavbarItem';
import DocSidebarNavbarItem from '@theme/NavbarItem/DocSidebarNavbarItem';
import DocsVersionNavbarItem from '@theme/NavbarItem/DocsVersionNavbarItem';
import DocsVersionDropdownNavbarItem from '@theme/NavbarItem/DocsVersionDropdownNavbarItem';
import { useDocsVersion, useLayoutDoc } from '@docusaurus/theme-common/internal';
import { useDocsVersion, useLayoutDoc } from '@docusaurus/plugin-content-docs/client';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import React from 'react';

Expand Down
11 changes: 11 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ module.exports = {
},
],
() => ({
name: 'webpack-loader-fix',
configureWebpack() {
return {
module: {
Expand Down Expand Up @@ -190,6 +191,16 @@ module.exports = {
],
markdown: {
mermaid: true,
parseFrontMatter: async (params) => {
const result = await params.defaultParseFrontMatter(params);

const ogImageURL = new URL('https://apify.com/og-image/docs-article');

ogImageURL.searchParams.set('title', result.frontMatter.title);
result.frontMatter.image ??= ogImageURL.toString();

return result;
},
},
themeConfig: config.themeConfig,
staticDirectories: ['apify-docs-theme/static', 'static'],
Expand Down
Loading