mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 10:29:21 +03:00
fix: disabled astro images
This commit is contained in:
parent
ea7c1a7c10
commit
2be39d0803
@ -23,7 +23,6 @@ export default defineConfig({
|
|||||||
site: "https://yarkov.tech",
|
site: "https://yarkov.tech",
|
||||||
integrations: [
|
integrations: [
|
||||||
solid(),
|
solid(),
|
||||||
image(),
|
|
||||||
sitemap({
|
sitemap({
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: "ru",
|
defaultLocale: "ru",
|
||||||
@ -33,6 +32,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
image(),
|
||||||
mdx({
|
mdx({
|
||||||
remarkPlugins: [remarkGfm, remarkSmartypants],
|
remarkPlugins: [remarkGfm, remarkSmartypants],
|
||||||
rehypePlugins: [
|
rehypePlugins: [
|
||||||
|
|||||||
BIN
public/assets/images/image1.webp
Normal file
BIN
public/assets/images/image1.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
BIN
public/assets/images/image2.webp
Normal file
BIN
public/assets/images/image2.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
public/assets/images/image3.webp
Normal file
BIN
public/assets/images/image3.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
public/assets/images/image4.webp
Normal file
BIN
public/assets/images/image4.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
public/assets/images/image5.webp
Normal file
BIN
public/assets/images/image5.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
6
public/robots.txt
Normal file
6
public/robots.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Disallow all at the time of development
|
||||||
|
|
||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
||||||
|
|
||||||
|
Sitemap: https://yarkov.tech/sitemap-index.xml
|
||||||
@ -193,6 +193,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& .languages-available {
|
||||||
|
margin: 25px 0;
|
||||||
|
font-size: var(--font-size-lg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@media screen and (max-width: 800px) {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
// import { Image } from "@astrojs/image/components";
|
||||||
|
// import * as utils from "@utils/string";
|
||||||
import { createDateFormatter } from "@root/utils";
|
import { createDateFormatter } from "@root/utils";
|
||||||
import { Image } from "@astrojs/image/components";
|
|
||||||
import ArticleComments from "@components/ArticleComments";
|
import ArticleComments from "@components/ArticleComments";
|
||||||
import "./ArticlePost.scss";
|
import "./ArticlePost.scss";
|
||||||
import TranslatedLink from "../TranslatedLink";
|
import TranslatedLink from "../TranslatedLink";
|
||||||
@ -11,7 +12,7 @@ export type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { data, lang } = Astro.props as Props;
|
const { data, lang } = Astro.props as Props;
|
||||||
const { title, tags, author, published_at } = data;
|
const { title, coverImage, tags, author, published_at } = data;
|
||||||
---
|
---
|
||||||
|
|
||||||
<article itemscope itemtype="http://schema.org/BlogPosting" class="article">
|
<article itemscope itemtype="http://schema.org/BlogPosting" class="article">
|
||||||
@ -35,10 +36,16 @@ const { title, tags, author, published_at } = data;
|
|||||||
<span itemprop="author">{author}</span>
|
<span itemprop="author">{author}</span>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
data.coverImage && (
|
coverImage && (
|
||||||
<div>
|
<div>
|
||||||
<figure>
|
<figure>
|
||||||
<Image itemprop="image" src={data.coverImage} width={700} height={400} aspectRatio={"16:9"} format={"webp"} alt={data.title} />
|
{coverImage && <img src={coverImage} width='700' height='400' alt={title} />}
|
||||||
|
{/* Render remote or local image */}
|
||||||
|
{/* utils.isURL(coverImage) ? (
|
||||||
|
<Image itemprop="image" src={coverImage} width={700} height={400} aspectRatio={"16:9"} format={"webp"} alt={data.title} />
|
||||||
|
) : (
|
||||||
|
<Image itemprop="image" src={cover.default.src} width={700} height={400} aspectRatio={"16:9"} format={"webp"} alt={data.title} />
|
||||||
|
)*/}
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -11,9 +11,12 @@ const t = useTranslation(Astro);
|
|||||||
const { title = SITE_METADATA.title, description } = Astro.props as Props;
|
const { title = SITE_METADATA.title, description } = Astro.props as Props;
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<head>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono&display=swap" rel="stylesheet"
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono&display=swap"
|
||||||
|
rel="preload" as="style" onload="this.rel='stylesheet'"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
@ -30,5 +33,6 @@ const { title = SITE_METADATA.title, description } = Astro.props as Props;
|
|||||||
<link rel="manifest" href="/site.webmanifest" />
|
<link rel="manifest" href="/site.webmanifest" />
|
||||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
||||||
<meta name="msapplication-TileColor" content="#da532c" />
|
<meta name="msapplication-TileColor" content="#da532c" />
|
||||||
<script is:inline src="/assets/js/detect-theme.js"></script>
|
|
||||||
<slot />
|
<slot />
|
||||||
|
<script is:inline src="/assets/js/detect-theme.js"></script>
|
||||||
|
</head>
|
||||||
|
|||||||
14
src/components/Counter/Counter.scss
Normal file
14
src/components/Counter/Counter.scss
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.counter {
|
||||||
|
margin: 2rem 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
row-gap: 15px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: var(--border-radius-md);
|
||||||
|
padding: 15px 5px;
|
||||||
|
& div {
|
||||||
|
display: flex;
|
||||||
|
column-gap: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/components/Counter/Counter.tsx
Normal file
45
src/components/Counter/Counter.tsx
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import type { Component } from "solid-js";
|
||||||
|
|
||||||
|
import { createSignal, createEffect } from "solid-js";
|
||||||
|
import Button from "../Button";
|
||||||
|
import "./Counter.scss";
|
||||||
|
|
||||||
|
const Counter: Component<{ tick?: number }> = (props) => {
|
||||||
|
const [isRunned, setIsRunned] = createSignal<boolean>(false);
|
||||||
|
const [count, setCount] = createSignal<number>(0);
|
||||||
|
|
||||||
|
const run = () => setIsRunned(true);
|
||||||
|
const stop = () => setIsRunned(false);
|
||||||
|
const inc = () => setCount(count() + 1);
|
||||||
|
const dec = () => setCount(count() - 1);
|
||||||
|
|
||||||
|
createEffect(() => {
|
||||||
|
setInterval(() => {
|
||||||
|
if (isRunned()) {
|
||||||
|
setCount(count() + 1);
|
||||||
|
}
|
||||||
|
}, props.tick || 200);
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div class="counter">
|
||||||
|
<span>{count()}</span>
|
||||||
|
<div>
|
||||||
|
<Button disabled={isRunned()} onClick={run}>
|
||||||
|
Run
|
||||||
|
</Button>
|
||||||
|
<Button disabled={isRunned()} onClick={inc}>
|
||||||
|
+
|
||||||
|
</Button>
|
||||||
|
<Button disabled={isRunned()} onClick={dec}>
|
||||||
|
-
|
||||||
|
</Button>
|
||||||
|
<Button disabled={!isRunned()} onClick={stop}>
|
||||||
|
Stop
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Counter;
|
||||||
1
src/components/Counter/index.ts
Normal file
1
src/components/Counter/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default } from "./Counter";
|
||||||
@ -61,8 +61,7 @@ const SearchInput: Component<SearchInputProps> = (props) => {
|
|||||||
<input
|
<input
|
||||||
onInput={onSearch}
|
onInput={onSearch}
|
||||||
value={search()}
|
value={search()}
|
||||||
type="text"
|
type="search"
|
||||||
role="search"
|
|
||||||
placeholder={props.placeholder || "Search article by title or description..."}
|
placeholder={props.placeholder || "Search article by title or description..."}
|
||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
|
|||||||
@ -16,12 +16,9 @@ const { lang = "ru", content } = Astro.props as Props;
|
|||||||
---
|
---
|
||||||
|
|
||||||
<html lang={lang}>
|
<html lang={lang}>
|
||||||
<head>
|
|
||||||
<BaseHead title={content.title} description={content.description}>
|
<BaseHead title={content.title} description={content.description}>
|
||||||
<script is:inline defer src="/assets/js/load-code-highlight.js"></script>
|
<script is:inline defer src="/assets/js/load-code-highlight.js"></script>
|
||||||
</BaseHead>
|
</BaseHead>
|
||||||
</head>
|
|
||||||
|
|
||||||
<BaseLayout>
|
<BaseLayout>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<ArticlePost lang={lang} data={content}>
|
<ArticlePost lang={lang} data={content}>
|
||||||
|
|||||||
@ -10,16 +10,16 @@ import "@styles/global.scss";
|
|||||||
export interface Props extends BaseHeadProps {
|
export interface Props extends BaseHeadProps {
|
||||||
lang?: string | undefined;
|
lang?: string | undefined;
|
||||||
showPageHeading?: boolean | undefined;
|
showPageHeading?: boolean | undefined;
|
||||||
|
noIndex?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { title, description, lang = "ru", showPageHeading = true } = Astro.props as Props;
|
const { title, description, lang = "ru", showPageHeading = true, noIndex = false } = Astro.props as Props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<html lang={lang}>
|
<html lang={lang}>
|
||||||
<head>
|
<BaseHead title={title ? `${title} | ${SITE_METADATA.title}` : SITE_METADATA.title} description={description}>
|
||||||
<BaseHead title={title ? `${title} | ${SITE_METADATA.title}` : SITE_METADATA.title} description={description} />
|
{noIndex && <meta name="robots" content="noindex" />}
|
||||||
</head>
|
</BaseHead>
|
||||||
|
|
||||||
<BaseLayout>
|
<BaseLayout>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{showPageHeading && <PageHeading heading={title} description={description} />}
|
{showPageHeading && <PageHeading heading={title} description={description} />}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ const { Content } = await import(`../../content/about/${lang}/index.mdx`);
|
|||||||
const { skills } = SITE_METADATA;
|
const { skills } = SITE_METADATA;
|
||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout lang={lang} title={t("pageTitle.about")}>
|
<PageLayout noIndex lang={lang} title={t("pageTitle.about")}>
|
||||||
<section>
|
<section>
|
||||||
<ArticleContent>
|
<ArticleContent>
|
||||||
<Content />
|
<Content />
|
||||||
|
|||||||
@ -9,7 +9,7 @@ const t = useTranslation(Astro);
|
|||||||
const lang = getLanguageFromURL(Astro.url.pathname);
|
const lang = getLanguageFromURL(Astro.url.pathname);
|
||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout lang={lang} title={t("pageTitle.contacts")} description={t("pageDescription.contacts")}>
|
<PageLayout noIndex lang={lang} title={t("pageTitle.contacts")} description={t("pageDescription.contacts")}>
|
||||||
<section>
|
<section>
|
||||||
<ContactForm
|
<ContactForm
|
||||||
i18n={{
|
i18n={{
|
||||||
|
|||||||
@ -27,5 +27,5 @@ const articles = utils.transformArticles(data);
|
|||||||
<Link icon="email_filled" href="/contacts/"><UIString key={"splash.contact"} /></Link>
|
<Link icon="email_filled" href="/contacts/"><UIString key={"splash.contact"} /></Link>
|
||||||
</SplashLinks>
|
</SplashLinks>
|
||||||
</Splash>
|
</Splash>
|
||||||
<RecentArticles articles={articles} length={10} />
|
<RecentArticles articles={articles} length={5} />
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
|
|||||||
@ -11,7 +11,7 @@ const lang = getLanguageFromURL(Astro.url.pathname);
|
|||||||
const { projects } = SITE_METADATA;
|
const { projects } = SITE_METADATA;
|
||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout lang={lang} title={t("pageTitle.projects")} description={t("pageDescription.projects")}>
|
<PageLayout noIndex lang={lang} title={t("pageTitle.projects")} description={t("pageDescription.projects")}>
|
||||||
<section>
|
<section>
|
||||||
<ProjectsList>
|
<ProjectsList>
|
||||||
{projects.map((project) => <ProjectItem data={project} />)}
|
{projects.map((project) => <ProjectItem data={project} />)}
|
||||||
|
|||||||
@ -6,6 +6,10 @@ export function isEmail(email: string): boolean {
|
|||||||
return new RegExp(/[a-z0-9]+@[a-z]+\.[a-z]{2,3}/).test(email);
|
return new RegExp(/[a-z0-9]+@[a-z]+\.[a-z]{2,3}/).test(email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isURL(url: string): boolean {
|
||||||
|
return new RegExp(/(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\\/~+#-]*[\w@?^=%&\\/~+#-])/).test(url);
|
||||||
|
}
|
||||||
|
|
||||||
export function normalizeLangTag(tag: string) {
|
export function normalizeLangTag(tag: string) {
|
||||||
if (!tag.includes("-")) return tag.toLowerCase();
|
if (!tag.includes("-")) return tag.toLowerCase();
|
||||||
const [lang, region] = tag.split("-");
|
const [lang, region] = tag.split("-");
|
||||||
|
|||||||
@ -18,7 +18,8 @@
|
|||||||
"@utils/*": ["./src/utils/*"],
|
"@utils/*": ["./src/utils/*"],
|
||||||
"@stores/*": ["./src/stores/*"],
|
"@stores/*": ["./src/stores/*"],
|
||||||
"@hooks/*": ["./src/hooks/*"],
|
"@hooks/*": ["./src/hooks/*"],
|
||||||
"@i18n/*": ["./src/i18n/*"]
|
"@i18n/*": ["./src/i18n/*"],
|
||||||
|
"@images/*": ["./src/images/*"]
|
||||||
},
|
},
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"typeRoots": ["./node_modules/@types", "./src/types"]
|
"typeRoots": ["./node_modules/@types", "./src/types"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user