feat: searching articles by description & title

This commit is contained in:
Sergey Yarkov 2022-07-31 20:43:45 +03:00
parent d0882b41ea
commit 73ee879952
9 changed files with 162 additions and 183 deletions

234
package-lock.json generated
View File

@ -10,16 +10,16 @@
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@astrojs/solid-js": "^0.4.1", "@astrojs/solid-js": "^0.4.1",
"@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.30.7", "@typescript-eslint/parser": "^5.31.0",
"astro": "^1.0.0-beta.73", "astro": "^1.0.0-beta.73",
"astro-icon": "^0.7.3", "astro-icon": "^0.7.3",
"eslint": "^8.20.0", "eslint": "^8.20.0",
"eslint-plugin-solid": "^0.7.1", "eslint-plugin-solid": "^0.7.1",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"prettier-plugin-astro": "^0.1.1", "prettier-plugin-astro": "^0.2.0",
"sass": "^1.53.0", "sass": "^1.54.0",
"solid-js": "^1.4.7" "solid-js": "^1.4.8"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
@ -885,14 +885,14 @@
"dev": true "dev": true
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.31.0.tgz",
"integrity": "sha512-l4L6Do+tfeM2OK0GJsU7TUcM/1oN/N25xHm3Jb4z3OiDU4Lj8dIuxX9LpVMS9riSXQs42D1ieX7b85/r16H9Fw==", "integrity": "sha512-VKW4JPHzG5yhYQrQ1AzXgVgX8ZAJEvCz0QI6mLRX4tf7rnFfh5D8SKm0Pq6w5PyNfAWJk6sv313+nEt3ohWMBQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "5.30.7", "@typescript-eslint/scope-manager": "5.31.0",
"@typescript-eslint/type-utils": "5.30.7", "@typescript-eslint/type-utils": "5.31.0",
"@typescript-eslint/utils": "5.30.7", "@typescript-eslint/utils": "5.31.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"ignore": "^5.2.0", "ignore": "^5.2.0",
@ -918,14 +918,14 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.31.0.tgz",
"integrity": "sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A==", "integrity": "sha512-UStjQiZ9OFTFReTrN+iGrC6O/ko9LVDhreEK5S3edmXgR396JGq7CoX2TWIptqt/ESzU2iRKXAHfSF2WJFcWHw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "5.30.7", "@typescript-eslint/scope-manager": "5.31.0",
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/typescript-estree": "5.30.7", "@typescript-eslint/typescript-estree": "5.31.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@ -945,13 +945,13 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.31.0.tgz",
"integrity": "sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw==", "integrity": "sha512-8jfEzBYDBG88rcXFxajdVavGxb5/XKXyvWgvD8Qix3EEJLCFIdVloJw+r9ww0wbyNLOTYyBsR+4ALNGdlalLLg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/visitor-keys": "5.30.7" "@typescript-eslint/visitor-keys": "5.31.0"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -962,12 +962,12 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.31.0.tgz",
"integrity": "sha512-nD5qAE2aJX/YLyKMvOU5jvJyku4QN5XBVsoTynFrjQZaDgDV6i7QHFiYCx10wvn7hFvfuqIRNBtsgaLe0DbWhw==", "integrity": "sha512-7ZYqFbvEvYXFn9ax02GsPcEOmuWNg+14HIf4q+oUuLnMbpJ6eHAivCg7tZMVwzrIuzX3QCeAOqKoyMZCv5xe+w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/utils": "5.30.7", "@typescript-eslint/utils": "5.31.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"tsutils": "^3.21.0" "tsutils": "^3.21.0"
}, },
@ -988,9 +988,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.31.0.tgz",
"integrity": "sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg==", "integrity": "sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -1001,13 +1001,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.31.0.tgz",
"integrity": "sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA==", "integrity": "sha512-3S625TMcARX71wBc2qubHaoUwMEn+l9TCsaIzYI/ET31Xm2c9YQ+zhGgpydjorwQO9pLfR/6peTzS/0G3J/hDw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/visitor-keys": "5.30.7", "@typescript-eslint/visitor-keys": "5.31.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -1028,15 +1028,15 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.31.0.tgz",
"integrity": "sha512-Z3pHdbFw+ftZiGUnm1GZhkJgVqsDL5CYW2yj+TB2mfXDFOMqtbzQi2dNJIyPqPbx9mv2kUxS1gU+r2gKlKi1rQ==", "integrity": "sha512-kcVPdQS6VIpVTQ7QnGNKMFtdJdvnStkqS5LeALr4rcwx11G6OWb2HB17NMPnlRHvaZP38hL9iK8DdE9Fne7NYg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/json-schema": "^7.0.9", "@types/json-schema": "^7.0.9",
"@typescript-eslint/scope-manager": "5.30.7", "@typescript-eslint/scope-manager": "5.31.0",
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/typescript-estree": "5.30.7", "@typescript-eslint/typescript-estree": "5.31.0",
"eslint-scope": "^5.1.1", "eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0" "eslint-utils": "^3.0.0"
}, },
@ -1074,12 +1074,12 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.31.0.tgz",
"integrity": "sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw==", "integrity": "sha512-ZK0jVxSjS4gnPirpVjXHz7mgdOsZUHzNYSfTw2yPa3agfbt9YfqaBiBZFSSxeBWnpWkzCxTfUpnzA3Vily/CSg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.3.0"
}, },
"engines": { "engines": {
@ -6190,31 +6190,21 @@
} }
}, },
"node_modules/prettier-plugin-astro": { "node_modules/prettier-plugin-astro": {
"version": "0.1.1", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.1.1.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.2.0.tgz",
"integrity": "sha512-587zFbgQoZm13jjGukkW0xMDKLwuMw6RlSuvsjdjRr43JWUFTJVxwFnw44pLYLVRwGQLOCDBwBKiZEJ10ghBlQ==", "integrity": "sha512-T+pWXK6AWcIE+KMSI6RFCshDLvAofiMuSk4w7tO3UtG4Fgpm1eyqmddTStIGmURjx+KgqIrRogV1QEzwet+teg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@astrojs/compiler": "^0.15.2", "@astrojs/compiler": "^0.19.0",
"prettier": "^2.6.2", "prettier": "^2.7.1",
"sass-formatter": "^0.7.2", "sass-formatter": "^0.7.2",
"synckit": "^0.7.0" "synckit": "^0.7.0"
}, },
"engines": { "engines": {
"node": "^14.13.1 || >=16.0.0", "node": "^14.15.0 || >=16.0.0",
"npm": ">=6.14.0" "npm": ">=6.14.0"
} }
}, },
"node_modules/prettier-plugin-astro/node_modules/@astrojs/compiler": {
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-0.15.2.tgz",
"integrity": "sha512-YsxIyx026zPWbxv3wYrudr1jh8u6oSnhP6MW+9OAgiFuICHjSX4Rw+qm8wJj1D5IkJ3HsDtE+kFMMYIozZ5bvQ==",
"dev": true,
"dependencies": {
"tsm": "^2.2.1",
"uvu": "^0.5.3"
}
},
"node_modules/prismjs": { "node_modules/prismjs": {
"version": "1.28.0", "version": "1.28.0",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.28.0.tgz", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.28.0.tgz",
@ -6710,9 +6700,9 @@
"dev": true "dev": true
}, },
"node_modules/sass": { "node_modules/sass": {
"version": "1.53.0", "version": "1.54.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.53.0.tgz", "resolved": "https://registry.npmjs.org/sass/-/sass-1.54.0.tgz",
"integrity": "sha512-zb/oMirbKhUgRQ0/GFz8TSAwRq2IlR29vOUJZOx0l8sV+CkHUfHa4u5nqrG+1VceZp7Jfj59SVW9ogdhTvJDcQ==", "integrity": "sha512-C4zp79GCXZfK0yoHZg+GxF818/aclhp9F48XBu/+bm9vXEVAYov9iU3FBVRMq3Hx3OA4jfKL+p2K9180mEh0xQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"chokidar": ">=3.0.0 <4.0.0", "chokidar": ">=3.0.0 <4.0.0",
@ -6854,9 +6844,9 @@
} }
}, },
"node_modules/solid-js": { "node_modules/solid-js": {
"version": "1.4.7", "version": "1.4.8",
"resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.4.7.tgz", "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.4.8.tgz",
"integrity": "sha512-u3hoe5w3xseAc/8zLwYaQVGanWXknMMQkzryNz7lOPy2ygW6DhCtfMseun4kLflRNRzrUUpTV3W5p7j2SGcHCQ==", "integrity": "sha512-XErZdnnYYXF7OwGSUAPcua2y5/ELB/c53zFCpWiEGqxTNoH1iQghzI8EsHJXk06sNn+Z/TGhb8bPDNNGSgimag==",
"dev": true "dev": true
}, },
"node_modules/source-map": { "node_modules/source-map": {
@ -8681,14 +8671,14 @@
"dev": true "dev": true
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.31.0.tgz",
"integrity": "sha512-l4L6Do+tfeM2OK0GJsU7TUcM/1oN/N25xHm3Jb4z3OiDU4Lj8dIuxX9LpVMS9riSXQs42D1ieX7b85/r16H9Fw==", "integrity": "sha512-VKW4JPHzG5yhYQrQ1AzXgVgX8ZAJEvCz0QI6mLRX4tf7rnFfh5D8SKm0Pq6w5PyNfAWJk6sv313+nEt3ohWMBQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/scope-manager": "5.30.7", "@typescript-eslint/scope-manager": "5.31.0",
"@typescript-eslint/type-utils": "5.30.7", "@typescript-eslint/type-utils": "5.31.0",
"@typescript-eslint/utils": "5.30.7", "@typescript-eslint/utils": "5.31.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"ignore": "^5.2.0", "ignore": "^5.2.0",
@ -8698,52 +8688,52 @@
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.31.0.tgz",
"integrity": "sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A==", "integrity": "sha512-UStjQiZ9OFTFReTrN+iGrC6O/ko9LVDhreEK5S3edmXgR396JGq7CoX2TWIptqt/ESzU2iRKXAHfSF2WJFcWHw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/scope-manager": "5.30.7", "@typescript-eslint/scope-manager": "5.31.0",
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/typescript-estree": "5.30.7", "@typescript-eslint/typescript-estree": "5.31.0",
"debug": "^4.3.4" "debug": "^4.3.4"
} }
}, },
"@typescript-eslint/scope-manager": { "@typescript-eslint/scope-manager": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.31.0.tgz",
"integrity": "sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw==", "integrity": "sha512-8jfEzBYDBG88rcXFxajdVavGxb5/XKXyvWgvD8Qix3EEJLCFIdVloJw+r9ww0wbyNLOTYyBsR+4ALNGdlalLLg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/visitor-keys": "5.30.7" "@typescript-eslint/visitor-keys": "5.31.0"
} }
}, },
"@typescript-eslint/type-utils": { "@typescript-eslint/type-utils": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.31.0.tgz",
"integrity": "sha512-nD5qAE2aJX/YLyKMvOU5jvJyku4QN5XBVsoTynFrjQZaDgDV6i7QHFiYCx10wvn7hFvfuqIRNBtsgaLe0DbWhw==", "integrity": "sha512-7ZYqFbvEvYXFn9ax02GsPcEOmuWNg+14HIf4q+oUuLnMbpJ6eHAivCg7tZMVwzrIuzX3QCeAOqKoyMZCv5xe+w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/utils": "5.30.7", "@typescript-eslint/utils": "5.31.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"tsutils": "^3.21.0" "tsutils": "^3.21.0"
} }
}, },
"@typescript-eslint/types": { "@typescript-eslint/types": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.31.0.tgz",
"integrity": "sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg==", "integrity": "sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g==",
"dev": true "dev": true
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.31.0.tgz",
"integrity": "sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA==", "integrity": "sha512-3S625TMcARX71wBc2qubHaoUwMEn+l9TCsaIzYI/ET31Xm2c9YQ+zhGgpydjorwQO9pLfR/6peTzS/0G3J/hDw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/visitor-keys": "5.30.7", "@typescript-eslint/visitor-keys": "5.31.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -8752,15 +8742,15 @@
} }
}, },
"@typescript-eslint/utils": { "@typescript-eslint/utils": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.31.0.tgz",
"integrity": "sha512-Z3pHdbFw+ftZiGUnm1GZhkJgVqsDL5CYW2yj+TB2mfXDFOMqtbzQi2dNJIyPqPbx9mv2kUxS1gU+r2gKlKi1rQ==", "integrity": "sha512-kcVPdQS6VIpVTQ7QnGNKMFtdJdvnStkqS5LeALr4rcwx11G6OWb2HB17NMPnlRHvaZP38hL9iK8DdE9Fne7NYg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/json-schema": "^7.0.9", "@types/json-schema": "^7.0.9",
"@typescript-eslint/scope-manager": "5.30.7", "@typescript-eslint/scope-manager": "5.31.0",
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"@typescript-eslint/typescript-estree": "5.30.7", "@typescript-eslint/typescript-estree": "5.31.0",
"eslint-scope": "^5.1.1", "eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0" "eslint-utils": "^3.0.0"
}, },
@ -8784,12 +8774,12 @@
} }
}, },
"@typescript-eslint/visitor-keys": { "@typescript-eslint/visitor-keys": {
"version": "5.30.7", "version": "5.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.31.0.tgz",
"integrity": "sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw==", "integrity": "sha512-ZK0jVxSjS4gnPirpVjXHz7mgdOsZUHzNYSfTw2yPa3agfbt9YfqaBiBZFSSxeBWnpWkzCxTfUpnzA3Vily/CSg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "5.30.7", "@typescript-eslint/types": "5.31.0",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.3.0"
} }
}, },
@ -12258,27 +12248,15 @@
"dev": true "dev": true
}, },
"prettier-plugin-astro": { "prettier-plugin-astro": {
"version": "0.1.1", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.1.1.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.2.0.tgz",
"integrity": "sha512-587zFbgQoZm13jjGukkW0xMDKLwuMw6RlSuvsjdjRr43JWUFTJVxwFnw44pLYLVRwGQLOCDBwBKiZEJ10ghBlQ==", "integrity": "sha512-T+pWXK6AWcIE+KMSI6RFCshDLvAofiMuSk4w7tO3UtG4Fgpm1eyqmddTStIGmURjx+KgqIrRogV1QEzwet+teg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@astrojs/compiler": "^0.15.2", "@astrojs/compiler": "^0.19.0",
"prettier": "^2.6.2", "prettier": "^2.7.1",
"sass-formatter": "^0.7.2", "sass-formatter": "^0.7.2",
"synckit": "^0.7.0" "synckit": "^0.7.0"
},
"dependencies": {
"@astrojs/compiler": {
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-0.15.2.tgz",
"integrity": "sha512-YsxIyx026zPWbxv3wYrudr1jh8u6oSnhP6MW+9OAgiFuICHjSX4Rw+qm8wJj1D5IkJ3HsDtE+kFMMYIozZ5bvQ==",
"dev": true,
"requires": {
"tsm": "^2.2.1",
"uvu": "^0.5.3"
}
}
} }
}, },
"prismjs": { "prismjs": {
@ -12625,9 +12603,9 @@
"dev": true "dev": true
}, },
"sass": { "sass": {
"version": "1.53.0", "version": "1.54.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.53.0.tgz", "resolved": "https://registry.npmjs.org/sass/-/sass-1.54.0.tgz",
"integrity": "sha512-zb/oMirbKhUgRQ0/GFz8TSAwRq2IlR29vOUJZOx0l8sV+CkHUfHa4u5nqrG+1VceZp7Jfj59SVW9ogdhTvJDcQ==", "integrity": "sha512-C4zp79GCXZfK0yoHZg+GxF818/aclhp9F48XBu/+bm9vXEVAYov9iU3FBVRMq3Hx3OA4jfKL+p2K9180mEh0xQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"chokidar": ">=3.0.0 <4.0.0", "chokidar": ">=3.0.0 <4.0.0",
@ -12738,9 +12716,9 @@
"dev": true "dev": true
}, },
"solid-js": { "solid-js": {
"version": "1.4.7", "version": "1.4.8",
"resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.4.7.tgz", "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.4.8.tgz",
"integrity": "sha512-u3hoe5w3xseAc/8zLwYaQVGanWXknMMQkzryNz7lOPy2ygW6DhCtfMseun4kLflRNRzrUUpTV3W5p7j2SGcHCQ==", "integrity": "sha512-XErZdnnYYXF7OwGSUAPcua2y5/ELB/c53zFCpWiEGqxTNoH1iQghzI8EsHJXk06sNn+Z/TGhb8bPDNNGSgimag==",
"dev": true "dev": true
}, },
"source-map": { "source-map": {

View File

@ -19,15 +19,15 @@
}, },
"devDependencies": { "devDependencies": {
"@astrojs/solid-js": "^0.4.1", "@astrojs/solid-js": "^0.4.1",
"@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.30.7", "@typescript-eslint/parser": "^5.31.0",
"astro": "^1.0.0-beta.73", "astro": "^1.0.0-beta.73",
"astro-icon": "^0.7.3", "astro-icon": "^0.7.3",
"eslint": "^8.20.0", "eslint": "^8.20.0",
"eslint-plugin-solid": "^0.7.1", "eslint-plugin-solid": "^0.7.1",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"prettier-plugin-astro": "^0.1.1", "prettier-plugin-astro": "^0.2.0",
"sass": "^1.53.0", "sass": "^1.54.0",
"solid-js": "^1.4.7" "solid-js": "^1.4.8"
} }
} }

