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
19 changes: 16 additions & 3 deletions source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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!
Expand Down
11 changes: 6 additions & 5 deletions src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Metadata } from 'next';
import type { ComponentType } from 'react';
import Link from 'next/link';
import {
ArrowUpRight,
ArrowRight,
Blocks,
Brain,
Expand All @@ -11,7 +12,6 @@ import {
Rocket,
Send,
Server,
Users,
} from 'lucide-react';

export const metadata: Metadata = {
Expand All @@ -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;
Expand Down Expand Up @@ -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' },
Expand Down Expand Up @@ -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 = (
<ArrowRight className="size-4 shrink-0 text-fd-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-fd-primary" />
<Component className="size-4 shrink-0 text-fd-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-fd-primary" />
);

if (isExternal(href)) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down