diff --git a/source.config.ts b/source.config.ts index 657cf9cb3..023b0d89d 100644 --- a/source.config.ts +++ b/source.config.ts @@ -67,9 +67,8 @@ export default defineConfig({ // }, rehypeCodeOptions: { themes: { - // NOTE: one-light and one-dark-pro are alternative options - light: 'github-light-default', - dark: 'dark-plus', + light: 'one-light', + dark: 'dark-plus', // one-dark-pro is an alternative option }, icon: { extend: { @@ -222,6 +221,20 @@ export default defineConfig({ remarkMdxMermaid, remarkMdxFiles, remarkSteps, + function remarkRemoveMdxComments() { + return (tree: any) => { + function process(node: any) { + if (!Array.isArray(node.children)) return; + node.children = node.children.filter((child: any) => { + const isExpression = + child.type === 'mdxFlowExpression' || child.type === 'mdxTextExpression'; + return !(isExpression && /^\s*\/\*[\s\S]*\*\/\s*$/.test(child.value)); + }); + for (const child of node.children) process(child); + } + process(tree); + }; + }, ], rehypePlugins: (v) => [ // NOTE: KaTeX support should be placed before everything else! diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx index 0beebbea0..214b2f155 100644 --- a/src/app/(home)/page.tsx +++ b/src/app/(home)/page.tsx @@ -2,6 +2,7 @@ import type { Metadata } from 'next'; import type { ComponentType } from 'react'; import Link from 'next/link'; import { + ArrowUpRight, ArrowRight, Blocks, Brain, @@ -11,7 +12,6 @@ import { Rocket, Send, Server, - Users, } from 'lucide-react'; export const metadata: Metadata = { @@ -27,7 +27,7 @@ export const metadata: Metadata = { }, }; -type QuickLink = { title: string; href: string }; +type QuickLink = { title: string; href: string; external?: boolean | undefined }; type Path = { title: string; @@ -77,7 +77,7 @@ const paths: Path[] = [ description: 'Build, debug, and deploy smart contracts on TON.', icon: FileCode2, links: [ - { title: 'Acton toolchain', href: '/contract-dev/acton' }, + { title: 'Acton toolchain', href: '/contract-dev/acton', external: true }, { title: 'Tolk language', href: '/tolk/overview' }, { title: 'JetBrains IDE plugin', href: '/contract-dev/ide/jetbrains' }, { title: 'VS Code extension', href: '/contract-dev/ide/vscode' }, @@ -154,11 +154,12 @@ function isExternal(href: string): boolean { return href.startsWith('http'); } -function QuickLinkRow({ title, href }: QuickLink) { +function QuickLinkRow({ title, href, external }: QuickLink) { const className = 'group -mx-3 flex items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground'; + const Component = external ? ArrowUpRight : ArrowRight; const arrow = ( - + ); if (isExternal(href)) { diff --git a/src/lib/shared.ts b/src/lib/shared.ts index 74d52210e..86ae63fd3 100644 --- a/src/lib/shared.ts +++ b/src/lib/shared.ts @@ -37,6 +37,8 @@ export function withBasePath(src: string): string { } export function withBaseUrl(src: string): string { + // NOTE: vercel only, separate production from staging + // if (process.env.NEXT_CONFIG === 'vercel') return 'https://docs.ton.org' + src; // locally or not on GitHub Pages if (!urlPrefix) return src; // external, relative, or data: