chore: reorganize project into monorepo

This commit is contained in:
2026-03-28 10:40:22 +08:00
parent 60367a5f51
commit 1455d93246
201 changed files with 30081 additions and 93 deletions

View File

@@ -0,0 +1,41 @@
---
interface Props {
code: string;
language?: string;
class?: string;
}
const { code, language = 'bash', class: className = '' } = Astro.props;
// Simple syntax highlighting classes
const languageColors: Record<string, string> = {
bash: 'text-[var(--primary)]',
javascript: 'text-[#f7df1e]',
typescript: 'text-[#3178c6]',
python: 'text-[#3776ab]',
rust: 'text-[#dea584]',
go: 'text-[#00add8]',
html: 'text-[#e34c26]',
css: 'text-[#264de4]',
json: 'text-[var(--secondary)]',
};
const langColor = languageColors[language] || 'text-[var(--text)]';
---
<div class={`rounded-lg overflow-hidden bg-[var(--code-bg)] border border-[var(--border-color)] ${className}`}>
<!-- Code header -->
<div class="flex items-center justify-between px-3 py-2 border-b border-[var(--border-color)] bg-[var(--header-bg)]">
<span class="text-xs text-[var(--text-secondary)] font-mono uppercase">{language}</span>
<button
class="text-xs text-[var(--text-tertiary)] hover:text-[var(--primary)] transition-colors"
onclick={`navigator.clipboard.writeText(\`${code.replace(/\\/g, '\\\\').replace(/`/g, '\\`')}\`)`}
>
<i class="fas fa-copy mr-1"></i>
Copy
</button>
</div>
<!-- Code content -->
<pre class="p-3 overflow-x-auto"><code class={`font-mono text-sm ${langColor} whitespace-pre`}>{code}</code></pre>
</div>