This commit is contained in:
Sergey Yarkov 2022-08-29 13:21:59 +03:00
parent 2f2de872fd
commit 2d8807365d
3 changed files with 19 additions and 8 deletions

View File

@ -26,8 +26,9 @@ import { defineConfig } from "astro/config";
import { h } from "hastscript"; import { h } from "hastscript";
import { toString } from "hast-util-to-string"; import { toString } from "hast-util-to-string";
import { escape } from "html-escaper"; import { escape } from "html-escaper";
import languages from "./src/i18n/languages";
const createAnchorLabel = (heading) => { const createAnchorLabel = (heading: string) => {
const node = h("span.anchor-label", escape(heading)); const node = h("span.anchor-label", escape(heading));
node.properties["is:raw"] = true; node.properties["is:raw"] = true;
return node; return node;
@ -41,11 +42,7 @@ export default defineConfig({
sitemap({ sitemap({
i18n: { i18n: {
defaultLocale: "ru", defaultLocale: "ru",
locales: { locales: Object.fromEntries(Object.keys(languages).map((key) => [key, key])),
ru: "ru",
en: "en",
de: "de",
},
}, },
}), }),
image(), image(),

17
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "yarkov.tech", "name": "yarkov.tech",
"version": "0.0.1", "version": "1.0.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "yarkov.tech", "name": "yarkov.tech",
"version": "0.0.1", "version": "1.0.1",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@astrojs/image": "^0.3.6", "@astrojs/image": "^0.3.6",
@ -14,6 +14,7 @@
"@astrojs/rss": "^1.0.0", "@astrojs/rss": "^1.0.0",
"@astrojs/sitemap": "^1.0.0", "@astrojs/sitemap": "^1.0.0",
"@astrojs/solid-js": "^1.1.0", "@astrojs/solid-js": "^1.1.0",
"@types/html-escaper": "^3.0.0",
"@types/mdx": "^2.0.2", "@types/mdx": "^2.0.2",
"@typescript-eslint/eslint-plugin": "^5.35.1", "@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.35.1", "@typescript-eslint/parser": "^5.35.1",
@ -1078,6 +1079,12 @@
"@types/unist": "*" "@types/unist": "*"
} }
}, },
"node_modules/@types/html-escaper": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/html-escaper/-/html-escaper-3.0.0.tgz",
"integrity": "sha512-OcJcvP3Yk8mjYwf/IdXZtTE1tb/u0WF0qa29ER07ZHCYUBZXSN29Z1mBS+/96+kNMGTFUAbSz9X+pHmHpZrTCw==",
"dev": true
},
"node_modules/@types/json-schema": { "node_modules/@types/json-schema": {
"version": "7.0.11", "version": "7.0.11",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
@ -10373,6 +10380,12 @@
"@types/unist": "*" "@types/unist": "*"
} }
}, },
"@types/html-escaper": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/html-escaper/-/html-escaper-3.0.0.tgz",
"integrity": "sha512-OcJcvP3Yk8mjYwf/IdXZtTE1tb/u0WF0qa29ER07ZHCYUBZXSN29Z1mBS+/96+kNMGTFUAbSz9X+pHmHpZrTCw==",
"dev": true
},
"@types/json-schema": { "@types/json-schema": {
"version": "7.0.11", "version": "7.0.11",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",

View File

@ -24,6 +24,7 @@
"@astrojs/rss": "^1.0.0", "@astrojs/rss": "^1.0.0",
"@astrojs/sitemap": "^1.0.0", "@astrojs/sitemap": "^1.0.0",
"@astrojs/solid-js": "^1.1.0", "@astrojs/solid-js": "^1.1.0",
"@types/html-escaper": "^3.0.0",
"@types/mdx": "^2.0.2", "@types/mdx": "^2.0.2",
"@typescript-eslint/eslint-plugin": "^5.35.1", "@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.35.1", "@typescript-eslint/parser": "^5.35.1",