deniz bektaş
This commit is contained in:
54
app/infosec/[slug]/page.tsx
Normal file
54
app/infosec/[slug]/page.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { getPost, getPosts } from "@/lib/posts";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return getPosts("infosec").map((p) => ({ slug: p.slug }));
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const post = await getPost("infosec", slug);
|
||||
if (!post) return {};
|
||||
return { title: post.title, description: post.excerpt };
|
||||
}
|
||||
|
||||
export default async function InfosecPostPage({ params }: { params: Promise<{ slug: string }> }) {
|
||||
const { slug } = await params;
|
||||
const post = await getPost("infosec", slug);
|
||||
if (!post) notFound();
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth: "100%" }}>
|
||||
<Link href="/infosec" style={{ fontSize: "0.78rem", color: "var(--text-muted)", display: "flex", alignItems: "center", gap: "0.3rem", marginBottom: "1.5rem" }}>
|
||||
← Infosec'e Dön
|
||||
</Link>
|
||||
|
||||
<article>
|
||||
<header style={{ marginBottom: "2rem" }}>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "0.5rem" }}>
|
||||
<span style={{ color: "var(--accent)", fontSize: "0.8rem" }}>⚔</span>
|
||||
<span className="tag">infosec</span>
|
||||
</div>
|
||||
<h1 style={{ fontSize: "1.5rem", fontWeight: 800, color: "var(--text)", marginBottom: "0.5rem", lineHeight: 1.3 }}>
|
||||
{post.title}
|
||||
</h1>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: "1rem", flexWrap: "wrap" }}>
|
||||
<span style={{ fontSize: "0.75rem", color: "var(--text-muted)" }}>
|
||||
{new Date(post.date).toLocaleDateString("tr-TR", { year: "numeric", month: "long", day: "numeric" })}
|
||||
</span>
|
||||
<div style={{ display: "flex", gap: "0.3rem", flexWrap: "wrap" }}>
|
||||
{post.tags.map((t) => <span key={t} className="tag">{t}</span>)}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ marginTop: "0.75rem", padding: "0.6rem 0.75rem", background: "var(--bg)", border: "1px solid var(--border)", borderRadius: "4px", fontSize: "0.75rem", color: "var(--text-muted)" }}>
|
||||
⚠ Bu içerik yalnızca eğitim amaçlıdır. Sadece yetkili sistemlerde test yapın.
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="card prose" dangerouslySetInnerHTML={{ __html: post.content || "" }} />
|
||||
</article>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
48
app/infosec/page.tsx
Normal file
48
app/infosec/page.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { getPosts } from "@/lib/posts";
|
||||
|
||||
export const metadata: Metadata = { title: "Infosec Posts" };
|
||||
|
||||
export default function InfosecPage() {
|
||||
const posts = getPosts("infosec");
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth: "100%" }}>
|
||||
<div className="page-title">Infosec Posts</div>
|
||||
<p style={{ fontSize: "0.8rem", color: "var(--text-muted)", marginBottom: "2rem" }}>
|
||||
Teknik güvenlik yazıları, tool analizleri, CTF writeupları
|
||||
</p>
|
||||
|
||||
{posts.length === 0 ? (
|
||||
<div className="card" style={{ color: "var(--text-muted)", fontSize: "0.85rem" }}>Henüz yazı yok.</div>
|
||||
) : (
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: "1rem" }}>
|
||||
{posts.map((post) => (
|
||||
<article key={post.slug} className="card">
|
||||
<div style={{ display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "0.5rem" }}>
|
||||
<span style={{ color: "var(--accent)", fontSize: "0.7rem" }}>⚔</span>
|
||||
<Link href={`/infosec/${post.slug}`}>
|
||||
<h2 style={{ fontSize: "1rem", fontWeight: 700, color: "var(--text)", lineHeight: 1.4 }}>
|
||||
{post.title}
|
||||
</h2>
|
||||
</Link>
|
||||
</div>
|
||||
<p style={{ fontSize: "0.82rem", color: "var(--text-muted)", marginBottom: "0.75rem", lineHeight: 1.6 }}>
|
||||
{post.excerpt}
|
||||
</p>
|
||||
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", flexWrap: "wrap", gap: "0.5rem" }}>
|
||||
<div style={{ display: "flex", gap: "0.3rem", flexWrap: "wrap" }}>
|
||||
{post.tags.map((t) => <span key={t} className="tag">{t}</span>)}
|
||||
</div>
|
||||
<span style={{ fontSize: "0.72rem", color: "var(--text-muted)" }}>
|
||||
{new Date(post.date).toLocaleDateString("tr-TR", { year: "numeric", month: "long", day: "numeric" })}
|
||||
</span>
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user