diff --git a/astro.config.mjs b/astro.config.mjs index 7336b5f..c640f05 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -23,7 +23,6 @@ export default defineConfig({ site: "https://yarkov.tech", integrations: [ solid(), - image(), sitemap({ i18n: { defaultLocale: "ru", @@ -33,6 +32,7 @@ export default defineConfig({ }, }, }), + image(), mdx({ remarkPlugins: [remarkGfm, remarkSmartypants], rehypePlugins: [ diff --git a/public/assets/images/image1.webp b/public/assets/images/image1.webp new file mode 100644 index 0000000..27a1673 Binary files /dev/null and b/public/assets/images/image1.webp differ diff --git a/public/assets/images/image2.webp b/public/assets/images/image2.webp new file mode 100644 index 0000000..62121bd Binary files /dev/null and b/public/assets/images/image2.webp differ diff --git a/public/assets/images/image3.webp b/public/assets/images/image3.webp new file mode 100644 index 0000000..439bd8c Binary files /dev/null and b/public/assets/images/image3.webp differ diff --git a/public/assets/images/image4.webp b/public/assets/images/image4.webp new file mode 100644 index 0000000..5db84c4 Binary files /dev/null and b/public/assets/images/image4.webp differ diff --git a/public/assets/images/image5.webp b/public/assets/images/image5.webp new file mode 100644 index 0000000..97fe49a Binary files /dev/null and b/public/assets/images/image5.webp differ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..723822f --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,6 @@ +# Disallow all at the time of development + +User-agent: * +Disallow: / + +Sitemap: https://yarkov.tech/sitemap-index.xml \ No newline at end of file diff --git a/src/components/ArticleContent/ArticleContent.scss b/src/components/ArticleContent/ArticleContent.scss index 96e8a2c..95626c7 100644 --- a/src/components/ArticleContent/ArticleContent.scss +++ b/src/components/ArticleContent/ArticleContent.scss @@ -193,6 +193,10 @@ } } } + & .languages-available { + margin: 25px 0; + font-size: var(--font-size-lg); + } } @media screen and (max-width: 800px) { diff --git a/src/components/ArticlePost/ArticlePost.astro b/src/components/ArticlePost/ArticlePost.astro index 143db25..d5afdda 100644 --- a/src/components/ArticlePost/ArticlePost.astro +++ b/src/components/ArticlePost/ArticlePost.astro @@ -1,6 +1,7 @@ --- +// import { Image } from "@astrojs/image/components"; +// import * as utils from "@utils/string"; import { createDateFormatter } from "@root/utils"; -import { Image } from "@astrojs/image/components"; import ArticleComments from "@components/ArticleComments"; import "./ArticlePost.scss"; import TranslatedLink from "../TranslatedLink"; @@ -11,7 +12,7 @@ export type Props = { }; const { data, lang } = Astro.props as Props; -const { title, tags, author, published_at } = data; +const { title, coverImage, tags, author, published_at } = data; ---
@@ -35,10 +36,16 @@ const { title, tags, author, published_at } = data; { - data.coverImage && ( + coverImage && (
- {data.title} + {coverImage && {title}} + {/* Render remote or local image */} + {/* utils.isURL(coverImage) ? ( + {data.title} + ) : ( + {data.title} + )*/}
) diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 531d226..f679274 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -11,24 +11,28 @@ const t = useTranslation(Astro); const { title = SITE_METADATA.title, description } = Astro.props as Props; --- - - - + + + + - - -{title} - - - - - - - - - - - - - + + + {title} + + + + + + + + + + + + + + diff --git a/src/components/Counter/Counter.scss b/src/components/Counter/Counter.scss new file mode 100644 index 0000000..f8ea029 --- /dev/null +++ b/src/components/Counter/Counter.scss @@ -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; + } +} diff --git a/src/components/Counter/Counter.tsx b/src/components/Counter/Counter.tsx new file mode 100644 index 0000000..f22d280 --- /dev/null +++ b/src/components/Counter/Counter.tsx @@ -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(false); + const [count, setCount] = createSignal(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 ( +
+ {count()} +
+ + + + +
+
+ ); +}; + +export default Counter; diff --git a/src/components/Counter/index.ts b/src/components/Counter/index.ts new file mode 100644 index 0000000..e09713b --- /dev/null +++ b/src/components/Counter/index.ts @@ -0,0 +1 @@ +export { default } from "./Counter"; diff --git a/src/components/SearchInput/SearchInput.tsx b/src/components/SearchInput/SearchInput.tsx index 5844a7c..00e8f16 100644 --- a/src/components/SearchInput/SearchInput.tsx +++ b/src/components/SearchInput/SearchInput.tsx @@ -61,8 +61,7 @@ const SearchInput: Component = (props) => { - - - - - - + + +
diff --git a/src/layouts/default.astro b/src/layouts/default.astro index 6979913..7bf789e 100644 --- a/src/layouts/default.astro +++ b/src/layouts/default.astro @@ -10,16 +10,16 @@ import "@styles/global.scss"; export interface Props extends BaseHeadProps { lang?: string | 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; --- - - - - + + {noIndex && } +
{showPageHeading && } diff --git a/src/templates/About.astro b/src/templates/About.astro index d80fe8e..e53da94 100644 --- a/src/templates/About.astro +++ b/src/templates/About.astro @@ -14,7 +14,7 @@ const { Content } = await import(`../../content/about/${lang}/index.mdx`); const { skills } = SITE_METADATA; --- - +
diff --git a/src/templates/Contacts.astro b/src/templates/Contacts.astro index a0c52c9..9bf229e 100644 --- a/src/templates/Contacts.astro +++ b/src/templates/Contacts.astro @@ -9,7 +9,7 @@ const t = useTranslation(Astro); const lang = getLanguageFromURL(Astro.url.pathname); --- - +
- + diff --git a/src/templates/Projects.astro b/src/templates/Projects.astro index 0fc20cd..0e418bb 100644 --- a/src/templates/Projects.astro +++ b/src/templates/Projects.astro @@ -11,7 +11,7 @@ const lang = getLanguageFromURL(Astro.url.pathname); const { projects } = SITE_METADATA; --- - +
{projects.map((project) => )} diff --git a/src/utils/string.ts b/src/utils/string.ts index bfe870d..a56609f 100644 --- a/src/utils/string.ts +++ b/src/utils/string.ts @@ -6,6 +6,10 @@ export function isEmail(email: string): boolean { 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) { if (!tag.includes("-")) return tag.toLowerCase(); const [lang, region] = tag.split("-"); diff --git a/tsconfig.json b/tsconfig.json index 843c321..9127811 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,8 @@ "@utils/*": ["./src/utils/*"], "@stores/*": ["./src/stores/*"], "@hooks/*": ["./src/hooks/*"], - "@i18n/*": ["./src/i18n/*"] + "@i18n/*": ["./src/i18n/*"], + "@images/*": ["./src/images/*"] }, "outDir": "./dist", "typeRoots": ["./node_modules/@types", "./src/types"]