From fcc69a1eab8d111e73a1403b2f568085bb4b0dc2 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Thu, 18 Aug 2022 23:17:05 +0300 Subject: [PATCH 01/40] fix: fixed active link in header --- src/components/Header/Header.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index 96fc1f8..b855872 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -24,7 +24,7 @@ const { pathname } = Astro.url; { nav.map((link) => (
  • - +
  • From c518a698db683f5bce4d8c8002101c140528ea27 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Thu, 18 Aug 2022 23:20:27 +0300 Subject: [PATCH 02/40] upd --- src/components/Header/Header.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index b855872..ac908b8 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -24,7 +24,7 @@ const { pathname } = Astro.url; { nav.map((link) => (
  • - +
  • From eaac35a0c31969fdd5bbab59d1e78afc3caaad9d Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Thu, 18 Aug 2022 23:42:35 +0300 Subject: [PATCH 03/40] fix: fixed active links in header --- src/components/Header/Header.astro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index ac908b8..5c9cf8f 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -1,6 +1,7 @@ --- import { Icon } from "astro-icon"; import { IS_SITE_UNDER_CONSTRUCTION, SITE_METADATA } from "@root/config"; +import { removeSlashes } from "@utils/string"; import ThemeSwitcher from "@components/ThemeSwticher"; import UIString from "@components/UIString"; import TranslatedLink from "@components/TranslatedLink"; @@ -24,7 +25,7 @@ const { pathname } = Astro.url; { nav.map((link) => (
  • - +
  • From dafd68fcd289be62c8db6ac7df8e55b9771f92f7 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Fri, 19 Aug 2022 15:52:57 +0300 Subject: [PATCH 04/40] feat: added canonical urls --- package.json | 2 +- src/components/ArticlePost/ArticlePost.astro | 2 +- src/components/BaseHead.astro | 9 +++-- .../ContactsList/ContactsList.astro | 20 +++++----- src/components/Footer/Footer.astro | 40 +++++++++---------- src/components/Header/Header.astro | 2 +- .../ProjectsList/ProjectsList.astro | 6 +-- src/components/SkillsList/SkillsList.astro | 4 +- src/layouts/article.astro | 5 ++- src/layouts/default.astro | 7 ++-- src/pages/blog/[...slug].astro | 3 +- src/templates/Articles.astro | 3 +- src/templates/Home.astro | 3 +- 13 files changed, 57 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index e30221c..7ff3e80 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "start": "astro dev", "build": "astro build", "preview": "astro preview --host", - "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json}\"", + "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,astro}\"", "lint": "eslint '**/*.{js,mjs,ts,tsx}'" }, "devDependencies": { diff --git a/src/components/ArticlePost/ArticlePost.astro b/src/components/ArticlePost/ArticlePost.astro index d5afdda..c942b5d 100644 --- a/src/components/ArticlePost/ArticlePost.astro +++ b/src/components/ArticlePost/ArticlePost.astro @@ -39,7 +39,7 @@ const { title, coverImage, tags, author, published_at } = data; coverImage && (
    - {coverImage && {title}} + {coverImage && {title}} {/* Render remote or local image */} {/* utils.isURL(coverImage) ? ( {data.title} diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index f679274..ce811b1 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -5,10 +5,11 @@ import { useTranslation } from "@i18n/utils"; export interface Props { title?: string | undefined; description?: string | undefined; + canonicalUrl?: string | undefined; } const t = useTranslation(Astro); -const { title = SITE_METADATA.title, description } = Astro.props as Props; +const { title = SITE_METADATA.title, description, canonicalUrl } = Astro.props as Props; --- @@ -16,9 +17,11 @@ const { title = SITE_METADATA.title, description } = Astro.props as Props; - + {canonicalUrl && } {title} diff --git a/src/components/ContactsList/ContactsList.astro b/src/components/ContactsList/ContactsList.astro index 3ab3f95..b3a3691 100644 --- a/src/components/ContactsList/ContactsList.astro +++ b/src/components/ContactsList/ContactsList.astro @@ -1,24 +1,24 @@ --- -import { SITE_METADATA } from '@root/config'; -import { Icon } from 'astro-icon'; -import './ContactsList.scss'; +import { SITE_METADATA } from "@root/config"; +import { Icon } from "astro-icon"; +import "./ContactsList.scss"; const { contacts: { email, githubUrl, telegramUrl }, } = SITE_METADATA; --- - diff --git a/src/components/Footer/Footer.astro b/src/components/Footer/Footer.astro index cfc3451..e1298aa 100644 --- a/src/components/Footer/Footer.astro +++ b/src/components/Footer/Footer.astro @@ -1,24 +1,24 @@ --- -import './Footer.scss'; -import { Icon } from 'astro-icon' +import "./Footer.scss"; +import { Icon } from "astro-icon"; --- - - -
    From 576c30e5150a05b1f662bd4e1f5b99a6edb7e56d Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Tue, 23 Aug 2022 16:14:01 +0300 Subject: [PATCH 18/40] fix css icons --- src/styles/theme.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/theme.scss b/src/styles/theme.scss index d6aa2fa..c7afb6d 100644 --- a/src/styles/theme.scss +++ b/src/styles/theme.scss @@ -138,8 +138,8 @@ --icon-secondary: var(--color-gray-100); --icon-filter: invert(100%); - & .header svg, - & .site-content svg:not([data-filter="none"]) { + & body > header svg, + & body > main svg:not([data-filter="none"]) { filter: var(--icon-filter); } } From 78e69028e760f0d9a31f76e7a875d29199638bda Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Tue, 23 Aug 2022 17:38:01 +0300 Subject: [PATCH 19/40] remove unused css --- .../Counter/{Counter.scss => Counter.css} | 9 ++++---- src/components/Counter/Counter.tsx | 4 ++-- src/components/PageHeading/PageHeading.astro | 21 ++++++++++++++++--- src/components/PageHeading/PageHeading.scss | 14 ------------- src/layouts/default.astro | 5 +---- src/templates/About.astro | 2 ++ src/templates/Articles.astro | 2 ++ src/templates/Contacts.astro | 2 ++ src/templates/Home.astro | 2 +- src/templates/NotFound.astro | 2 +- src/templates/Projects.astro | 2 ++ src/utils/history.ts | 7 ------- 12 files changed, 36 insertions(+), 36 deletions(-) rename src/components/Counter/{Counter.scss => Counter.css} (80%) delete mode 100644 src/components/PageHeading/PageHeading.scss diff --git a/src/components/Counter/Counter.scss b/src/components/Counter/Counter.css similarity index 80% rename from src/components/Counter/Counter.scss rename to src/components/Counter/Counter.css index f8ea029..6af8d30 100644 --- a/src/components/Counter/Counter.scss +++ b/src/components/Counter/Counter.css @@ -7,8 +7,9 @@ border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 15px 5px; - & div { - display: flex; - column-gap: 3px; - } +} + +.counter div { + display: flex; + column-gap: 3px; } diff --git a/src/components/Counter/Counter.tsx b/src/components/Counter/Counter.tsx index f22d280..782380e 100644 --- a/src/components/Counter/Counter.tsx +++ b/src/components/Counter/Counter.tsx @@ -1,8 +1,8 @@ import type { Component } from "solid-js"; import { createSignal, createEffect } from "solid-js"; -import Button from "../Button"; -import "./Counter.scss"; +import Button from "@components/Button"; +import "./Counter.css"; const Counter: Component<{ tick?: number }> = (props) => { const [isRunned, setIsRunned] = createSignal(false); diff --git a/src/components/PageHeading/PageHeading.astro b/src/components/PageHeading/PageHeading.astro index fde49c7..74201ab 100644 --- a/src/components/PageHeading/PageHeading.astro +++ b/src/components/PageHeading/PageHeading.astro @@ -1,6 +1,4 @@ --- -import "./PageHeading.scss"; - export interface Props { heading: string; description?: string | undefined; @@ -10,8 +8,25 @@ const { heading, description } = Astro.props as Props; ---
    -

    +

    {heading}

    {description &&

    {description}

    }
    + + diff --git a/src/components/PageHeading/PageHeading.scss b/src/components/PageHeading/PageHeading.scss deleted file mode 100644 index 87defba..0000000 --- a/src/components/PageHeading/PageHeading.scss +++ /dev/null @@ -1,14 +0,0 @@ -.page-heading { - & h1 { - font-size: var(--font-size-4xl); - text-align: center; - margin-bottom: 15px; - } - & p { - font-size: var(--font-size-lg); - text-align: center; - max-width: 650px; - margin: 0 auto; - margin-bottom: 2.5rem; - } -} diff --git a/src/layouts/default.astro b/src/layouts/default.astro index 7d42720..93f0ce9 100644 --- a/src/layouts/default.astro +++ b/src/layouts/default.astro @@ -4,17 +4,15 @@ import type { Props as BaseHeadProps } from "@components/BaseHead.astro"; import { SITE_METADATA } from "@root/config"; import BaseHead from "@components/BaseHead.astro"; import BaseLayout from "@components/BaseLayout"; -import PageHeading from "@components/PageHeading"; import "@styles/global.scss"; export interface Props extends BaseHeadProps { lang?: string | undefined; - showPageHeading?: boolean | undefined; noIndex?: boolean | undefined; canonicalUrl?: string | undefined; } -const { title, description, lang = "ru", showPageHeading = true, noIndex = false, canonicalUrl } = Astro.props as Props; +const { title, description, lang = "ru", noIndex = false, canonicalUrl } = Astro.props as Props; --- @@ -23,7 +21,6 @@ const { title, description, lang = "ru", showPageHeading = true, noIndex = false
    - {showPageHeading && }
    diff --git a/src/templates/About.astro b/src/templates/About.astro index e53da94..1a26cb3 100644 --- a/src/templates/About.astro +++ b/src/templates/About.astro @@ -1,6 +1,7 @@ --- import { SITE_METADATA } from "@root/config"; import PageLayout from "@layouts/default.astro"; +import PageHeading from "@components/PageHeading"; import SkillsList from "@components/SkillsList"; import SkillsBlock from "@components/SkillsBlock"; @@ -15,6 +16,7 @@ const { skills } = SITE_METADATA; --- +
    diff --git a/src/templates/Articles.astro b/src/templates/Articles.astro index d0f19b1..56ac1c6 100644 --- a/src/templates/Articles.astro +++ b/src/templates/Articles.astro @@ -1,5 +1,6 @@ --- import PageLayout from "@layouts/default.astro"; +import PageHeading from "@components/PageHeading"; import ArticlesList from "@components/ArticlesList"; import { transformArticles, formatToArticleBlocks } from "@utils/articles"; import { getLanguageFromURL } from "@root/utils"; @@ -14,6 +15,7 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site); --- +
    +
    +
    diff --git a/src/templates/NotFound.astro b/src/templates/NotFound.astro index 25bac24..e2e5080 100644 --- a/src/templates/NotFound.astro +++ b/src/templates/NotFound.astro @@ -7,7 +7,7 @@ const lang = getLanguageFromURL(Astro.url.pathname); const t = useTranslation(Astro); --- - +

    404

    {t("404.description")}

    diff --git a/src/templates/Projects.astro b/src/templates/Projects.astro index 0e418bb..cb07e96 100644 --- a/src/templates/Projects.astro +++ b/src/templates/Projects.astro @@ -3,6 +3,7 @@ import { SITE_METADATA } from "@root/config"; import PageLayout from "@layouts/default.astro"; import ProjectsList from "@components/ProjectsList"; import ProjectItem from "@components/ProjectItem"; +import PageHeading from "@components/PageHeading"; import { getLanguageFromURL } from "@root/utils"; import { useTranslation } from "@i18n/utils"; @@ -12,6 +13,7 @@ const { projects } = SITE_METADATA; --- +
    {projects.map((project) => )} diff --git a/src/utils/history.ts b/src/utils/history.ts index 7087c57..07b8142 100644 --- a/src/utils/history.ts +++ b/src/utils/history.ts @@ -1,10 +1,3 @@ -export const extendHistoryState = (state: object, url?: URL | string | undefined): void => { - const { history } = window; - const updated = Object.assign({}, history.state, state); - - history.replaceState(updated, "", url); -}; - export const deleteParamFromUrl = (param: string): string => { const params = new URLSearchParams(window.location.search); params.delete(param); From e1d6e60e039b377a7aaac15da5c7c032d6738525 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Tue, 23 Aug 2022 22:33:56 +0300 Subject: [PATCH 20/40] upd deps --- package-lock.json | 42 +++++++++++++++--------------- package.json | 6 ++--- src/components/Footer/Footer.astro | 6 ++--- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index a40058a..3ab8571 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,14 +10,14 @@ "license": "MIT", "devDependencies": { "@astrojs/image": "^0.3.6", - "@astrojs/mdx": "^0.10.0", + "@astrojs/mdx": "^0.10.1", "@astrojs/rss": "^1.0.0", "@astrojs/sitemap": "^1.0.0", "@astrojs/solid-js": "^1.0.0", "@types/mdx": "^2.0.2", "@typescript-eslint/eslint-plugin": "^5.34.0", "@typescript-eslint/parser": "^5.34.0", - "astro": "^1.0.7", + "astro": "^1.0.8", "astro-compress": "^1.0.4", "astro-icon": "^0.7.3", "eslint": "^8.22.0", @@ -28,7 +28,7 @@ "mime-types": "^2.1.35", "netlify-plugin-minify-html": "^0.3.1", "prettier": "^2.7.1", - "prettier-plugin-astro": "^0.5.1", + "prettier-plugin-astro": "^0.5.2", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.0.1", "remark-gfm": "^3.0.1", @@ -134,9 +134,9 @@ } }, "node_modules/@astrojs/mdx": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.10.0.tgz", - "integrity": "sha512-nQcYzjPB8p0KWyP8g/8V6Rnxd7+5/VzNP4JLvQWUFs6mo7Akq98y4i+QjOl9/k5erzikl96Uul70MS/rjBheNQ==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.10.1.tgz", + "integrity": "sha512-SuSGxIiEfv1A4Ts6bDrBTdjNs5Xclr7DUczhgyFbYIIueCgRoh7teCsE2lZu9m4zvq4UTO7jWCb6W6QpCrykBw==", "dev": true, "dependencies": { "@astrojs/prism": "^1.0.1", @@ -1571,9 +1571,9 @@ } }, "node_modules/astro": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.7.tgz", - "integrity": "sha512-QKG+/RbqZ3NNlLO3JuqJjYtdYUDM05H5UljURl1a9gM6WyuGobMkubW5Bhu1l6HmySZ6x7AZSnqsfcmHxdCxCQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.8.tgz", + "integrity": "sha512-cWey5M/EjdgeZCRlOAB6YP05ui3U9ZfHPdb4r5HmumOE/1w8auDqRiHPpb2RCGYD7RpxOXcJu5XfJL4V2F1UpQ==", "dev": true, "dependencies": { "@astrojs/compiler": "^0.23.3", @@ -7308,9 +7308,9 @@ } }, "node_modules/prettier-plugin-astro": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.5.1.tgz", - "integrity": "sha512-u6Ueb5dJFLzSkWwBFdx1rf/bSsdWt9arLWgvcxbDO9hS6kZs9QZHvYdZyJmywaYlH606eHA4578ncjY0bdDSQw==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.5.2.tgz", + "integrity": "sha512-P6i5ARkfK0B0/uPWruH81lBPL1QcrJLVREKAuqih24Y7x4ySxdBMdaulEWpzhPuiXoRLQ9v0I1VTS4wb6KKDqg==", "dev": true, "dependencies": { "@astrojs/compiler": "^0.19.0", @@ -9616,9 +9616,9 @@ } }, "@astrojs/mdx": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.10.0.tgz", - "integrity": "sha512-nQcYzjPB8p0KWyP8g/8V6Rnxd7+5/VzNP4JLvQWUFs6mo7Akq98y4i+QjOl9/k5erzikl96Uul70MS/rjBheNQ==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-0.10.1.tgz", + "integrity": "sha512-SuSGxIiEfv1A4Ts6bDrBTdjNs5Xclr7DUczhgyFbYIIueCgRoh7teCsE2lZu9m4zvq4UTO7jWCb6W6QpCrykBw==", "dev": true, "requires": { "@astrojs/prism": "^1.0.1", @@ -10716,9 +10716,9 @@ "dev": true }, "astro": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.7.tgz", - "integrity": "sha512-QKG+/RbqZ3NNlLO3JuqJjYtdYUDM05H5UljURl1a9gM6WyuGobMkubW5Bhu1l6HmySZ6x7AZSnqsfcmHxdCxCQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/astro/-/astro-1.0.8.tgz", + "integrity": "sha512-cWey5M/EjdgeZCRlOAB6YP05ui3U9ZfHPdb4r5HmumOE/1w8auDqRiHPpb2RCGYD7RpxOXcJu5XfJL4V2F1UpQ==", "dev": true, "requires": { "@astrojs/compiler": "^0.23.3", @@ -14739,9 +14739,9 @@ "dev": true }, "prettier-plugin-astro": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.5.1.tgz", - "integrity": "sha512-u6Ueb5dJFLzSkWwBFdx1rf/bSsdWt9arLWgvcxbDO9hS6kZs9QZHvYdZyJmywaYlH606eHA4578ncjY0bdDSQw==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.5.2.tgz", + "integrity": "sha512-P6i5ARkfK0B0/uPWruH81lBPL1QcrJLVREKAuqih24Y7x4ySxdBMdaulEWpzhPuiXoRLQ9v0I1VTS4wb6KKDqg==", "dev": true, "requires": { "@astrojs/compiler": "^0.19.0", diff --git a/package.json b/package.json index 110ead7..a8205b4 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,14 @@ }, "devDependencies": { "@astrojs/image": "^0.3.6", - "@astrojs/mdx": "^0.10.0", + "@astrojs/mdx": "^0.10.1", "@astrojs/rss": "^1.0.0", "@astrojs/sitemap": "^1.0.0", "@astrojs/solid-js": "^1.0.0", "@types/mdx": "^2.0.2", "@typescript-eslint/eslint-plugin": "^5.34.0", "@typescript-eslint/parser": "^5.34.0", - "astro": "^1.0.7", + "astro": "^1.0.8", "astro-compress": "^1.0.4", "astro-icon": "^0.7.3", "eslint": "^8.22.0", @@ -38,7 +38,7 @@ "mime-types": "^2.1.35", "netlify-plugin-minify-html": "^0.3.1", "prettier": "^2.7.1", - "prettier-plugin-astro": "^0.5.1", + "prettier-plugin-astro": "^0.5.2", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.0.1", "remark-gfm": "^3.0.1", diff --git a/src/components/Footer/Footer.astro b/src/components/Footer/Footer.astro index 2147193..469dc6a 100644 --- a/src/components/Footer/Footer.astro +++ b/src/components/Footer/Footer.astro @@ -2,9 +2,9 @@ import { Icon } from "astro-icon"; --- -