diff --git a/.vscode/settings.json b/.vscode/settings.json index 175ae55..961e10d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,5 +14,5 @@ "i18n-ally.review.gutters": false, "i18n-ally.sortCompare": "locale", "i18n-ally.sortKeys": true, - "i18n-ally.sortLocale": "en" + "i18n-ally.sortLocale": "en", } diff --git a/scripts/generate-i18n-locale-types.ts b/scripts/generate-i18n-locale-types.ts index 10dc95c..e20e9f1 100644 --- a/scripts/generate-i18n-locale-types.ts +++ b/scripts/generate-i18n-locale-types.ts @@ -1,12 +1,11 @@ // npx ts-node --esm file.ts -import { quicktype, InputData, jsonInputForTargetLanguage, TypeScriptTargetLanguage } from "quicktype-core"; +import jsyaml from "js-yaml"; import fs from "node:fs"; import path from "node:path"; import { dirname } from "path"; +import { InputData, TypeScriptTargetLanguage, jsonInputForTargetLanguage, quicktype } from "quicktype-core"; import { fileURLToPath } from "url"; -import jsyaml from "js-yaml"; -import { Console } from "node:console"; const __dirname = dirname(fileURLToPath(import.meta.url)); diff --git a/scripts/yaml-convert.ts b/scripts/yaml-convert.ts index a4a5b00..13b2eea 100644 --- a/scripts/yaml-convert.ts +++ b/scripts/yaml-convert.ts @@ -1,10 +1,10 @@ // npx ts-node --esm file.ts +import yaml from "js-yaml"; import fs from "node:fs"; import path from "node:path"; import { dirname } from "path"; import { fileURLToPath } from "url"; -import yaml from "js-yaml"; const __dirname = dirname(fileURLToPath(import.meta.url)); const folderName = path.resolve(__dirname, "./src/content/categories/"); diff --git a/src/components/astro/blog/AllPostsUrl.astro b/src/components/astro/blog/AllPostsUrl.astro index f420b94..5a63901 100644 --- a/src/components/astro/blog/AllPostsUrl.astro +++ b/src/components/astro/blog/AllPostsUrl.astro @@ -1,17 +1,7 @@ --- -import { getCollection, type CollectionEntry } from "astro:content"; -import { getRoutingLocale, getLocale } from "@i18n/utils"; -import PageLayout from "@layouts/PageLayout.astro"; -import { loadNamespaces, t } from "@i18n/i18n"; -import Section from "@components/astro/global/Section.astro"; -import SmallBlogPostPreview from "@components/astro/blog/SmallBlogPostPreview.astro"; -import BreadCrumbs from "@components/astro/blog/BreadCrumbs.astro"; -import BreadCrumbsItem from "@components/astro/blog/BreadCrumbsItem.astro"; -import { getRelativeLocaleUrl } from "astro:i18n"; -import { getTagByLocale } from "@utils/getTagByLocale"; -import { locales } from "@config/i18n"; -import type { Page } from "astro"; +import { getLocale } from "@i18n/utils"; import { Icon } from "astro-icon/components"; +import { getRelativeLocaleUrl } from "astro:i18n"; interface Props { url: string; @@ -22,7 +12,6 @@ const { url, urlDescription } = Astro.props; // i18next const locale = getLocale(Astro.url); - ---
{t("blog.no_tagged_posts")} {title}
} - {filteredPosts && filteredPosts.length === 0 &&{t("blog.no_tagged_posts")}{title}
} + { + !filteredPosts && ( ++ {t("blog.no_tagged_posts")} {title} +
+ ) + } + { + filteredPosts && filteredPosts.length === 0 && ( ++ {t("blog.no_tagged_posts")} + {title} +
+ ) + } { filteredPosts && filteredPosts.length !== 0 && ( <> diff --git a/src/components/astro/blog/TagList.astro b/src/components/astro/blog/TagList.astro index 345cf21..3bd3496 100644 --- a/src/components/astro/blog/TagList.astro +++ b/src/components/astro/blog/TagList.astro @@ -1,8 +1,8 @@ --- -import { getEntry, type CollectionEntry } from "astro:content"; import { getLocale } from "@i18n/utils"; -import { getRelativeLocaleUrl } from "astro:i18n"; import { getTagByLocale } from "@utils/getTagByLocale"; +import { type CollectionEntry } from "astro:content"; +import { getRelativeLocaleUrl } from "astro:i18n"; interface Props { post?: CollectionEntry<"posts">; diff --git a/src/components/astro/global/Contact.astro b/src/components/astro/global/Contact.astro index 7abea09..ce547bf 100644 --- a/src/components/astro/global/Contact.astro +++ b/src/components/astro/global/Contact.astro @@ -1,8 +1,8 @@ --- +import ContactForm from "@components/react/ContactForm/ContactForm"; import i18n, { loadNamespaces } from "@i18n/i18n"; -import type { ContactRes, CommonRes } from "@i18n/locales/types"; +import type { CommonRes, ContactRes } from "@i18n/locales/types"; import { getLocale } from "@i18n/utils"; -import ContactForm from "@components/react/ContactForm/ContactForm"; // i18next const locale = getLocale(Astro.url); diff --git a/src/components/astro/global/Footer.astro b/src/components/astro/global/Footer.astro index 4d18039..4032153 100644 --- a/src/components/astro/global/Footer.astro +++ b/src/components/astro/global/Footer.astro @@ -1,10 +1,8 @@ --- -import { Image } from "astro:assets"; import { getLocale } from "@i18n/utils"; import { loadNamespaces, t } from "@i18n/i18n"; // Images -import astroSvg from "@assets/img/astro/simple-full-logo-light.svg"; import { Icon } from "astro-icon/components"; // i18next diff --git a/src/components/astro/global/HeadHrefLangs.astro b/src/components/astro/global/HeadHrefLangs.astro index 13a26fd..0cfcec7 100644 --- a/src/components/astro/global/HeadHrefLangs.astro +++ b/src/components/astro/global/HeadHrefLangs.astro @@ -1,8 +1,8 @@ --- import { defaultLocale, locales } from "@config/i18n"; import { getPathFromUrl } from "@i18n/utils"; -import { getBlogPostByIdAndLocale } from "@utils/getBlogPostByIdAndLocale"; import { getAbsoluteBlogPostUrl } from "@utils/getAbsoluteBlogPostUrl"; +import { getBlogPostByIdAndLocale } from "@utils/getBlogPostByIdAndLocale"; import type { CollectionEntry } from "astro:content"; import { getAbsoluteLocaleUrl } from "astro:i18n"; diff --git a/src/components/astro/global/LanguageSelector.astro b/src/components/astro/global/LanguageSelector.astro index 1369284..fb136fc 100644 --- a/src/components/astro/global/LanguageSelector.astro +++ b/src/components/astro/global/LanguageSelector.astro @@ -2,15 +2,15 @@ // Credits: https://github.com/yassinedoghri/astro-i18next/blob/beta/src/components/LanguageSelector.astro // Edited for this project needs. -import { getLocale, getPathFromUrl } from "@i18n/utils"; -import ISO6991 from "iso-639-1"; import { locales } from "@config/i18n"; -import { getRelativeLocaleUrl } from "astro:i18n"; -import type { CollectionEntry } from "astro:content"; +import { loadNamespaces } from "@i18n/i18n"; +import { getLocale, getPathFromUrl } from "@i18n/utils"; import { getBlogPostByIdAndLocale } from "@utils/getBlogPostByIdAndLocale"; import { getBlogPostUrl } from "@utils/getBlogPostUrl"; -import { loadNamespaces, t } from "@i18n/i18n"; import { Icon } from "astro-icon/components"; +import type { CollectionEntry } from "astro:content"; +import { getRelativeLocaleUrl } from "astro:i18n"; +import ISO6991 from "iso-639-1"; interface Props { post?: CollectionEntry<"posts">; diff --git a/src/components/astro/global/Navigation.astro b/src/components/astro/global/Navigation.astro index bd50b3d..042393d 100644 --- a/src/components/astro/global/Navigation.astro +++ b/src/components/astro/global/Navigation.astro @@ -1,11 +1,11 @@ --- -import { getLocale } from "@i18n/utils"; import { loadNamespaces, t } from "@i18n/i18n"; -import LanguageSelector from "./LanguageSelector.astro"; -import { getRelativeLocaleUrl } from "astro:i18n"; +import { getLocale } from "@i18n/utils"; +import { Icon } from "astro-icon/components"; import type { CollectionEntry } from "astro:content"; +import { getRelativeLocaleUrl } from "astro:i18n"; +import LanguageSelector from "./LanguageSelector.astro"; import Search from "./Search.astro"; -import { Icon } from "astro-icon/components"; import ThemeSelect from "./ThemeSelect.astro"; interface Props { diff --git a/src/components/astro/global/Search.astro b/src/components/astro/global/Search.astro index 151f7ae..a4b9074 100644 --- a/src/components/astro/global/Search.astro +++ b/src/components/astro/global/Search.astro @@ -32,8 +32,8 @@ if (locale === "cs") {