View File

@ -39,7 +39,7 @@ const ArticlesList: Component<ArticlesListProps> = (props) => {
* Find articles by title * Find articles by title
*/ */
if (search()) { if (search()) {
filtered = findArticlesBySearch(search(), filtered); filtered = findArticlesBySearch(search().trim(), filtered);
setArticles(filtered); setArticles(filtered);
} }

View File

@ -25,14 +25,14 @@ const SearchInput: Component<SearchInputProps> = (props) => {
* Update state and set url param * Update state and set url param
*/ */
const onSearch: JSX.EventHandler<HTMLInputElement, InputEvent> = (e) => { const onSearch: JSX.EventHandler<HTMLInputElement, InputEvent> = (e) => {
const value = e.currentTarget.value.trim(); const value = e.currentTarget.value;
if (value.length === 0) { if (value.trim().length === 0) {
resetSearch(); resetSearch();
return; return;
} }
const url = utils.setParamToUrl('search', value); const url = utils.setParamToUrl('search', value.trim());
history.replaceState(null, '', `${location.pathname}?${url}`); history.replaceState(null, '', `${location.pathname}?${url}`);
setSearch(value); setSearch(value);
@ -48,6 +48,7 @@ const SearchInput: Component<SearchInputProps> = (props) => {
resetSearch(); resetSearch();
return; return;
} }
console.log(param);
setSearch(param); setSearch(param);
}); });

