feat: add posts + a lot of changes
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -59,7 +59,7 @@ export default async function PostPage({ params }: PostPageProps) {
|
||||
return (
|
||||
<>
|
||||
<main className="flex flex-col gap-[32px] row-start-2 items-center">
|
||||
<section className="space-y-1 text-center max-w-4xl w-full px-4 mt-2">
|
||||
<section className="space-y-1 text-center max-w-4xl w-full px-4 mt-2 pt-[1em]">
|
||||
<dl className="space-y-10">
|
||||
<div>
|
||||
<dt className="sr-only">Опубликовано</dt>
|
||||
|
||||
@@ -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() {
|
||||
<div className="m-4">
|
||||
<h3 className="text-xl mb-3">Socials</h3>
|
||||
<div className="flex items-center gap-4">
|
||||
<Link href="https://mastodon.social/@aderkonstantin"
|
||||
className="text-gray-800 dark:text-gray-200 hover:text-primary-500 dark:hover:text-primary-400 transition-colors">
|
||||
<Link href="https://mastodon.social/@aderkonstantin"
|
||||
className="text-gray-800 dark:text-gray-200 hover:text-primary-500 dark:hover:text-primary-400 transition-colors">
|
||||
<FaMastodon size={32} />
|
||||
</Link>
|
||||
<Link href="https://github.com/AderKonstantin"
|
||||
className="text-gray-800 dark:text-gray-200 hover:text-primary-500 dark:hover:text-primary-400 transition-colors">
|
||||
<FaGithub size={32} />
|
||||
<Link href="https://code.bimka.space/AderKonstantin"
|
||||
className="text-gray-800 dark:text-gray-200 hover:text-primary-500 dark:hover:text-primary-400 transition-colors">
|
||||
<SiGitea size={32} />
|
||||
</Link>
|
||||
<Link href="https://steamcommunity.com/yourprofile"
|
||||
className="text-gray-800 dark:text-gray-200 hover:text-primary-500 dark:hover:text-primary-400 transition-colors">
|
||||
<Link href="https://steamcommunity.com/id/aderkonstantin/"
|
||||
className="text-gray-800 dark:text-gray-200 hover:text-primary-500 dark:hover:text-primary-400 transition-colors">
|
||||
<FaSteam size={32} />
|
||||
</Link>
|
||||
</div>
|
||||
@@ -30,13 +29,10 @@ export default function MainFooter() {
|
||||
<div className="m-4">
|
||||
<div className="flex items-center gap-2 mb-3">
|
||||
<h3 className="text-xl inline">Other Projects</h3>
|
||||
<span className="text-gray-800 dark:text-gray-200">
|
||||
<FaProjectDiagram size={24} />
|
||||
</span>
|
||||
</div>
|
||||
<div className="text-lg">
|
||||
<Link href="sihirtia.ru"
|
||||
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400 transition-colors">
|
||||
<Link href="https://sihirtia.ru/"
|
||||
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400 transition-colors">
|
||||
Sihirtia Softworks
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
<li className="text-6xl flex items-center justify-center filter brightness-0 dark:invert">
|
||||
<Link href="#">
|
||||
<Image src={searchPic} alt="search" width={28} height={28} />
|
||||
<IoSearch size={32} />
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
191
posts/code-syntax.md
Normal file
191
posts/code-syntax.md
Normal file
@@ -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 <iostream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
// Шаблонная функция
|
||||
template<typename T>
|
||||
T find_max(const std::vector<T>& vec) {
|
||||
if (vec.empty()) {
|
||||
throw std::invalid_argument("Vector is empty");
|
||||
}
|
||||
|
||||
return *std::max_element(vec.begin(), vec.end());
|
||||
}
|
||||
|
||||
// Класс для работы с матрицами
|
||||
class Matrix {
|
||||
private:
|
||||
std::vector<std::vector<double>> data;
|
||||
int rows, cols;
|
||||
|
||||
public:
|
||||
Matrix(int r, int c) : rows(r), cols(c) {
|
||||
data.resize(r, std::vector<double>(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;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Тест Markdown разметки"
|
||||
date: "2024-12-22"
|
||||
date: "2026-01-19"
|
||||
tags: ["test", "markdown"]
|
||||
description: "Тестирование поддержки таблиц и списков в Markdown"
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user