diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1256b8c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,42 @@ +# Git +.git +.github +.gitignore + +# Dependencies +node_modules + +# Next.js +.next +out + +# Environment +.env* +!.env.example + +# Logs +*.log +npm-debug.log* +logs/ + +# Documentation +*.md +!README.md +specs/ + +# IDE +.vscode +.idea + +# OS +.DS_Store +Thumbs.db + +# Testing +.coverage +.nyc_output + +# Misc +*.swp +*.swo +*~ diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3bbe861 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# Production site URL (REQUIRED for SEO) +NEXT_PUBLIC_SITE_URL=https://yourdomain.com + +# Environment +NODE_ENV=production +PORT=3030 diff --git a/app/blog/[...slug]/page.tsx b/app/blog/[...slug]/page.tsx index c97fac1..89ad1be 100644 --- a/app/blog/[...slug]/page.tsx +++ b/app/blog/[...slug]/page.tsx @@ -76,7 +76,7 @@ export default async function BlogPostPage({ params }: { params: Promise<{ slug: const relatedPosts = await getRelatedPosts(slugPath) const headings = extractHeadings(post.content) - const fullUrl = `https://yourdomain.com/blog/${slugPath}` + const fullUrl = `${process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'}/blog/${slugPath}` return ( <> diff --git a/app/layout.tsx b/app/layout.tsx index fdef6eb..8875eb8 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -11,7 +11,7 @@ export const metadata: Metadata = { default: 'Terminal Blog - Build. Write. Share.', }, description: 'Explorează idei despre dezvoltare, design și tehnologie', - metadataBase: new URL('http://localhost:3000'), + metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3030'), authors: [{ name: 'Terminal User' }], keywords: ['blog', 'dezvoltare web', 'nextjs', 'react', 'typescript', 'terminal'], openGraph: { diff --git a/components/blog/markdown-renderer.tsx b/components/blog/markdown-renderer.tsx index 78b3d66..07be1ac 100644 --- a/components/blog/markdown-renderer.tsx +++ b/components/blog/markdown-renderer.tsx @@ -2,6 +2,7 @@ import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' +import rehypeSanitize from 'rehype-sanitize' import rehypeRaw from 'rehype-raw' import { OptimizedImage } from './OptimizedImage' import { CodeBlock } from './code-block' @@ -17,7 +18,17 @@ export default function MarkdownRenderer({ content, className = '' }: MarkdownRe