@apify/docs-theme 1.0.218 → 1.0.220

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.218",
3
+ "version": "1.0.220",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -0,0 +1,11 @@
1
+ let absoluteUrl = 'https://docs.apify.com';
2
+
3
+ if (process.env.LOCALHOST) {
4
+ absoluteUrl = 'http://localhost:3000';
5
+ } else if (process.env.DEV) {
6
+ absoluteUrl = 'http://docs.apify.loc';
7
+ } else if (process.env.APIFY_DOCS_ABSOLUTE_URL) {
8
+ absoluteUrl = process.env.APIFY_DOCS_ABSOLUTE_URL;
9
+ }
10
+
11
+ exports.absoluteUrl = absoluteUrl;
package/src/config.js CHANGED
@@ -1,14 +1,5 @@
1
1
  /* eslint-disable global-require */
2
-
3
- let absoluteUrl = 'https://docs.apify.com';
4
-
5
- if (process.env.LOCALHOST) {
6
- absoluteUrl = 'http://localhost:3000';
7
- } else if (process.env.DEV) {
8
- absoluteUrl = 'http://docs.apify.loc';
9
- } else if (process.env.APIFY_DOCS_ABSOLUTE_URL) {
10
- absoluteUrl = process.env.APIFY_DOCS_ABSOLUTE_URL;
11
- }
2
+ const { absoluteUrl } = require('./absoluteUrl');
12
3
 
13
4
  const noIndex = ['true', '1'].includes(process.env.NO_INDEX ?? '');
14
5
 
@@ -12,12 +12,14 @@ export default function LayoutWrapper(props) {
12
12
  const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '').trim();
13
13
  const shouldRenderAlternateLink = currentPath && currentPath !== '404';
14
14
 
15
+ const alternateMarkdownLink = useBaseUrl(`/${currentPath}.md`, { absolute: true });
16
+
15
17
  return (
16
18
  <>
17
19
  <Head>
18
20
  {
19
21
  shouldRenderAlternateLink
20
- ? <link rel="alternate" type="text/markdown" href={`${currentPath}.md`}/>
22
+ ? <link rel="alternate" type="text/markdown" href={alternateMarkdownLink}/>
21
23
  : null
22
24
  }
23
25
  </Head>