View File

@ -1,36 +1,36 @@
--- ---
import type { Props as BaseHeadProps } from '@root/components/BaseHead.astro'; import type { Props as BaseHeadProps } from '@root/components/BaseHead.astro';
import BaseHead from '@components/BaseHead.astro'; import BaseHead from '@components/BaseHead.astro';
import BaseLayout from '@components/BaseLayout'; import BaseLayout from '@components/BaseLayout';
import ArticleContent from '@components/ArticleContent'; import ArticleContent from '@components/ArticleContent';
import ArticlePost from '@components/ArticlePost'; import ArticlePost from '@components/ArticlePost';
import '@styles/global.scss'; import '@styles/global.scss';
export interface Props extends BaseHeadProps { export interface Props extends BaseHeadProps {
lang?: string | undefined; lang?: string | undefined;
content: ArticleType; content: ArticleType;
} }
const { lang = 'ru', content } = Astro.props as Props; const { lang = 'ru', content } = Astro.props as Props;
--- ---
<html lang={lang}> <html lang={lang}>
<head>
<BaseHead title={content.title} description={content.description}>
<script is:inline defer src='assets/js/load-code-highlight.js'>
<head> </script>
<BaseHead title={content.title}> </BaseHead>
<script is:inline defer src='assets/js/load-code-highlight.js' /> </head>
</BaseHead>
</head>
<BaseLayout>
<div class='container'>
<ArticlePost data={content}>
<ArticleContent>
<slot></slot>
</ArticleContent>
</ArticlePost>
</div>
</BaseLayout>
<BaseLayout>
<div class='container'>
<ArticlePost data={content}>
<ArticleContent>
<slot></slot>
</ArticleContent>
</ArticlePost>
</div>
</BaseLayout>
</html> </html>

