From 333eaa2dcabd6295c1c4368406318bfe5ec4174d Mon Sep 17 00:00:00 2001 From: AderKonstantin Date: Thu, 5 Feb 2026 12:39:59 +0300 Subject: [PATCH] feat: add posts + a lot of changes --- app/layout.tsx | 2 +- app/post/[slug]/page.tsx | 2 +- components/footer/main.tsx | 30 +++--- components/header/main.tsx | 5 +- posts/code-syntax.md | 191 +++++++++++++++++++++++++++++++++++++ posts/styles.md | 2 +- 6 files changed, 209 insertions(+), 23 deletions(-) create mode 100644 posts/code-syntax.md diff --git a/app/layout.tsx b/app/layout.tsx index 2806b10..d72f530 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -8,7 +8,7 @@ import MainFooter from "@/components/footer/main"; export const metadata: Metadata = { title: "Ader Konstantin Blog", description: "Welcome to AderKI Blog. There will be posts about digital design and computer architecture", - keywords: ["AderKI", "blog", "computer"], + keywords: ["blog", "risc-v"], authors: [{ name: "Ader Konstantin" }], openGraph: { title: "AderKI Blog", diff --git a/app/post/[slug]/page.tsx b/app/post/[slug]/page.tsx index 13162f4..2846c19 100644 --- a/app/post/[slug]/page.tsx +++ b/app/post/[slug]/page.tsx @@ -59,7 +59,7 @@ export default async function PostPage({ params }: PostPageProps) { return ( <>
-
+
Опубликовано
diff --git a/components/footer/main.tsx b/components/footer/main.tsx index 5f208ee..5ec4172 100644 --- a/components/footer/main.tsx +++ b/components/footer/main.tsx @@ -1,10 +1,9 @@ import Link from "next/link"; -import { - FaMastodon, - FaGithub, - FaSteam, - FaProjectDiagram +import { + FaMastodon, + FaSteam } from "react-icons/fa"; +import { SiGitea } from "react-icons/si"; export default function MainFooter() { return ( @@ -13,16 +12,16 @@ export default function MainFooter() {

Socials

- + - - + + - +
@@ -30,13 +29,10 @@ export default function MainFooter() {

Other Projects

- - -
- + Sihirtia Softworks
diff --git a/components/header/main.tsx b/components/header/main.tsx index 219d55e..3c8ef7a 100644 --- a/components/header/main.tsx +++ b/components/header/main.tsx @@ -1,8 +1,7 @@ -import searchPic from "@/public/search.svg"; - import Image from "next/image"; import Link from "next/link"; import Toolbar from "./toolbar"; +import { IoSearch } from "react-icons/io5"; import AnimatedLink from "../animatedLink"; @@ -19,7 +18,7 @@ export default function MainHeader() {
  • - search +
  • diff --git a/posts/code-syntax.md b/posts/code-syntax.md new file mode 100644 index 0000000..f51cc75 --- /dev/null +++ b/posts/code-syntax.md @@ -0,0 +1,191 @@ +--- +title: "Пример кода с подсветкой" +date: "2026-01-20" +tags: ["code", "syntax", "programming"] +--- + +# Примеры кода с подсветкой синтаксиса + +## JavaScript + +```javascript +// Комментарий +const hello = (name) => { + console.log(`Hello, ${name}!`); + + const numbers = [1, 2, 3, 4, 5]; + const doubled = numbers.map(n => n * 2); + + return doubled; +}; + +class Person { + constructor(name, age) { + this.name = name; + this.age = age; + } + + greet() { + return `Hi, I'm ${this.name}`; + } +} +``` + +## Python + +```python +def fibonacci(n): + """Вычисляет числа Фибоначчи""" + if n <= 1: + return n + else: + return fibonacci(n-1) + fibonacci(n-2) + +# Генератор списка +squares = [x**2 for x in range(10)] + +# Декоратор +def timer(func): + import time + def wrapper(*args, **kwargs): + start = time.time() + result = func(*args, **kwargs) + end = time.time() + print(f"Время выполнения: {end - start} секунд") + return result + return wrapper +``` + +## RISC-V Ассемблер + +```asm +# Простой цикл на RISC-V +loop: + addi t0, t0, 1 # t0 = t0 + 1 + addi t1, t1, -1 # t1 = t1 - 1 + bnez t1, loop # if t1 != 0, goto loop + +# Функция сложения +add_numbers: + add a0, a0, a1 # a0 = a0 + a1 + ret # return +``` + +## CSS + +```css +/* Кастомные свойства */ +:root { + --primary-color: #3b82f6; + --secondary-color: #10b981; + --text-color: #374151; +} + +.container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 1rem; + padding: 2rem; +} + +.button { + background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); + color: white; + padding: 0.75rem 1.5rem; + border-radius: 0.5rem; + transition: transform 0.2s; +} + +.button:hover { + transform: translateY(-2px); +} +``` + +## Bash/Shell + +```bash +#!/bin/bash + +# Скрипт для сборки проекта +echo "Начало сборки..." + +# Проверка зависимостей +if ! command -v npm &> /dev/null; then + echo "Ошибка: npm не установлен" + exit 1 +fi + +# Установка зависимостей +npm install + +# Сборка проекта +npm run build + +echo "Сборка завершена успешно!" +``` + +## SQL + +```sql +-- Создание таблицы пользователей +CREATE TABLE users ( + id INT PRIMARY KEY AUTO_INCREMENT, + username VARCHAR(50) NOT NULL UNIQUE, + email VARCHAR(100) NOT NULL UNIQUE, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + is_active BOOLEAN DEFAULT TRUE +); + +-- Запрос с JOIN +SELECT + u.username, + o.order_id, + o.total_amount, + o.order_date +FROM users u +JOIN orders o ON u.id = o.user_id +WHERE u.is_active = TRUE +ORDER BY o.order_date DESC; +``` + +## C++ + +```cpp +#include +#include +#include + +// Шаблонная функция +template +T find_max(const std::vector& vec) { + if (vec.empty()) { + throw std::invalid_argument("Vector is empty"); + } + + return *std::max_element(vec.begin(), vec.end()); +} + +// Класс для работы с матрицами +class Matrix { +private: + std::vector> data; + int rows, cols; + +public: + Matrix(int r, int c) : rows(r), cols(c) { + data.resize(r, std::vector(c, 0.0)); + } + + // Перегрузка оператора + Matrix operator+(const Matrix& other) const { + Matrix result(rows, cols); + for (int i = 0; i < rows; i++) { + for (int j = 0; j < cols; j++) { + result.data[i][j] = data[i][j] + other.data[i][j]; + } + } + return result; + } +}; +``` + diff --git a/posts/styles.md b/posts/styles.md index c3f94c4..ce1871a 100644 --- a/posts/styles.md +++ b/posts/styles.md @@ -1,6 +1,6 @@ --- title: "Тест Markdown разметки" -date: "2024-12-22" +date: "2026-01-19" tags: ["test", "markdown"] description: "Тестирование поддержки таблиц и списков в Markdown" ---