feat(snippets): introduce reusable code chunks section, add cms support, and fix navbar turkish characters

This commit is contained in:
Poyraz Avsever
2026-03-30 11:30:14 +03:00
parent d3c13ed25d
commit 31da9f114b
9 changed files with 308 additions and 5 deletions
+36
View File
@@ -0,0 +1,36 @@
---
title: "CSS Reset"
language: "css"
category: "CSS"
description: "Minimal ve modern bir CSS reset şablonu."
---
```css
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4;
}
body {
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
img, picture, video, canvas, svg {
display: block;
max-width: 100%;
}
input, button, textarea, select {
font: inherit;
}
```
+24
View File
@@ -0,0 +1,24 @@
---
title: "useLocalStorage Hook"
language: "typescript"
category: "React Hooks"
description: "localStorage ile senkronize çalışan bir React hook'u."
---
```typescript
import { useState, useEffect } from "react";
export function useLocalStorage<T>(key: string, initialValue: T) {
const [value, setValue] = useState<T>(() => {
if (typeof window === "undefined") return initialValue;
const stored = localStorage.getItem(key);
return stored ? JSON.parse(stored) : initialValue;
});
useEffect(() => {
localStorage.setItem(key, JSON.stringify(value));
}, [key, value]);
return [value, setValue] as const;
}
```