View File

@ -10,6 +10,7 @@ export function getStaticPaths() {
<ArticleLayout <ArticleLayout
content={{ content={{
title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
description: 'description1',
author: 'Sergey Yarkov', author: 'Sergey Yarkov',
tags: ['AVR', 'JavaScript', 'NodeJS'], tags: ['AVR', 'JavaScript', 'NodeJS'],
published_at: new Date().toISOString(), published_at: new Date().toISOString(),

View File

@ -1,24 +1,16 @@
--- ---
import PageLayout from '@layouts/default.astro'; import PageLayout from '@layouts/default.astro';
import ArticlesList from '@components/ArticlesList'; import ArticlesList from '@components/ArticlesList';
import { transformArticles, formatToArticleBlocks } from '@utils/articles'; import { transformArticles, formatToArticleBlocks } from '@utils/articles';
const articles = await Astro.glob<ArticleType>('../../content/articles/**/*.md'); const articles = await Astro.glob<ArticleType>('../../content/articles/**/*.md');
const tags = new Set(articles.map((article) => article.frontmatter.tags).flat()); const tags = new Set(articles.map((article) => article.frontmatter.tags).flat());
--- ---
<PageLayout <PageLayout title='Статьи'
title='Статьи' description='Технические статьи, туториалы и различные справочные материалы которые связаны с IT тематикой находятся здесь.'>
description='Технические статьи, туториалы и различные справочные материалы которые связаны с IT тематикой находятся здесь.'
>
<section> <section>
<ArticlesList <ArticlesList client:load data={{ articles: formatToArticleBlocks(transformArticles(articles)), tags: [...tags], }}
client:load emptyPlaceholder='Не найдено ни одной статьи...' />
data={{
articles: formatToArticleBlocks(transformArticles(articles)),
tags: [...tags],
}}
emptyPlaceholder='Не найдено ни одной статьи...'
/>
</section> </section>
</PageLayout> </PageLayout>

1
src/types/main.d.ts vendored
View File

@ -12,6 +12,7 @@ declare global {
type ArticleType = { type ArticleType = {
title: string; title: string;
description: string;
author: string; author: string;
tags: Array<string>; tags: Array<string>;
published_at: string; published_at: string;

View File

@ -3,6 +3,7 @@ import { MarkdownInstance } from 'astro';
export const transformArticles = (articles: MarkdownInstance<ArticleType>[]): ArticleType[] => export const transformArticles = (articles: MarkdownInstance<ArticleType>[]): ArticleType[] =>
articles.map((article) => ({ articles.map((article) => ({
title: article.frontmatter.title, title: article.frontmatter.title,
description: article.frontmatter.description,
author: article.frontmatter.author, author: article.frontmatter.author,
tags: article.frontmatter.tags, tags: article.frontmatter.tags,
published_at: article.frontmatter.published_at, published_at: article.frontmatter.published_at,
@ -31,9 +32,14 @@ export const formatToArticleBlocks = (articles: ArticleType[]): ArticleBlockType
export const findArticlesBySearch = (search: string, articles: ArticleBlockType): ArticleBlockType => { export const findArticlesBySearch = (search: string, articles: ArticleBlockType): ArticleBlockType => {
const matched: Array<ArticleType> = []; const matched: Array<ArticleType> = [];
search = search.toLocaleLowerCase();
for (const year in articles) { for (const year in articles) {
for (const article of articles[year]) { for (const article of articles[year]) {
const match = article.title.toLocaleLowerCase().includes(search.toLocaleLowerCase()); const title = article.title.toLocaleLowerCase();
const description = article.description.toLocaleLowerCase();
const match = title.includes(search) || description.includes(search);
if (match) matched.push(article); if (match) matched.push(article);
} }
} }