Compare commits
7 Commits
4ac7da1231
...
b8fd186801
Author | SHA1 | Date | |
---|---|---|---|
b8fd186801 | |||
33c9464dad | |||
b16d8ce36c | |||
65ee69c645 | |||
fd054f0fa4 | |||
de1885fe8f | |||
3591bebabf |
@ -8,4 +8,10 @@ export default defineConfig({
|
|||||||
markdown: {
|
markdown: {
|
||||||
remarkPlugins: [remarkReadingTime],
|
remarkPlugins: [remarkReadingTime],
|
||||||
},
|
},
|
||||||
|
redirects: {
|
||||||
|
"/blog": {
|
||||||
|
destination: "/",
|
||||||
|
status: 301,
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
154
package-lock.json
generated
154
package-lock.json
generated
@ -14,6 +14,7 @@
|
|||||||
"astro": "^4.15.4",
|
"astro": "^4.15.4",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"cssnano": "^7.0.6",
|
"cssnano": "^7.0.6",
|
||||||
|
"cssnano-preset-advanced": "^7.0.6",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"reading-time": "^1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
@ -1633,44 +1634,43 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@shikijs/core": {
|
"node_modules/@shikijs/core": {
|
||||||
"version": "1.17.0",
|
"version": "1.17.5",
|
||||||
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.17.5.tgz",
|
||||||
"integrity": "sha512-Mkk4Mp4bNnW1kytU8I7S5PK5teNSe0iKlfqxPss4sdwnlcU8a2N62Z3te2gVmZfU9t1HF6L3wyWuM43IvEeEsg==",
|
"integrity": "sha512-JDgFZbJvfZ1g0lRVHtPTv6n2MwWnbTSGwncL/Qmlg7BZBzHCcDY2CxYGkNUm7k+lljOrFzXFGh38s8CRRZH+TQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@shikijs/engine-javascript": "1.17.0",
|
"@shikijs/engine-javascript": "1.17.5",
|
||||||
"@shikijs/engine-oniguruma": "1.17.0",
|
"@shikijs/engine-oniguruma": "1.17.5",
|
||||||
"@shikijs/types": "1.17.0",
|
"@shikijs/types": "1.17.5",
|
||||||
"@shikijs/vscode-textmate": "^9.2.2",
|
"@shikijs/vscode-textmate": "^9.2.2",
|
||||||
"@types/hast": "^3.0.4",
|
"@types/hast": "^3.0.4",
|
||||||
"hast-util-to-html": "^9.0.2"
|
"hast-util-to-html": "^9.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@shikijs/engine-javascript": {
|
"node_modules/@shikijs/engine-javascript": {
|
||||||
"version": "1.17.0",
|
"version": "1.17.5",
|
||||||
"resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.17.5.tgz",
|
||||||
"integrity": "sha512-EiBVlxmzJZdC2ypzn8k+vxLngbBNgHLS4RilwrFOABGRc72kUZubbD/6Chrq2RcVtD3yq1GtiiIdFMGd9BTX3Q==",
|
"integrity": "sha512-129knB7yGxq51i5f9ci1lsrC/9rJwo7yzOmHVjQIRk+e1C0caaSwzm4mhLJ506ui0vEmQZ9LzY6a/crW1UsReA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@shikijs/types": "1.17.0",
|
"@shikijs/types": "1.17.5",
|
||||||
"oniguruma-to-js": "0.3.3",
|
"oniguruma-to-js": "0.4.0"
|
||||||
"regex": "4.3.2"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@shikijs/engine-oniguruma": {
|
"node_modules/@shikijs/engine-oniguruma": {
|
||||||
"version": "1.17.0",
|
"version": "1.17.5",
|
||||||
"resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.17.5.tgz",
|
||||||
"integrity": "sha512-nsXzJGLQ0fhKmA4Gwt1cF7vC8VuZ1HSDrTRuj48h/qDeX/TzmOlTDXQ3uPtyuhyg/2rbZRzNhN8UFU4fSnQfXg==",
|
"integrity": "sha512-GcuDWdUcs06sCoRS/JwbcO8M55MOvirTs3wIR7E6pMoePJWgAxhIYDQHURvSrgKgyUrTl3EKwujHljivS5BJVA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@shikijs/types": "1.17.0",
|
"@shikijs/types": "1.17.5",
|
||||||
"@shikijs/vscode-textmate": "^9.2.2"
|
"@shikijs/vscode-textmate": "^9.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@shikijs/types": {
|
"node_modules/@shikijs/types": {
|
||||||
"version": "1.17.0",
|
"version": "1.17.5",
|
||||||
"resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.17.5.tgz",
|
||||||
"integrity": "sha512-Tvu2pA69lbpXB+MmgIaROP1tio8y0uYvKb5Foh3q0TJBTAJuaoa5eDEtS/0LquyveacsiVrYF4uEZILju+7Ybg==",
|
"integrity": "sha512-xDIczjZ7QB6opNrCObX/6/78Jb/BFglRPo7E7f9swd1TCabhumOLsv23103pNUOMZrJYARUkHJpEx7ryFLM3FA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@shikijs/vscode-textmate": "^9.2.2",
|
"@shikijs/vscode-textmate": "^9.2.2",
|
||||||
@ -2041,12 +2041,12 @@
|
|||||||
"license": "Python-2.0"
|
"license": "Python-2.0"
|
||||||
},
|
},
|
||||||
"node_modules/aria-query": {
|
"node_modules/aria-query": {
|
||||||
"version": "5.3.0",
|
"version": "5.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz",
|
||||||
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
"integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"engines": {
|
||||||
"dequal": "^2.0.3"
|
"node": ">= 0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/array-iterate": {
|
"node_modules/array-iterate": {
|
||||||
@ -2806,6 +2806,27 @@
|
|||||||
"postcss": "^8.4.31"
|
"postcss": "^8.4.31"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/cssnano-preset-advanced": {
|
||||||
|
"version": "7.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-7.0.6.tgz",
|
||||||
|
"integrity": "sha512-wk/YPSv965EjpPNEGteiXZ32BKilJcYNnX4EGUd/AriVGgHL/y59uaWVJ/ZDx69jCNUrmwiBzioCV+SG5wk3PQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"autoprefixer": "^10.4.20",
|
||||||
|
"browserslist": "^4.23.3",
|
||||||
|
"cssnano-preset-default": "^7.0.6",
|
||||||
|
"postcss-discard-unused": "^7.0.3",
|
||||||
|
"postcss-merge-idents": "^7.0.0",
|
||||||
|
"postcss-reduce-idents": "^7.0.0",
|
||||||
|
"postcss-zindex": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.12.0 || ^20.9.0 || >=22.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.4.31"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/cssnano-preset-default": {
|
"node_modules/cssnano-preset-default": {
|
||||||
"version": "7.0.6",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-7.0.6.tgz",
|
||||||
@ -3067,9 +3088,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.5.20",
|
"version": "1.5.21",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.20.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.21.tgz",
|
||||||
"integrity": "sha512-74mdl6Fs1HHzK9SUX4CKFxAtAe3nUns48y79TskHNAG6fGOlLfyKA4j855x+0b5u8rWJIrlaG9tcTPstMlwjIw==",
|
"integrity": "sha512-+rBAerCpQvFSPyAO677i5gJuWGO2WFsoujENdcMzsrpP7Ebcc3pmpERgU8CV4fFF10a5haP4ivnFQ/AmLICBVg==",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/emmet": {
|
"node_modules/emmet": {
|
||||||
@ -5023,10 +5044,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/oniguruma-to-js": {
|
"node_modules/oniguruma-to-js": {
|
||||||
"version": "0.3.3",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.0.tgz",
|
||||||
"integrity": "sha512-m90/WEhgs8g4BxG37+Nu3YrMfJDs2YXtYtIllhsEPR+wP3+K4EZk6dDUvy2v2K4MNFDDOYKL4/yqYPXDqyozTQ==",
|
"integrity": "sha512-GwNFPQygkpDjO9MOr54Rqi01dGS+h9VAS//Qxz9lTN5B09CxqiIc7rydvdV+Ex2Z8Vk+zqfHH7hU6ePn8uf+Mg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"regex": "^4.3.2"
|
||||||
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/antfu"
|
"url": "https://github.com/sponsors/antfu"
|
||||||
}
|
}
|
||||||
@ -5364,6 +5388,37 @@
|
|||||||
"postcss": "^8.4.31"
|
"postcss": "^8.4.31"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/postcss-discard-unused": {
|
||||||
|
"version": "7.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-7.0.3.tgz",
|
||||||
|
"integrity": "sha512-OVxIMVMjkJ1anDTbHFSYUZnmoDWv3vF5JPZvr9hi6HjMNH/RjfR39IMeLThbIjrSb9ZLcwzqziU+XxFQkgF4Vw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"postcss-selector-parser": "^6.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.12.0 || ^20.9.0 || >=22.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.4.31"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postcss-merge-idents": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-Kr+DniMg0IsW7OGoaMB1Foreb3fIE2XcExCRynogQLngkpNVKTX5GlaxyEZDBB8bISeoztFHFK/GcQtFiPTnpQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"cssnano-utils": "^5.0.0",
|
||||||
|
"postcss-value-parser": "^4.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.12.0 || ^20.9.0 || >=22.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.4.31"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/postcss-merge-longhand": {
|
"node_modules/postcss-merge-longhand": {
|
||||||
"version": "7.0.4",
|
"version": "7.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-7.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-7.0.4.tgz",
|
||||||
@ -5612,6 +5667,21 @@
|
|||||||
"postcss": "^8.4.31"
|
"postcss": "^8.4.31"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/postcss-reduce-idents": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-ghFHqxigYW/bbfr+bXSDB5Tv3qPaYZZxiQh+Gne0NYRlTOzFft1V/DUvGFVJbFkackHleSjFdVXdlNB+5f3mKg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"postcss-value-parser": "^4.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.12.0 || ^20.9.0 || >=22.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.4.31"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/postcss-reduce-initial": {
|
"node_modules/postcss-reduce-initial": {
|
||||||
"version": "7.0.2",
|
"version": "7.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-7.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-7.0.2.tgz",
|
||||||
@ -5693,6 +5763,18 @@
|
|||||||
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
|
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/postcss-zindex": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-Agp+5C0qBZxT9S4k9iO/C9oqce3gvPJ/7av4JcAsDl17vsboSN60ncTokIYDtDMlVXvwuhFED3edoy1YG5O1+g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.12.0 || ^20.9.0 || >=22.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.4.31"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/preferred-pm": {
|
"node_modules/preferred-pm": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-4.0.0.tgz",
|
||||||
@ -6240,13 +6322,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/shiki": {
|
"node_modules/shiki": {
|
||||||
"version": "1.17.0",
|
"version": "1.17.5",
|
||||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/shiki/-/shiki-1.17.5.tgz",
|
||||||
"integrity": "sha512-VZf8cPShRwfzPcaswv81+YP7qJEoFwRT+Ehy6bizim7M0zG9bk8Egug550C+xS9g7rKIOPhzAlp2uEyuCxbk/A==",
|
"integrity": "sha512-8i4+fbTlnJPUYkgBEZ92QKmK3Gr23n2YVwqwyz0e+VmXqKpJZuV6P/CY00gSGHDXXjXT5l0BLwsMfO2Pe52TLQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@shikijs/core": "1.17.0",
|
"@shikijs/core": "1.17.5",
|
||||||
"@shikijs/types": "1.17.0",
|
"@shikijs/engine-javascript": "1.17.5",
|
||||||
|
"@shikijs/engine-oniguruma": "1.17.5",
|
||||||
|
"@shikijs/types": "1.17.5",
|
||||||
"@shikijs/vscode-textmate": "^9.2.2",
|
"@shikijs/vscode-textmate": "^9.2.2",
|
||||||
"@types/hast": "^3.0.4"
|
"@types/hast": "^3.0.4"
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
"astro": "^4.15.4",
|
"astro": "^4.15.4",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"cssnano": "^7.0.6",
|
"cssnano": "^7.0.6",
|
||||||
|
"cssnano-preset-advanced": "^7.0.6",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"reading-time": "^1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
|
@ -2,7 +2,7 @@ module.exports = {
|
|||||||
plugins: [
|
plugins: [
|
||||||
require("autoprefixer"),
|
require("autoprefixer"),
|
||||||
require("cssnano")({
|
require("cssnano")({
|
||||||
preset: "default",
|
preset: "advanced",
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
17
src/components/Analytics.astro
Normal file
17
src/components/Analytics.astro
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
type Props = {
|
||||||
|
readonly title: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const path = Astro.url.pathname;
|
||||||
|
const { title } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- AppMetrix -->
|
||||||
|
<script is:inline src="https://appmetrix.com/pixel/T5X0z12SoASBV8Dv"></script>
|
||||||
|
|
||||||
|
<!-- GoatCounter -->
|
||||||
|
<script is:inline data-goatcounter="https://analytics.popov.link/count" src="//gc.zgo.at/count.js"></script>
|
||||||
|
<noscript>
|
||||||
|
<img alt="pixel" src={`https://analytics.popov.link/count?p=${encodeURI(path)}&t=${encodeURI(title)}`} />
|
||||||
|
</noscript>
|
@ -1,18 +1,18 @@
|
|||||||
---
|
---
|
||||||
type Props = {
|
type Props = {
|
||||||
readonly description?: string;
|
readonly description: string;
|
||||||
readonly title?: string;
|
readonly title: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||||
const { title, description } = Astro.props;
|
const { description, title } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
|
||||||
<meta name="description" content={description ?? import.meta.env.DEFAULT_DESCRIPTION} />
|
<meta name="description" content={description} />
|
||||||
<meta name="robots" content="index, follow" />
|
<meta name="robots" content="index, follow" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
@ -20,5 +20,5 @@ const { title, description } = Astro.props;
|
|||||||
<link href="/sitemap-index.xml" rel="sitemap" />
|
<link href="/sitemap-index.xml" rel="sitemap" />
|
||||||
<link href={canonicalURL} rel="canonical" />
|
<link href={canonicalURL} rel="canonical" />
|
||||||
|
|
||||||
<title>{title ?? import.meta.env.DEFAULT_TITLE}</title>
|
<title>{title}</title>
|
||||||
</head>
|
</head>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
line-height: 3.5em;
|
line-height: 3.5em;
|
||||||
opacity: 0.975;
|
opacity: 0.975;
|
||||||
position: fixed;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
@ -36,6 +36,7 @@
|
|||||||
@media (width <=684px) {
|
@media (width <=684px) {
|
||||||
header {
|
header {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
position: fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
@ -50,6 +51,6 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<a href="/feed.xml">RSS</a>
|
<a href="/">Home</a>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
24
src/components/Pagination.astro
Normal file
24
src/components/Pagination.astro
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
import Next from "./Pagination/Next.astro";
|
||||||
|
import Prev from "./Pagination/Prev.astro";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
readonly nextUrl?: string;
|
||||||
|
readonly prevUrl?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const { nextUrl, prevUrl } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
div {
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 3rem 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{prevUrl && <Prev url={prevUrl} />}
|
||||||
|
{nextUrl && <Next url={nextUrl} />}
|
||||||
|
</div>
|
18
src/components/Pagination/Next.astro
Normal file
18
src/components/Pagination/Next.astro
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
type Props = {
|
||||||
|
readonly url: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const { url } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
span {
|
||||||
|
float: right;
|
||||||
|
max-width: 40%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
<a href={url}>Next ></a>
|
||||||
|
</span>
|
18
src/components/Pagination/Prev.astro
Normal file
18
src/components/Pagination/Prev.astro
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
type Props = {
|
||||||
|
readonly url: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const { url } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
span {
|
||||||
|
float: left;
|
||||||
|
max-width: 40%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
<a href={url}>< Prev</a>
|
||||||
|
</span>
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
import Analytics from "../components/Analytics.astro";
|
||||||
import Head from "../components/Head.astro";
|
import Head from "../components/Head.astro";
|
||||||
import Header from "../components/Header.astro";
|
import Header from "../components/Header.astro";
|
||||||
import "../scss/global.scss";
|
import "../scss/global.scss";
|
||||||
@ -8,16 +9,20 @@ type Props = {
|
|||||||
readonly title?: string;
|
readonly title?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const { title, description } = Astro.props;
|
const { description, title } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<html lang="ru">
|
<html lang="ru">
|
||||||
<Head title={title} description={description} />
|
<Head
|
||||||
|
description={description ?? import.meta.env.DEFAULT_DESCRIPTION}
|
||||||
|
title={title ?? import.meta.env.DEFAULT_TITLE}
|
||||||
|
/>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<Header />
|
<Header />
|
||||||
<main>
|
<main>
|
||||||
<slot />
|
<slot />
|
||||||
</main>
|
</main>
|
||||||
|
<Analytics title={title ?? import.meta.env.DEFAULT_TITLE} />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
30
src/pages/[...page].astro
Normal file
30
src/pages/[...page].astro
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
import type { GetStaticPaths, InferGetStaticPropsType } from "astro";
|
||||||
|
import { getCollection } from "astro:content";
|
||||||
|
import Layout from "../layouts/BaseLayout.astro";
|
||||||
|
import Pagination from "../components/Pagination.astro";
|
||||||
|
import PostSummary from "../components/PostSummary.astro";
|
||||||
|
|
||||||
|
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
|
||||||
|
|
||||||
|
export const getStaticPaths = (async ({ paginate }) => {
|
||||||
|
const posts = await getCollection("blog");
|
||||||
|
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
|
||||||
|
|
||||||
|
return paginate(posts, {
|
||||||
|
pageSize: 5,
|
||||||
|
});
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
const { page } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<section>
|
||||||
|
{page.data.map((post) => <PostSummary post={post} />)}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<Pagination nextUrl={page.url.next} prevUrl={page.url.prev} />
|
||||||
|
</section>
|
||||||
|
</Layout>
|
@ -3,6 +3,8 @@ import { type CollectionEntry, getCollection } from "astro:content";
|
|||||||
import Comments from "../../components/Comments.astro";
|
import Comments from "../../components/Comments.astro";
|
||||||
import Layout from "../../layouts/BaseLayout.astro";
|
import Layout from "../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
|
type Props = CollectionEntry<"blog">;
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const posts = await getCollection("blog");
|
const posts = await getCollection("blog");
|
||||||
|
|
||||||
@ -12,8 +14,6 @@ export async function getStaticPaths() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
type Props = CollectionEntry<"blog">;
|
|
||||||
|
|
||||||
const post = Astro.props;
|
const post = Astro.props;
|
||||||
const { Content, remarkPluginFrontmatter } = await post.render();
|
const { Content, remarkPluginFrontmatter } = await post.render();
|
||||||
---
|
---
|
||||||
@ -24,7 +24,7 @@ const { Content, remarkPluginFrontmatter } = await post.render();
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<Layout title={post.data.title} description={post.data.description}>
|
<Layout description={post.data.description} title={post.data.title}>
|
||||||
<article>
|
<article>
|
||||||
<section class="header">
|
<section class="header">
|
||||||
<h1>{post.data.title}</h1>
|
<h1>{post.data.title}</h1>
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
import { getCollection } from "astro:content";
|
|
||||||
import Element from "../components/PostElement.astro";
|
|
||||||
import Layout from "../layouts/BaseLayout.astro";
|
|
||||||
|
|
||||||
const posts = await getCollection("blog");
|
|
||||||
---
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<section>
|
|
||||||
{posts.map((post) => <Element post={post} />)}
|
|
||||||
</section>
|
|
||||||
</Layout>
|
|
@ -35,7 +35,7 @@ body {
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
max-width: 52em;
|
max-width: 52em;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 6em 4em 4em;
|
padding: 4em;
|
||||||
text-rendering: optimizelegibility;
|
text-rendering: optimizelegibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user