import React from 'react' import { DocsThemeConfig } from 'nextra-theme-docs' import { useConfig } from 'nextra-theme-docs' import { useRouter } from 'next/router' import { Pre } from './components/pre' import CopyPageDropdown from './components/CopyPageDropdown' const config: DocsThemeConfig = { logo: ( <> Prompt Engineering Guide ), i18n: [ { locale: 'en', text: 'English' }, { locale: 'zh', text: '中文' }, { locale: 'jp', text: '日本語'}, { locale: 'pt', text: 'Português' }, { locale: 'it', text: 'Italian' }, { locale: 'tr', text: 'Türkçe' }, { locale: 'es', text: 'Español' }, { locale: 'fr', text: 'Français' }, { locale: 'kr', text: '한국어' }, { locale: `ca`, text: `Català` }, { locale: 'fi', text: 'Finnish' }, { locale: 'ru', text: 'Русский' }, { locale: 'de', text: 'Deutsch' }, { locale: 'ar', text: 'العربية' }, ], head: function UseHead() { const { title } = useConfig() return ( <> {title ? title + ' | Prompt Engineering Guide': 'Prompt Engineering Guide'} )}, project: { link: 'https://github.com/dair-ai/Prompt-Engineering-Guide', }, chat: { link: 'https://discord.gg/YbMT8k6GfX', }, docsRepositoryBase: 'https://github.com/dair-ai/Prompt-Engineering-Guide/tree/main/', footer: { text: (
Copyright © 2026 DAIR.AI
), }, search: { placeholder: 'Search...', }, gitTimestamp: ({ timestamp }) => (
Last updated on {timestamp.toDateString()}
Sponsored by SerpAPI
), components: { pre: Pre, }, main: ({ children }: { children: React.ReactNode }) => { const router = useRouter(); // Only show on English pages (not index page) const isEnglishPage = router.locale === 'en' && router.pathname !== '/'; return ( <> {isEnglishPage && (
)} {children} ) as React.ReactElement; }, navbar: { extraContent: ( { e.currentTarget.style.backgroundColor = '#7c3aed' e.currentTarget.style.transform = 'scale(1.05)' }} onMouseOut={(e) => { e.currentTarget.style.backgroundColor = '#8b5cf6' e.currentTarget.style.transform = 'scale(1)' }} > ✨ Services ) }, } export default config