diff --git a/components/LandingPage.tsx b/components/LandingPage.tsx index ce375dd..d93c75a 100644 --- a/components/LandingPage.tsx +++ b/components/LandingPage.tsx @@ -1,7 +1,55 @@ import { ArrowRight, Shield, Globe, Lock, Server, Zap, ChevronRight } from "lucide-react"; import Link from 'next/link'; -export function LandingPage() { +interface LandingPageProps { + locale?: 'en' | 'id'; +} + +const translations = { + en: { + hero: { + badge: "v1.0 is Live", + title: "Secure Your", + highlight: "Private Network", + description: "TrustLab is the definitive Private Certificate Authority (CA) for your internal infrastructure. Issue military-grade SSL/TLS certificates for Intranets, IoT, and Dev environments.", + cta_primary: "Get Started", + cta_secondary: "Generate Certificate", + }, + features: { + root_ca: { title: "Private Root CA", desc: "Your own sovereign Certificate Authority. Trusted by your devices, unreachable by the public internet." }, + internal_domains: { title: "Internal Domains", desc: "Issue certificates for .local, .corp, and private IP addresses (192.168.x.x) that Public CAs reject." }, + smime: { title: "S/MIME Encryption", desc: "Secure internal email communication with employee-to-employee encryption." }, + infrastructure: { title: "Infrastructure", desc: "Seamless integration guides for Nginx, IIS, Apache, and containerized environments." }, + instant: { title: "Instant Issuance", desc: "No validation delays. Certificates are issued instantly via our modern dashboard." }, + start: { title: "Start Now", desc: "Follow the Setup Guide to install the Root CA and go green in minutes." }, + learn_more: "Learn more" + } + }, + id: { + hero: { + badge: "v1.0 Sudah Rilis", + title: "Amankan", + highlight: "Jaringan Pribadi Anda", + description: "TrustLab adalah Otoritas Sertifikat (CA) Pribadi definitif untuk infrastruktur internal Anda. Terbitkan sertifikat SSL/TLS kelas militer untuk Intranet, IoT, dan lingkungan Dev.", + cta_primary: "Mulai Sekarang", + cta_secondary: "Buat Sertifikat", + }, + features: { + root_ca: { title: "Root CA Pribadi", desc: "Otoritas Sertifikat berdaulat Anda sendiri. Dipercaya oleh perangkat Anda, tidak terjangkau oleh internet publik." }, + internal_domains: { title: "Domain Internal", desc: "Terbitkan sertifikat untuk .local, .corp, dan alamat IP pribadi (192.168.x.x) yang ditolak oleh CA Publik." }, + smime: { title: "Enkripsi S/MIME", desc: "Amankan komunikasi email internal dengan enkripsi antar karyawan." }, + infrastructure: { title: "Infrastruktur", desc: "Panduan integrasi mulus untuk Nginx, IIS, Apache, dan lingkungan container." }, + instant: { title: "Penerbitan Instan", desc: "Tanpa penundaan validasi. Sertifikat diterbitkan secara instan melalui dashboard modern kami." }, + start: { title: "Mulai Sekarang", desc: "Ikuti Panduan Pengaturan untuk menginstal Root CA dan aman dalam hitungan menit." }, + learn_more: "Pelajari selengkapnya" + } + } +}; + +export function LandingPage({ locale = 'en' }: LandingPageProps) { + console.log('LandingPage Locale:', locale); + const t = translations[locale] || translations.en; + return (
{/* Hero Section */} @@ -15,23 +63,23 @@ export function LandingPage() { - v1.0 is Live + {t.hero.badge}

- Secure Your Private Network + {t.hero.title} {t.hero.highlight}

- TrustLab is the definitive Private Certificate Authority (CA) for your internal infrastructure. Issue military-grade SSL/TLS certificates for Intranets, IoT, and Dev environments. + {t.hero.description}

- Get Started + {t.hero.cta_primary} - - Generate Certificate + + {t.hero.cta_secondary}
@@ -41,47 +89,53 @@ export function LandingPage() {
} - title="Private Root CA" - description="Your own sovereign Certificate Authority. Trusted by your devices, unreachable by the public internet." - link="/guide/concepts/pki-undamentals" + title={t.features.root_ca.title} + description={t.features.root_ca.desc} + link={locale === 'id' ? "/guide/concepts/pki-fundamentals" : "/guide/concepts/pki-fundamentals"} + learnMoreText={t.features.learn_more} /> } - title="Internal Domains" - description="Issue certificates for .local, .corp, and private IP addresses (192.168.x.x) that Public CAs reject." - link="/guide/certificates/request-new" + title={t.features.internal_domains.title} + description={t.features.internal_domains.desc} + link={locale === 'id' ? "/guide/certificates/request-new" : "/guide/certificates/request-new"} + learnMoreText={t.features.learn_more} /> } - title="S/MIME Encryption" - description="Secure internal email communication with employee-to-employee encryption." - link="/guide/integrations/smime" + title={t.features.smime.title} + description={t.features.smime.desc} + link={locale === 'id' ? "/guide/integrations/smime" : "/guide/integrations/smime"} + learnMoreText={t.features.learn_more} /> } - title="Infrastructure" - description="Seamless integration guides for Nginx, IIS, Apache, and containerized environments." - link="/guide/integrations/web-servers" + title={t.features.infrastructure.title} + description={t.features.infrastructure.desc} + link={locale === 'id' ? "/guide/integrations/web-servers" : "/guide/integrations/web-servers"} + learnMoreText={t.features.learn_more} /> } - title="Instant Issuance" - description="No validation delays. Certificates are issued instantly via our modern dashboard." - link="/guide/getting-started/access-dashboard" + title={t.features.instant.title} + description={t.features.instant.desc} + link={locale === 'id' ? "/guide/getting-started/access-dashboard" : "/guide/getting-started/access-dashboard"} + learnMoreText={t.features.learn_more} /> } - title="Start Now" - description="Follow the Setup Guide to install the Root CA and go green in minutes." - link="/guide/getting-started/install-root-ca" + title={t.features.start.title} + description={t.features.start.desc} + link={locale === 'id' ? "/guide/getting-started/install-root-ca" : "/guide/getting-started/install-root-ca"} isAction + learnMoreText={t.features.learn_more} />
); } -function FeatureCard({ icon, title, description, link, isAction }: any) { +function FeatureCard({ icon, title, description, link, isAction, learnMoreText }: any) { return (
@@ -92,7 +146,7 @@ function FeatureCard({ icon, title, description, link, isAction }: any) { {description}

- Learn more + {learnMoreText}
) diff --git a/middleware.ts b/middleware.ts index 814b934..3bd5f95 100644 --- a/middleware.ts +++ b/middleware.ts @@ -1,5 +1,5 @@ -import { NextResponse } from 'next/server' -import type { NextRequest } from 'next/server' + +import { NextRequest, NextResponse } from 'next/server' const PUBLIC_FILE = /\.(.*)$/ diff --git a/middleware.ts.bak b/middleware.ts.bak new file mode 100644 index 0000000..814b934 --- /dev/null +++ b/middleware.ts.bak @@ -0,0 +1,21 @@ +import { NextResponse } from 'next/server' +import type { NextRequest } from 'next/server' + +const PUBLIC_FILE = /\.(.*)$/ + +export function middleware(req: NextRequest) { + if ( + req.nextUrl.pathname.startsWith('/_next') || + req.nextUrl.pathname.includes('/api/') || + PUBLIC_FILE.test(req.nextUrl.pathname) + ) { + return + } + + if (req.nextUrl.locale === 'default') { + const locale = req.cookies.get('NEXT_LOCALE')?.value || 'en' + return NextResponse.redirect( + new URL(`/${locale}${req.nextUrl.pathname}${req.nextUrl.search}`, req.url) + ) + } +} diff --git a/pages/_meta.json b/pages/_meta.en.json similarity index 100% rename from pages/_meta.json rename to pages/_meta.en.json diff --git a/pages/guide/_meta.json b/pages/guide/_meta.en.json similarity index 100% rename from pages/guide/_meta.json rename to pages/guide/_meta.en.json diff --git a/pages/index.mdx b/pages/index.en.mdx similarity index 100% rename from pages/index.mdx rename to pages/index.en.mdx diff --git a/pages/index.id.mdx b/pages/index.id.mdx index 3e8c28e..d4dfd0f 100644 --- a/pages/index.id.mdx +++ b/pages/index.id.mdx @@ -1,3 +1,5 @@ import { LandingPage } from '../components/LandingPage' + +# DEBUG_ID_FILE_RENDERED diff --git a/theme.config.tsx b/theme.config.tsx index 933068b..506908c 100644 --- a/theme.config.tsx +++ b/theme.config.tsx @@ -46,6 +46,9 @@ const config: DocsThemeConfig = { footer: { text: 'TrustLab Documentation', }, + search: { + placeholder: 'Search documentation...' + } } export default config