diff --git a/README.md b/README.md index 101d4f2..81aae62 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Personal website created with Astro. - [x] Dark/Light Theme - [x] Multilang web-site - [x] Form handling via [Netlify Forms](https://www.netlify.com/products/forms/) -- [ ] Comment system via [utterances](https://utteranc.es/) +- [x] Comment system via [utterances](https://utteranc.es/) - [ ] SEO optimized ## License diff --git a/package-lock.json b/package-lock.json index 168978c..7bea0c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@typescript-eslint/eslint-plugin": "^5.33.1", "@typescript-eslint/parser": "^5.33.1", "astro": "^1.0.6", - "astro-compress": "^0.0.19", + "astro-compress": "^1.0.1", "astro-icon": "^0.7.3", "eslint": "^8.22.0", "eslint-plugin-solid": "^0.7.1", @@ -1538,9 +1538,9 @@ } }, "node_modules/astro-compress": { - "version": "0.0.19", - "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-0.0.19.tgz", - "integrity": "sha512-Hgv1wX43vOwzUNuqRm7hbCMUXoH2xF+kTjBR+6RqAbM6hjqIlB8aKEGOVdELj6BiwnMDLf1dl6C1TmYPPgDMAg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-1.0.1.tgz", + "integrity": "sha512-6w8n4KF5KbvEp86E5uUsRMB1uWNz04gml9EkyDXi5+7r8NKG/efOu+TVyhIaj7QWDevdDXLYPrMH//9HyNtCWA==", "dev": true, "dependencies": { "csso": "5.0.5", @@ -10382,9 +10382,9 @@ } }, "astro-compress": { - "version": "0.0.19", - "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-0.0.19.tgz", - "integrity": "sha512-Hgv1wX43vOwzUNuqRm7hbCMUXoH2xF+kTjBR+6RqAbM6hjqIlB8aKEGOVdELj6BiwnMDLf1dl6C1TmYPPgDMAg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/astro-compress/-/astro-compress-1.0.1.tgz", + "integrity": "sha512-6w8n4KF5KbvEp86E5uUsRMB1uWNz04gml9EkyDXi5+7r8NKG/efOu+TVyhIaj7QWDevdDXLYPrMH//9HyNtCWA==", "dev": true, "requires": { "csso": "5.0.5", diff --git a/package.json b/package.json index 11808cc..c234b21 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@typescript-eslint/eslint-plugin": "^5.33.1", "@typescript-eslint/parser": "^5.33.1", "astro": "^1.0.6", - "astro-compress": "^0.0.19", + "astro-compress": "^1.0.1", "astro-icon": "^0.7.3", "eslint": "^8.22.0", "eslint-plugin-solid": "^0.7.1", diff --git a/src/components/ArticleComments/ArticleComments.astro b/src/components/ArticleComments/ArticleComments.astro index 58752e9..82edd42 100644 --- a/src/components/ArticleComments/ArticleComments.astro +++ b/src/components/ArticleComments/ArticleComments.astro @@ -1,7 +1,29 @@ --- +import { UTTERANCES_CONFIG } from "@root/config"; import UIString from "../UIString"; --- + + diff --git a/src/config.ts b/src/config.ts index f144370..c1cca3d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,12 @@ export const DEFAULT_LANGUAGE: LanguageKeys = "ru"; +export const UTTERANCES_CONFIG: UtterancesConfigType = { + repo: "sergeyyarkov/comments", + issueTerm: "title", + label: "Comments", + theme: "github-light", +}; + export const SITE_METADATA: SiteMetadataType = { title: "Sergey Yarkov", name: "yarkov.tech", diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index c5e3834..0f517d1 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -10,7 +10,6 @@ const lang = getLanguageFromURL(Astro.url.pathname); export async function getStaticPaths() { const modules = import.meta.glob>("../../../content/articles/**/*.mdx", { eager: true }); const entries = Object.keys(modules).map((key) => [key, key.split("/").slice(7)[0]]); - const data = await Astro.glob("../../../content/articles/**/*.mdx"); return entries.map(([key, lang]) => { const article = modules[key]; diff --git a/src/types/main.d.ts b/src/types/main.d.ts index 07e13bb..42a9eec 100644 --- a/src/types/main.d.ts +++ b/src/types/main.d.ts @@ -15,6 +15,13 @@ declare global { type LanguageKeys = keyof typeof languages; type UIDictionaryKeys = keyof typeof uiKeys; + type UtterancesConfigType = { + repo: string; + label?: string; + issueTerm: string; + theme: string; + }; + type SiteMetadataType = { title: string; name: string;