mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 10:29:21 +03:00
allow html in markdown
This commit is contained in:
parent
4d9ec73f40
commit
c371e3dba4
@ -1,60 +0,0 @@
|
||||
import { defineCollection, z } from "astro:content";
|
||||
|
||||
const blog = defineCollection({
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
draft: z.boolean().nullable().optional(),
|
||||
coverImage: z.string().nullable().optional(),
|
||||
author: z.string(),
|
||||
tags: z.string().array(),
|
||||
description: z.string(),
|
||||
pubDate: z
|
||||
.string()
|
||||
.or(z.date())
|
||||
.transform((val) => new Date(val)),
|
||||
updatedDate: z
|
||||
.string()
|
||||
.or(z.date())
|
||||
.optional()
|
||||
.transform((str) => (str ? new Date(str) : undefined)),
|
||||
}),
|
||||
});
|
||||
|
||||
const tags = defineCollection({
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
const authors = defineCollection({
|
||||
schema: z.object({
|
||||
firstName: z.string(),
|
||||
lastName: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
const projects = defineCollection({
|
||||
schema: z.object({
|
||||
icon: z.string(),
|
||||
title: z.string(),
|
||||
year: z.number(),
|
||||
description: z.string(),
|
||||
sourceUrl: z.string(),
|
||||
demoUrl: z.string().nullable().optional(),
|
||||
articleUrl: z.string().nullable().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
const skills = defineCollection({
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
list: z
|
||||
.object({
|
||||
icon: z.string().optional(),
|
||||
title: z.string(),
|
||||
})
|
||||
.array(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { blog, tags, authors, projects, skills };
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
icon: round-shop-two
|
||||
title: digital-store
|
||||
year: 2019
|
||||
description: Customizable online store with control panel for selling digital goods
|
||||
sourceUrl: https://github.com/sergeyyarkov/digital-store/tree/digital-store-docker
|
||||
demoUrl: http://urls.yarkov.tech/digital-store
|
||||
articleUrl: null
|
||||
---
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
icon: round-school
|
||||
title: educt
|
||||
year: 2022
|
||||
description: Learning Management System (LMS) to publish your courses, lectures, lessons
|
||||
sourceUrl: https://github.com/sergeyyarkov/educt
|
||||
demoUrl: http://urls.yarkov.tech/educt
|
||||
articleUrl: null
|
||||
---
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
icon: chip
|
||||
title: memory-led-game
|
||||
year: 2022
|
||||
description: Analogue of the popular game "Simon says" on the AVR microcontroller
|
||||
sourceUrl: https://github.com/sergeyyarkov/attiny24a_memory-led-game
|
||||
demoUrl: null
|
||||
articleUrl: null
|
||||
---
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
icon: nodejs
|
||||
title: node-docker-example
|
||||
year: 2022
|
||||
description: An example of using Docker to deploy a Node.js application
|
||||
sourceUrl: https://github.com/sergeyyarkov/node-docker-example
|
||||
demoUrl: http://urls.yarkov.tech/node-docker-example
|
||||
articleUrl: null
|
||||
---
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
icon: chat
|
||||
title: react-chat-app
|
||||
year: 2021
|
||||
description: Client-server web chat application developed with Node.js and Socket.io
|
||||
sourceUrl: https://github.com/sergeyyarkov/react-chat-app
|
||||
demoUrl: null
|
||||
articleUrl: null
|
||||
---
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
icon: chip
|
||||
title: thermometer
|
||||
year: 2023
|
||||
description: A simple thermometer on an AVR microcontroller with a DS18B20 sensor
|
||||
sourceUrl: https://github.com/sergeyyarkov/attiny45v_thermometer
|
||||
---
|
||||
@ -1,10 +0,0 @@
|
||||
---
|
||||
icon: serial
|
||||
title: web-serial-example
|
||||
year: 2022
|
||||
description: An example of using the Web Serial API to interact with the
|
||||
microcontroller through a browser
|
||||
sourceUrl: https://github.com/sergeyyarkov/avr128da48_web-serial-example
|
||||
demoUrl: https://web-serial-example.netlify.app
|
||||
articleUrl: https://yarkov.tech/en/blog/2022-11-04/using-the-web-serial-api-to-communicate-with-the-microcontroller/
|
||||
---
|
||||
@ -1,10 +0,0 @@
|
||||
---
|
||||
icon: book
|
||||
title: yarkov.tech
|
||||
year: 2023
|
||||
description: My personal website where you can find information about me and a
|
||||
list of various articles and tutorials...
|
||||
sourceUrl: https://github.com/sergeyyarkov/yarkov.tech
|
||||
demoUrl: https://yarkov.tech
|
||||
articleUrl: null
|
||||
---
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
icon: round-shop-two
|
||||
title: digital-store
|
||||
year: 2019
|
||||
description: Настраиваемый интернет-магазин с панелью управления для продажи
|
||||
цифровых товаров
|
||||
sourceUrl: https://github.com/sergeyyarkov/digital-store/tree/digital-store-docker
|
||||
demoUrl: http://urls.yarkov.tech/digital-store
|
||||
---
|
||||
@ -1,8 +0,0 @@
|
||||
---
|
||||
icon: round-school
|
||||
title: educt
|
||||
year: 2022
|
||||
description: Система управления обучением (LMS) для публикации ваших курсов, лекций, уроков
|
||||
sourceUrl: https://github.com/sergeyyarkov/educt
|
||||
demoUrl: http://urls.yarkov.tech/educt
|
||||
---
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
icon: chip
|
||||
title: memory-led-game
|
||||
year: 2022
|
||||
description: Аналог популярной игры "Саймон говорит" на AVR микроконтроллере
|
||||
sourceUrl: https://github.com/sergeyyarkov/attiny24a_memory-led-game
|
||||
---
|
||||
@ -1,8 +0,0 @@
|
||||
---
|
||||
icon: nodejs
|
||||
title: node-docker-example
|
||||
year: 2022
|
||||
description: Пример использования Docker для развертывания Node.js приложения
|
||||
sourceUrl: https://github.com/sergeyyarkov/node-docker-example
|
||||
demoUrl: http://urls.yarkov.tech/node-docker-example
|
||||
---
|
||||
@ -1,8 +0,0 @@
|
||||
---
|
||||
icon: chat
|
||||
title: react-chat-app
|
||||
year: 2021
|
||||
description: Клиент-серверное веб приложение чата разработанное при помощи
|
||||
Node.js и Socket.io
|
||||
sourceUrl: https://github.com/sergeyyarkov/react-chat-app
|
||||
---
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
icon: chip
|
||||
title: thermometer
|
||||
year: 2023
|
||||
description: Простой термометр на AVR микроконтроллере с датчиком DS18B20
|
||||
sourceUrl: https://github.com/sergeyyarkov/attiny45v_thermometer
|
||||
---
|
||||
@ -1,10 +0,0 @@
|
||||
---
|
||||
icon: serial
|
||||
title: web-serial-example
|
||||
year: 2022
|
||||
description: Пример использования Web Serial API для взаимодействия с
|
||||
микроконтроллером через браузер.
|
||||
sourceUrl: https://github.com/sergeyyarkov/avr128da48_web-serial-example
|
||||
demoUrl: https://web-serial-example.netlify.app
|
||||
articleUrl: https://yarkov.tech/blog/2022-11-04/ispolzovanie-web-serial-api-dlya-obscheniya-s-mikrokontrollerom/
|
||||
---
|
||||
@ -1,9 +0,0 @@
|
||||
---
|
||||
icon: book
|
||||
title: yarkov.tech
|
||||
year: 2023
|
||||
description: Мой персональный веб-сайт где находятся информация обо мне и список
|
||||
различных статей и туториалов...
|
||||
sourceUrl: https://github.com/sergeyyarkov/yarkov.tech
|
||||
demoUrl: https://yarkov.tech
|
||||
---
|
||||
@ -22,7 +22,7 @@ export async function markdownToHTML(content: string): Promise<string> {
|
||||
.use(remarkParse)
|
||||
.use(remarkToc, { heading: "(table[ -]of[ -])?contents?|toc|содержание", maxDepth: 2 })
|
||||
.use(remarkPrism as any)
|
||||
.use(remarkRehype)
|
||||
.use(remarkRehype, { allowDangerousHtml: true })
|
||||
.use(rehypeSlug)
|
||||
.use(rehypeAutolinkHeadings, {
|
||||
properties: {
|
||||
@ -58,7 +58,7 @@ export async function markdownToHTML(content: string): Promise<string> {
|
||||
createAnchorLabel(toString(heading)),
|
||||
],
|
||||
})
|
||||
.use(rehypeStringify)
|
||||
.use(rehypeStringify, { allowDangerousHtml: true })
|
||||
.process(content);
|
||||
|
||||
return String(file);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user