Skip to content

Commit 155ab46

Browse files
committed
fixup!
1 parent 3c9f84b commit 155ab46

File tree

3 files changed

+14
-33
lines changed

3 files changed

+14
-33
lines changed

apps/site/app/[locale]/download/archive/[version]/page.tsx

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2-
// @ts-nocheck
3-
// TODO(@AVIVKELLER): THIS FILE
41
import { defaultLocale } from '@node-core/website-i18n';
52
import { notFound, redirect } from 'next/navigation';
63

74
import provideReleaseData from '#site/next-data/providers/releaseData';
85
import provideReleaseVersions from '#site/next-data/providers/releaseVersions';
96
import { ENABLE_STATIC_EXPORT } from '#site/next.constants.mjs';
7+
import { getMarkdownFile } from '#site/router';
8+
import { renderPage } from '#site/router/render';
109

1110
import type { DynamicParams } from '#site/types';
1211
import type { FC } from 'react';
@@ -37,10 +36,7 @@ export const generateStaticParams = async () => {
3736
// finally it returns (if the locale and route are valid) the React Component with the relevant context
3837
// and attached context providers for rendering the current page
3938
const getPage: FC<PageParams> = async props => {
40-
const { version, locale: routeLocale } = await props.params;
41-
42-
// Gets the current full pathname for a given path
43-
const [locale, pathname] = basePage.getLocaleAndPath(version, routeLocale);
39+
const { version, locale } = await props.params;
4440

4541
if (version === 'current') {
4642
const releaseData = await provideReleaseData();
@@ -53,22 +49,15 @@ const getPage: FC<PageParams> = async props => {
5349
const versions = await provideReleaseVersions();
5450

5551
// Verifies if the current route is a dynamic route
56-
const isDynamicRoute = versions.some(r => r.includes(pathname));
57-
58-
// Gets the Markdown content and context for Download Archive pages
59-
const [content, context] = await basePage.getMarkdownContext({
60-
locale,
61-
pathname: 'download/archive',
62-
});
52+
const isDynamicRoute = versions.some(r => r.includes(version));
6353

6454
// If this isn't a valid dynamic route for archive version or there's no markdown
6555
// file for this, then we fail as not found as there's nothing we can do.
66-
if (isDynamicRoute && context.filename) {
67-
return basePage.renderPage({
68-
content,
69-
layout: context.frontmatter.layout!,
70-
context: { ...context, pathname: `/download/archive/${pathname}` },
71-
});
56+
if (isDynamicRoute) {
57+
const markdown = (await getMarkdownFile(locale, 'download/archive'))!;
58+
markdown.pathname = `/download/archive/${version}`;
59+
60+
return renderPage(markdown);
7261
}
7362

7463
return notFound();

apps/site/next.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const getDeploymentId = async () => {
2323

2424
/** @type {import('next').NextConfig} */
2525
const nextConfig = {
26-
// Configure `pageExtensions` to include markdown and MDX files
27-
pageExtensions: ['md', 'mdx', 'tsx'],
26+
// We need to include _all_ our page extensions here
27+
pageExtensions: ['md', 'mdx', 'ts', 'tsx'],
2828
// Full Support of React 18 SSR and Streaming
2929
reactCompiler: true,
3030
// We don't want to redirect with trailing slashes

packages/content/eslint.config.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,13 @@ import baseConfig from '../../eslint.config.js';
44

55
export default baseConfig.concat([
66
{
7-
ignores: ['content/en/blog/**/*.{md,mdx}/**'],
7+
ignores: ['src/en/blog/**/*.{md,mdx}/**'],
88
},
99

10-
mdx.flatCodeBlocks,
11-
12-
// Type-checking
1310
{
14-
ignores: ['**/*.{md,mdx}', '**/*.{md,mdx}/**'],
15-
languageOptions: {
16-
parserOptions: {
17-
tsconfigRootDir: import.meta.dirname,
18-
},
19-
},
11+
...mdx.flatCodeBlocks,
2012
rules: {
21-
'@typescript-eslint/consistent-type-imports': 'error',
13+
...mdx.flatCodeBlocks.rules,
2214
'@typescript-eslint/no-require-imports': 'off',
2315
},
2416
},

0 commit comments

Comments
 (0)