mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 10:29:21 +03:00
Merge branch 'develop' into main
This commit is contained in:
commit
741e372954
@ -5,7 +5,6 @@ import { defineConfig } from "astro/config";
|
||||
*/
|
||||
import sitemap from "@astrojs/sitemap";
|
||||
import solidJs from "@astrojs/solid-js";
|
||||
import image from "@astrojs/image";
|
||||
import netlifyCMS from "astro-netlify-cms";
|
||||
|
||||
/**
|
||||
@ -394,9 +393,6 @@ export default defineConfig({
|
||||
],
|
||||
},
|
||||
}),
|
||||
image({
|
||||
serviceEntryPoint: "@astrojs/image/sharp",
|
||||
}),
|
||||
],
|
||||
markdown: {
|
||||
syntaxHighlight: "prism",
|
||||
@ -442,4 +438,5 @@ export default defineConfig({
|
||||
],
|
||||
},
|
||||
trailingSlash: "ignore",
|
||||
scopedStyleStrategy: "where",
|
||||
});
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Handler } from "@netlify/functions";
|
||||
import type { Handler } from "@netlify/functions";
|
||||
import { redisClient } from "../../redis";
|
||||
|
||||
const getViewsBySlug = async (slug: string): Promise<number> => {
|
||||
|
||||
5835
package-lock.json
generated
5835
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@ -8,7 +8,6 @@
|
||||
"email": "serzh.yarkov@gmail.com",
|
||||
"url": "https://yarkov.tech"
|
||||
},
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
@ -18,28 +17,27 @@
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/image": "^0.16.9",
|
||||
"@astrojs/rss": "^2.4.3",
|
||||
"@astrojs/sitemap": "^1.3.1",
|
||||
"@astrojs/solid-js": "^2.2.0",
|
||||
"@netlify/functions": "^1.6.0",
|
||||
"@sindresorhus/slugify": "^2.2.0",
|
||||
"astro": "^2.5.5",
|
||||
"astro-icon": "^0.8.0",
|
||||
"astro-netlify-cms": "^0.5.3",
|
||||
"hast-util-to-string": "^2.0.0",
|
||||
"hastscript": "^7.2.0",
|
||||
"@astrojs/rss": "^3.0.0",
|
||||
"@astrojs/sitemap": "^3.0.0",
|
||||
"@astrojs/solid-js": "^3.0.1",
|
||||
"@netlify/functions": "^2.1.0",
|
||||
"@sindresorhus/slugify": "^2.2.1",
|
||||
"astro": "^3.2.0",
|
||||
"astro-icon": "^0.8.1",
|
||||
"astro-netlify-cms": "^0.5.4",
|
||||
"hast-util-to-string": "^3.0.0",
|
||||
"hastscript": "^8.0.0",
|
||||
"html-escaper": "^3.0.3",
|
||||
"ioredis": "^5.3.2",
|
||||
"mime-types": "^2.1.35",
|
||||
"quicklink": "^2.3.0",
|
||||
"rehype-autolink-headings": "^6.1.1",
|
||||
"rehype-slug": "^5.1.0",
|
||||
"sharp": "^0.31.0",
|
||||
"solid-js": "^1.7.5"
|
||||
"rehype-autolink-headings": "^7.0.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"sharp": "^0.32.6",
|
||||
"solid-js": "^1.7.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mime-types": "^2.1.1",
|
||||
"sass": "^1.62.1"
|
||||
"@types/mime-types": "^2.1.2",
|
||||
"sass": "^1.68.0"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
import { Picture } from "@astrojs/image/components";
|
||||
import { Image } from "astro:assets";
|
||||
|
||||
export interface Props {
|
||||
src: string;
|
||||
@ -10,18 +10,15 @@ const { src, alt } = Astro.props as Props;
|
||||
---
|
||||
|
||||
<div class="cover">
|
||||
<figure>
|
||||
<Picture
|
||||
<Image
|
||||
itemprop="image"
|
||||
src={src}
|
||||
width={700}
|
||||
height={400}
|
||||
sizes="(max-width: 450px) 450px, 700px"
|
||||
widths={[450, 700]}
|
||||
formats={["webp"]}
|
||||
aspectRatio={"16:9"}
|
||||
format="webp"
|
||||
alt={alt ? alt : ""}
|
||||
background={"chocolate"}
|
||||
/>
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@ -55,7 +55,7 @@ const t = useTranslation(Astro);
|
||||
</div>
|
||||
<div class="published">
|
||||
<time itemprop="datePublished" datetime={pubDate.toString()}>
|
||||
{createDateFormatter(pageLang).format(pubDate)}
|
||||
{createDateFormatter(pageLang).format(pubDate)}
|
||||
</time>
|
||||
<span itemprop="author">{author}</span>
|
||||
</div>
|
||||
@ -72,7 +72,7 @@ const t = useTranslation(Astro);
|
||||
</article>
|
||||
|
||||
<script define:vars={{ slug, IS_DEV: import.meta.env.DEV }}>
|
||||
(async () => {
|
||||
(async () => {
|
||||
if (IS_DEV) return;
|
||||
const response = await fetch(`/api/views?slug=${slug}`, { method: "POST" });
|
||||
if (!response.ok) return;
|
||||
@ -80,7 +80,7 @@ const t = useTranslation(Astro);
|
||||
const $views = document.getElementById("views");
|
||||
if (isNaN(parseInt(views, 10))) return;
|
||||
if ($views) $views.textContent = views;
|
||||
})();
|
||||
})();
|
||||
</script>
|
||||
|
||||
<style lang="scss" is:global>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
export type Props = astroHTML.JSX.ButtonHTMLAttributes;
|
||||
const attrs = Astro.props as Props;
|
||||
const attrs = Astro.props;
|
||||
---
|
||||
|
||||
<button {...attrs}>
|
||||
|
||||
@ -48,7 +48,7 @@ const t = useTranslation(Astro);
|
||||
rows={10}
|
||||
required></textarea>
|
||||
<div class="footer">
|
||||
<Button type="submit">
|
||||
<Button type={"submit"}>
|
||||
<UIString key={"btn.submit"} />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
---
|
||||
import { DEFAULT_LANGUAGE } from "@root/constants";
|
||||
import { getLanguageFromURL } from "@i18n/utils";
|
||||
import { Icon } from "astro-icon";
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
// import UIString from "../UIString";
|
||||
import UIString from "@components/UIString.astro";
|
||||
|
||||
export interface Props {
|
||||
data: CollectionEntry<"projects">["data"];
|
||||
@ -29,14 +27,14 @@ const { icon, title, year, description, articleUrl, sourceUrl, demoUrl } = data;
|
||||
{
|
||||
articleUrl && (
|
||||
<a class="btn-link" href={articleUrl} target="_blank">
|
||||
Статья
|
||||
<UIString key={'btn.article'} />
|
||||
</a>
|
||||
)
|
||||
}
|
||||
{
|
||||
sourceUrl && (
|
||||
<a class="btn-link" href={sourceUrl} target="_blank">
|
||||
Исходник
|
||||
<UIString key={'btn.sourceCode'} />
|
||||
<Icon name="link-out" width="15" height="15" />
|
||||
</a>
|
||||
)
|
||||
@ -44,7 +42,7 @@ const { icon, title, year, description, articleUrl, sourceUrl, demoUrl } = data;
|
||||
{
|
||||
demoUrl && (
|
||||
<a class="btn-link" href={demoUrl} target="_blank">
|
||||
Демо
|
||||
<UIString key={'btn.demo'} />
|
||||
<Icon name="link-out" width="15" height="15" />
|
||||
</a>
|
||||
)
|
||||
|
||||
3
src/env.d.ts
vendored
3
src/env.d.ts
vendored
@ -1,2 +1,3 @@
|
||||
/// <reference path="../.astro/types.d.ts" />
|
||||
/// <reference types="@astrojs/image/client" />
|
||||
/// <reference types="@astrojs/client" />
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
import NotFound from "@templates/NotFound.astro";
|
||||
import NotFoundPage from "@templates/NotFound.astro";
|
||||
---
|
||||
|
||||
<NotFound />
|
||||
<NotFoundPage />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
import { getLanguageKeys } from "@i18n/utils";
|
||||
import { DEFAULT_LANGUAGE } from "@root/constants";
|
||||
import About from "@templates/About.astro";
|
||||
import AboutTemplate from "@templates/About.astro";
|
||||
|
||||
// TODO: do not generate pages without required data
|
||||
export function getStaticPaths() {
|
||||
@ -11,4 +11,4 @@ export function getStaticPaths() {
|
||||
}
|
||||
---
|
||||
|
||||
<About />
|
||||
<AboutTemplate />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
import { getLanguageKeys } from "@i18n/utils";
|
||||
import { DEFAULT_LANGUAGE } from "@root/constants";
|
||||
import Articles from "@templates/Articles.astro";
|
||||
import ArticlesTemplate from "@templates/Articles.astro";
|
||||
|
||||
export function getStaticPaths() {
|
||||
return getLanguageKeys()
|
||||
@ -10,4 +10,4 @@ export function getStaticPaths() {
|
||||
}
|
||||
---
|
||||
|
||||
<Articles />
|
||||
<ArticlesTemplate />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
import { getLanguageKeys } from "@i18n/utils";
|
||||
import { DEFAULT_LANGUAGE } from "@root/constants";
|
||||
import Contacts from "@templates/Contacts.astro";
|
||||
import ContactsTemplate from "@templates/Contacts.astro";
|
||||
|
||||
export function getStaticPaths() {
|
||||
return getLanguageKeys()
|
||||
@ -10,4 +10,4 @@ export function getStaticPaths() {
|
||||
}
|
||||
---
|
||||
|
||||
<Contacts />
|
||||
<ContactsTemplate />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
import { getLanguageKeys } from "@i18n/utils";
|
||||
import { DEFAULT_LANGUAGE } from "@root/constants";
|
||||
import Home from "@templates/Home.astro";
|
||||
import HomeTemplate from "@templates/Home.astro";
|
||||
|
||||
export function getStaticPaths() {
|
||||
return getLanguageKeys()
|
||||
@ -10,4 +10,4 @@ export function getStaticPaths() {
|
||||
}
|
||||
---
|
||||
|
||||
<Home />
|
||||
<HomeTemplate />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
import { getLanguageKeys } from "@i18n/utils";
|
||||
import { DEFAULT_LANGUAGE } from "@root/constants";
|
||||
import Projects from "@templates/Projects.astro";
|
||||
import ProjectsTemplate from "@templates/Projects.astro";
|
||||
|
||||
export function getStaticPaths() {
|
||||
return getLanguageKeys()
|
||||
@ -10,4 +10,4 @@ export function getStaticPaths() {
|
||||
}
|
||||
---
|
||||
|
||||
<Projects />
|
||||
<ProjectsTemplate />
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
import About from "@templates/About.astro";
|
||||
import AboutPage from "@templates/About.astro";
|
||||
---
|
||||
|
||||
<About />
|
||||
<AboutPage />
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
import Articles from "@templates/Articles.astro";
|
||||
import ArticlesPage from "@templates/Articles.astro";
|
||||
---
|
||||
|
||||
<Articles />
|
||||
<ArticlesPage />
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
import Contacts from "@root/templates/Contacts.astro";
|
||||
import ContactsPage from "@root/templates/Contacts.astro";
|
||||
---
|
||||
|
||||
<Contacts />
|
||||
<ContactsPage />
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
import Projects from "@root/templates/Projects.astro";
|
||||
import ProjectsPage from "@root/templates/Projects.astro";
|
||||
---
|
||||
|
||||
<Projects />
|
||||
<ProjectsPage />
|
||||
|
||||
@ -5,7 +5,7 @@ import { createRelativeArticleUrl } from "@root/utils";
|
||||
import * as utils from "@i18n/utils";
|
||||
|
||||
// TODO: generate feed for RU, EN, ... languages
|
||||
export async function get() {
|
||||
export async function GET() {
|
||||
const articles = await getCollection("blog", (e) => !e.data.draft);
|
||||
return rss({
|
||||
title: SITE_METADATA.name,
|
||||
|
||||
@ -17,6 +17,5 @@
|
||||
"typeRoots": ["./node_modules/@types", "./src/types"],
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "solid-js"
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts"]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user