mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
feat: add waline i18n & sync comments
This commit is contained in:
parent
fa148ca0c5
commit
c2ebc78045
12 changed files with 172 additions and 101 deletions
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
|
@ -60,10 +60,12 @@
|
|||
},
|
||||
"cSpell.words": [
|
||||
"antfu",
|
||||
"Artículos",
|
||||
"astrojs",
|
||||
"attributify",
|
||||
"blurhash",
|
||||
"bmoji",
|
||||
"Etiquetas",
|
||||
"Frontmatter",
|
||||
"Fuwriu",
|
||||
"GSAP",
|
||||
|
@ -86,6 +88,7 @@
|
|||
"rehype",
|
||||
"Retypeset",
|
||||
"Roundhand",
|
||||
"Sobre",
|
||||
"srcset",
|
||||
"STIX",
|
||||
"titlebar",
|
||||
|
@ -94,6 +97,9 @@
|
|||
"unpic",
|
||||
"vite",
|
||||
"waline",
|
||||
"weibo"
|
||||
"weibo",
|
||||
"Посты",
|
||||
"себе",
|
||||
"Теги"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"vite": "^6.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^4.5.1",
|
||||
"@antfu/eslint-config": "^4.6.0",
|
||||
"@types/markdown-it": "^14.1.2",
|
||||
"@types/mdast": "^4.0.4",
|
||||
"@types/node": "^22.13.9",
|
||||
|
|
148
pnpm-lock.yaml
generated
148
pnpm-lock.yaml
generated
|
@ -94,8 +94,8 @@ importers:
|
|||
version: 6.2.0(@types/node@22.13.9)(jiti@2.4.2)(lightningcss@1.28.2)(terser@5.37.0)(yaml@2.7.0)
|
||||
devDependencies:
|
||||
'@antfu/eslint-config':
|
||||
specifier: ^4.5.1
|
||||
version: 4.5.1(@typescript-eslint/utils@8.26.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@unocss/eslint-plugin@66.1.0-beta.3(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.1)(eslint-plugin-astro@1.3.1(eslint@9.21.0(jiti@2.4.2)))(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
specifier: ^4.6.0
|
||||
version: 4.6.0(@typescript-eslint/utils@8.26.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@unocss/eslint-plugin@66.1.0-beta.3(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.1)(eslint-plugin-astro@1.3.1(eslint@9.21.0(jiti@2.4.2)))(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
'@types/markdown-it':
|
||||
specifier: ^14.1.2
|
||||
version: 14.1.2
|
||||
|
@ -151,8 +151,8 @@ packages:
|
|||
resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
|
||||
'@antfu/eslint-config@4.5.1':
|
||||
resolution: {integrity: sha512-R/B0sdCELWX3LpB7oHtSiL5KWHke/7QyUCWUuag7U6GzyYJuLubmEHxXQg6/Wp8LoDX7MkvL7FdnKUUnOrcySQ==}
|
||||
'@antfu/eslint-config@4.6.0':
|
||||
resolution: {integrity: sha512-uLfrbSQkIJZEiDWNVYaS0KENDecRujEos9LabmRvpCuZFGDcGkfTosZel3nnKjdc/2FX3bd6SSOdiaJuAKCw+Q==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@eslint-react/eslint-plugin': ^1.19.0
|
||||
|
@ -510,8 +510,8 @@ packages:
|
|||
resolution: {integrity: sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@eslint/markdown@6.2.2':
|
||||
resolution: {integrity: sha512-U0/KgzI9BVUuHDQ9M2fuVgB0QZ1fSyzwm8jKmHr1dlsLHGHYzoeIA9yqLMdTbV3ivZfp6rTdt6zqre3TfNExUQ==}
|
||||
'@eslint/markdown@6.3.0':
|
||||
resolution: {integrity: sha512-8rj7wmuP5hwXZ0HWoad+WL9nftpN373bCCQz9QL6sA+clZiz7et8Pk0yDAKeo//xLlPONKQ6wCpjkOHCLkbYUw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@eslint/object-schema@2.1.6':
|
||||
|
@ -1093,25 +1093,25 @@ packages:
|
|||
vitest:
|
||||
optional: true
|
||||
|
||||
'@volar/kit@2.4.11':
|
||||
resolution: {integrity: sha512-ups5RKbMzMCr6RKafcCqDRnJhJDNWqo2vfekwOAj6psZ15v5TlcQFQAyokQJ3wZxVkzxrQM+TqTRDENfQEXpmA==}
|
||||
'@volar/kit@2.4.12':
|
||||
resolution: {integrity: sha512-f9JE8oy9C2rBcCWxUYKUF23hOXz4mwgVXFjk7nHhxzplaoVjEOsKpBm8NI2nBH7Cwu8DRxDwBsbIxMl/8wlLxw==}
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
|
||||
'@volar/language-core@2.4.11':
|
||||
resolution: {integrity: sha512-lN2C1+ByfW9/JRPpqScuZt/4OrUUse57GLI6TbLgTIqBVemdl1wNcZ1qYGEo2+Gw8coYLgCy7SuKqn6IrQcQgg==}
|
||||
'@volar/language-core@2.4.12':
|
||||
resolution: {integrity: sha512-RLrFdXEaQBWfSnYGVxvR2WrO6Bub0unkdHYIdC31HzIEqATIuuhRRzYu76iGPZ6OtA4Au1SnW0ZwIqPP217YhA==}
|
||||
|
||||
'@volar/language-server@2.4.11':
|
||||
resolution: {integrity: sha512-W9P8glH1M8LGREJ7yHRCANI5vOvTrRO15EMLdmh5WNF9sZYSEbQxiHKckZhvGIkbeR1WAlTl3ORTrJXUghjk7g==}
|
||||
'@volar/language-server@2.4.12':
|
||||
resolution: {integrity: sha512-KC0YqTXCZMaImMWyAKC+dLB2BXjfz80kqesJkV6oXxJsGEQPfmdqug299idwtrT6FVSmZ7q5UrPfvgKwA0S3JA==}
|
||||
|
||||
'@volar/language-service@2.4.11':
|
||||
resolution: {integrity: sha512-KIb6g8gjUkS2LzAJ9bJCLIjfsJjeRtmXlu7b2pDFGD3fNqdbC53cCAKzgWDs64xtQVKYBU13DLWbtSNFtGuMLQ==}
|
||||
'@volar/language-service@2.4.12':
|
||||
resolution: {integrity: sha512-nifOPGYYPnCmxja6/ML/Gl2EgFkUdw4gLbYqbh8FjqX3gSpXSZl/0ebqORjKo1KW56YWHWRZd1jFutEtCiRYhA==}
|
||||
|
||||
'@volar/source-map@2.4.11':
|
||||
resolution: {integrity: sha512-ZQpmafIGvaZMn/8iuvCFGrW3smeqkq/IIh9F1SdSx9aUl0J4Iurzd6/FhmjNO5g2ejF3rT45dKskgXWiofqlZQ==}
|
||||
'@volar/source-map@2.4.12':
|
||||
resolution: {integrity: sha512-bUFIKvn2U0AWojOaqf63ER0N/iHIBYZPpNGogfLPQ68F5Eet6FnLlyho7BS0y2HJ1jFhSif7AcuTx1TqsCzRzw==}
|
||||
|
||||
'@volar/typescript@2.4.11':
|
||||
resolution: {integrity: sha512-2DT+Tdh88Spp5PyPbqhyoYavYCPDsqbHLFwcUI9K1NlY1YgUJvujGdrqUp0zWxnW7KWNTr3xSpMuv2WnaTKDAw==}
|
||||
'@volar/typescript@2.4.12':
|
||||
resolution: {integrity: sha512-HJB73OTJDgPc80K30wxi3if4fSsZZAOScbj2fcicMuOPoOkcf9NNAINb33o+DzhBdF9xTKC1gnPmIRDous5S0g==}
|
||||
|
||||
'@vscode/emmet-helper@2.11.0':
|
||||
resolution: {integrity: sha512-QLxjQR3imPZPQltfbWRnHU6JecWTF1QSWhx3GAKQpslx7y3Dp6sIIXhKjiUJ/BR9FX8PVthjr9PD6pNwOJfAzw==}
|
||||
|
@ -1755,6 +1755,11 @@ packages:
|
|||
peerDependencies:
|
||||
eslint: '>=8.0.0'
|
||||
|
||||
eslint-plugin-pnpm-catalogs@0.1.0:
|
||||
resolution: {integrity: sha512-4FzIfTfr06U3ULStgSMSmpDsfhtxsbSAxKLvXLo+/i/z48v4+4WD0Yr5hTb6E37X/ch8isKiTl4bnnvSENTYFA==}
|
||||
peerDependencies:
|
||||
eslint: ^9.0.0
|
||||
|
||||
eslint-plugin-regexp@2.7.0:
|
||||
resolution: {integrity: sha512-U8oZI77SBtH8U3ulZ05iu0qEzIizyEDXd+BWHvyVxTOjGwcDcvy/kEpgFG4DYca2ByRLiVPFZ2GeH7j1pdvZTA==}
|
||||
engines: {node: ^18 || >=20}
|
||||
|
@ -2850,6 +2855,9 @@ packages:
|
|||
resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
pnpm-catalogs-utils@0.1.0:
|
||||
resolution: {integrity: sha512-avysWJc452htYTnae14ENYTI3fSzZ1U1xNrdSJ2kFgwDaDvdEKIM5Iu+WljP2cdr/HAKKQ1hnuvu3sQJ3Eq/zQ==}
|
||||
|
||||
postcss-selector-parser@6.1.2:
|
||||
resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==}
|
||||
engines: {node: '>=4'}
|
||||
|
@ -3761,8 +3769,8 @@ packages:
|
|||
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
yocto-queue@1.1.1:
|
||||
resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==}
|
||||
yocto-queue@1.2.0:
|
||||
resolution: {integrity: sha512-KHBC7z61OJeaMGnF3wqNZj+GGNXOyypZviiKpQeiHirG5Ib1ImwcLBH70rbMSkKfSmUNBsdf2PwaEJtKvgmkNw==}
|
||||
engines: {node: '>=12.20'}
|
||||
|
||||
yocto-spinner@0.2.1:
|
||||
|
@ -3797,12 +3805,12 @@ snapshots:
|
|||
'@jridgewell/gen-mapping': 0.3.8
|
||||
'@jridgewell/trace-mapping': 0.3.25
|
||||
|
||||
'@antfu/eslint-config@4.5.1(@typescript-eslint/utils@8.26.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@unocss/eslint-plugin@66.1.0-beta.3(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.1)(eslint-plugin-astro@1.3.1(eslint@9.21.0(jiti@2.4.2)))(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)':
|
||||
'@antfu/eslint-config@4.6.0(@typescript-eslint/utils@8.26.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@unocss/eslint-plugin@66.1.0-beta.3(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.1)(eslint-plugin-astro@1.3.1(eslint@9.21.0(jiti@2.4.2)))(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)':
|
||||
dependencies:
|
||||
'@antfu/install-pkg': 1.0.0
|
||||
'@clack/prompts': 0.10.0
|
||||
'@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.21.0(jiti@2.4.2))
|
||||
'@eslint/markdown': 6.2.2
|
||||
'@eslint/markdown': 6.3.0
|
||||
'@stylistic/eslint-plugin': 4.2.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
'@typescript-eslint/eslint-plugin': 8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
'@typescript-eslint/parser': 8.26.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
|
@ -3821,6 +3829,7 @@ snapshots:
|
|||
eslint-plugin-n: 17.16.2(eslint@9.21.0(jiti@2.4.2))
|
||||
eslint-plugin-no-only-tests: 3.3.0
|
||||
eslint-plugin-perfectionist: 4.9.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2)
|
||||
eslint-plugin-pnpm-catalogs: 0.1.0(eslint@9.21.0(jiti@2.4.2))
|
||||
eslint-plugin-regexp: 2.7.0(eslint@9.21.0(jiti@2.4.2))
|
||||
eslint-plugin-toml: 0.12.0(eslint@9.21.0(jiti@2.4.2))
|
||||
eslint-plugin-unicorn: 57.0.0(eslint@9.21.0(jiti@2.4.2))
|
||||
|
@ -3874,19 +3883,19 @@ snapshots:
|
|||
'@astrojs/compiler': 2.10.4
|
||||
'@astrojs/yaml2ts': 0.2.2
|
||||
'@jridgewell/sourcemap-codec': 1.5.0
|
||||
'@volar/kit': 2.4.11(typescript@5.8.2)
|
||||
'@volar/language-core': 2.4.11
|
||||
'@volar/language-server': 2.4.11
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/kit': 2.4.12(typescript@5.8.2)
|
||||
'@volar/language-core': 2.4.12
|
||||
'@volar/language-server': 2.4.12
|
||||
'@volar/language-service': 2.4.12
|
||||
fast-glob: 3.3.3
|
||||
muggle-string: 0.4.1
|
||||
volar-service-css: 0.0.62(@volar/language-service@2.4.11)
|
||||
volar-service-emmet: 0.0.62(@volar/language-service@2.4.11)
|
||||
volar-service-html: 0.0.62(@volar/language-service@2.4.11)
|
||||
volar-service-prettier: 0.0.62(@volar/language-service@2.4.11)
|
||||
volar-service-typescript: 0.0.62(@volar/language-service@2.4.11)
|
||||
volar-service-typescript-twoslash-queries: 0.0.62(@volar/language-service@2.4.11)
|
||||
volar-service-yaml: 0.0.62(@volar/language-service@2.4.11)
|
||||
volar-service-css: 0.0.62(@volar/language-service@2.4.12)
|
||||
volar-service-emmet: 0.0.62(@volar/language-service@2.4.12)
|
||||
volar-service-html: 0.0.62(@volar/language-service@2.4.12)
|
||||
volar-service-prettier: 0.0.62(@volar/language-service@2.4.12)
|
||||
volar-service-typescript: 0.0.62(@volar/language-service@2.4.12)
|
||||
volar-service-typescript-twoslash-queries: 0.0.62(@volar/language-service@2.4.12)
|
||||
volar-service-yaml: 0.0.62(@volar/language-service@2.4.12)
|
||||
vscode-html-languageservice: 5.3.1
|
||||
vscode-uri: 3.1.0
|
||||
transitivePeerDependencies:
|
||||
|
@ -4170,7 +4179,7 @@ snapshots:
|
|||
|
||||
'@eslint/js@9.21.0': {}
|
||||
|
||||
'@eslint/markdown@6.2.2':
|
||||
'@eslint/markdown@6.3.0':
|
||||
dependencies:
|
||||
'@eslint/core': 0.10.0
|
||||
'@eslint/plugin-kit': 0.2.7
|
||||
|
@ -4829,24 +4838,24 @@ snapshots:
|
|||
optionalDependencies:
|
||||
typescript: 5.8.2
|
||||
|
||||
'@volar/kit@2.4.11(typescript@5.8.2)':
|
||||
'@volar/kit@2.4.12(typescript@5.8.2)':
|
||||
dependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/typescript': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
'@volar/typescript': 2.4.12
|
||||
typesafe-path: 0.2.2
|
||||
typescript: 5.8.2
|
||||
vscode-languageserver-textdocument: 1.0.12
|
||||
vscode-uri: 3.1.0
|
||||
|
||||
'@volar/language-core@2.4.11':
|
||||
'@volar/language-core@2.4.12':
|
||||
dependencies:
|
||||
'@volar/source-map': 2.4.11
|
||||
'@volar/source-map': 2.4.12
|
||||
|
||||
'@volar/language-server@2.4.11':
|
||||
'@volar/language-server@2.4.12':
|
||||
dependencies:
|
||||
'@volar/language-core': 2.4.11
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/typescript': 2.4.11
|
||||
'@volar/language-core': 2.4.12
|
||||
'@volar/language-service': 2.4.12
|
||||
'@volar/typescript': 2.4.12
|
||||
path-browserify: 1.0.1
|
||||
request-light: 0.7.0
|
||||
vscode-languageserver: 9.0.1
|
||||
|
@ -4854,18 +4863,18 @@ snapshots:
|
|||
vscode-languageserver-textdocument: 1.0.12
|
||||
vscode-uri: 3.1.0
|
||||
|
||||
'@volar/language-service@2.4.11':
|
||||
'@volar/language-service@2.4.12':
|
||||
dependencies:
|
||||
'@volar/language-core': 2.4.11
|
||||
'@volar/language-core': 2.4.12
|
||||
vscode-languageserver-protocol: 3.17.5
|
||||
vscode-languageserver-textdocument: 1.0.12
|
||||
vscode-uri: 3.1.0
|
||||
|
||||
'@volar/source-map@2.4.11': {}
|
||||
'@volar/source-map@2.4.12': {}
|
||||
|
||||
'@volar/typescript@2.4.11':
|
||||
'@volar/typescript@2.4.12':
|
||||
dependencies:
|
||||
'@volar/language-core': 2.4.11
|
||||
'@volar/language-core': 2.4.12
|
||||
path-browserify: 1.0.1
|
||||
vscode-uri: 3.1.0
|
||||
|
||||
|
@ -5711,6 +5720,13 @@ snapshots:
|
|||
- supports-color
|
||||
- typescript
|
||||
|
||||
eslint-plugin-pnpm-catalogs@0.1.0(eslint@9.21.0(jiti@2.4.2)):
|
||||
dependencies:
|
||||
eslint: 9.21.0(jiti@2.4.2)
|
||||
find-up-simple: 1.0.1
|
||||
jsonc-eslint-parser: 2.4.0
|
||||
pnpm-catalogs-utils: 0.1.0
|
||||
|
||||
eslint-plugin-regexp@2.7.0(eslint@9.21.0(jiti@2.4.2)):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.4.1(eslint@9.21.0(jiti@2.4.2))
|
||||
|
@ -7100,7 +7116,7 @@ snapshots:
|
|||
|
||||
p-limit@6.2.0:
|
||||
dependencies:
|
||||
yocto-queue: 1.1.1
|
||||
yocto-queue: 1.2.0
|
||||
|
||||
p-locate@4.1.0:
|
||||
dependencies:
|
||||
|
@ -7221,6 +7237,10 @@ snapshots:
|
|||
|
||||
pluralize@8.0.0: {}
|
||||
|
||||
pnpm-catalogs-utils@0.1.0:
|
||||
dependencies:
|
||||
yaml: 2.7.0
|
||||
|
||||
postcss-selector-parser@6.1.2:
|
||||
dependencies:
|
||||
cssesc: 3.0.0
|
||||
|
@ -8053,44 +8073,44 @@ snapshots:
|
|||
optionalDependencies:
|
||||
vite: 6.2.0(@types/node@22.13.9)(jiti@2.4.2)(lightningcss@1.28.2)(terser@5.37.0)(yaml@2.7.0)
|
||||
|
||||
volar-service-css@0.0.62(@volar/language-service@2.4.11):
|
||||
volar-service-css@0.0.62(@volar/language-service@2.4.12):
|
||||
dependencies:
|
||||
vscode-css-languageservice: 6.3.2
|
||||
vscode-languageserver-textdocument: 1.0.12
|
||||
vscode-uri: 3.1.0
|
||||
optionalDependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
|
||||
volar-service-emmet@0.0.62(@volar/language-service@2.4.11):
|
||||
volar-service-emmet@0.0.62(@volar/language-service@2.4.12):
|
||||
dependencies:
|
||||
'@emmetio/css-parser': 0.4.0
|
||||
'@emmetio/html-matcher': 1.3.0
|
||||
'@vscode/emmet-helper': 2.11.0
|
||||
vscode-uri: 3.1.0
|
||||
optionalDependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
|
||||
volar-service-html@0.0.62(@volar/language-service@2.4.11):
|
||||
volar-service-html@0.0.62(@volar/language-service@2.4.12):
|
||||
dependencies:
|
||||
vscode-html-languageservice: 5.3.1
|
||||
vscode-languageserver-textdocument: 1.0.12
|
||||
vscode-uri: 3.1.0
|
||||
optionalDependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
|
||||
volar-service-prettier@0.0.62(@volar/language-service@2.4.11):
|
||||
volar-service-prettier@0.0.62(@volar/language-service@2.4.12):
|
||||
dependencies:
|
||||
vscode-uri: 3.1.0
|
||||
optionalDependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
|
||||
volar-service-typescript-twoslash-queries@0.0.62(@volar/language-service@2.4.11):
|
||||
volar-service-typescript-twoslash-queries@0.0.62(@volar/language-service@2.4.12):
|
||||
dependencies:
|
||||
vscode-uri: 3.1.0
|
||||
optionalDependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
|
||||
volar-service-typescript@0.0.62(@volar/language-service@2.4.11):
|
||||
volar-service-typescript@0.0.62(@volar/language-service@2.4.12):
|
||||
dependencies:
|
||||
path-browserify: 1.0.1
|
||||
semver: 7.7.1
|
||||
|
@ -8099,14 +8119,14 @@ snapshots:
|
|||
vscode-nls: 5.2.0
|
||||
vscode-uri: 3.1.0
|
||||
optionalDependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
|
||||
volar-service-yaml@0.0.62(@volar/language-service@2.4.11):
|
||||
volar-service-yaml@0.0.62(@volar/language-service@2.4.12):
|
||||
dependencies:
|
||||
vscode-uri: 3.1.0
|
||||
yaml-language-server: 1.15.0
|
||||
optionalDependencies:
|
||||
'@volar/language-service': 2.4.11
|
||||
'@volar/language-service': 2.4.12
|
||||
|
||||
vscode-css-languageservice@6.3.2:
|
||||
dependencies:
|
||||
|
@ -8263,7 +8283,7 @@ snapshots:
|
|||
|
||||
yocto-queue@0.1.0: {}
|
||||
|
||||
yocto-queue@1.1.1: {}
|
||||
yocto-queue@1.2.0: {}
|
||||
|
||||
yocto-spinner@0.2.1:
|
||||
dependencies:
|
||||
|
|
|
@ -59,6 +59,6 @@ function setupThemeToggle() {
|
|||
}
|
||||
|
||||
// Initialize click event (on first load or page transition)
|
||||
document.addEventListener('astro:after-swap', setupThemeToggle)
|
||||
setupThemeToggle()
|
||||
document.addEventListener('astro:after-swap', setupThemeToggle)
|
||||
</script>
|
||||
|
|
|
@ -1,37 +1,48 @@
|
|||
---
|
||||
import { themeConfig } from '@/config'
|
||||
import { getWalineLang } from '@/utils/ui'
|
||||
|
||||
const {
|
||||
serverURL = '',
|
||||
emoji = [],
|
||||
searchGif = false,
|
||||
search = false,
|
||||
imageUploader = false,
|
||||
} = themeConfig.comment?.waline ?? {}
|
||||
---
|
||||
{serverURL && (
|
||||
<>
|
||||
<link rel="stylesheet" href="https://unpkg.com/@waline/client@v3/dist/waline.css" />
|
||||
<div id="waline"></div>
|
||||
<script
|
||||
is:inline
|
||||
type="module"
|
||||
define:vars={{ serverURL, emoji, searchGif, imageUploader }}
|
||||
>
|
||||
import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js'
|
||||
|
||||
init({
|
||||
el: '#waline',
|
||||
serverURL,
|
||||
lang: 'zh',
|
||||
emoji,
|
||||
dark: 'auto',
|
||||
requiredMeta: ['nick'],
|
||||
imageUploader: false,
|
||||
highlighter: false,
|
||||
texRenderer: false,
|
||||
search: searchGif,
|
||||
reaction: false,
|
||||
})
|
||||
</script>
|
||||
</>
|
||||
)}
|
||||
const currentPath = Astro.url.pathname
|
||||
const defaultLocale = themeConfig.global.locale
|
||||
const walineLang = getWalineLang(currentPath, defaultLocale)
|
||||
|
||||
const walineConfigJson = JSON.stringify({
|
||||
serverURL,
|
||||
lang: walineLang,
|
||||
emoji,
|
||||
search,
|
||||
imageUploader,
|
||||
});
|
||||
---
|
||||
<div id="waline" data-config={walineConfigJson}></div>
|
||||
|
||||
<script>
|
||||
import { init } from '@waline/client'
|
||||
import '@waline/client/style'
|
||||
|
||||
function initWaline() {
|
||||
const walineEl = document.getElementById('waline')
|
||||
const walineConfig = JSON.parse(walineEl?.dataset.config || '{}')
|
||||
|
||||
init({
|
||||
el: '#waline',
|
||||
path: window.location.pathname.replace(/^\/([a-z]{2}(-[a-z]{2})?)\//, '/'),
|
||||
dark: 'auto',
|
||||
requiredMeta: ['nick'],
|
||||
highlighter: false,
|
||||
texRenderer: false,
|
||||
reaction: [],
|
||||
...walineConfig,
|
||||
})
|
||||
}
|
||||
|
||||
initWaline()
|
||||
document.addEventListener('astro:after-swap', initWaline)
|
||||
</script>
|
||||
|
|
0
src/components/Comments/index.astro
Normal file
0
src/components/Comments/index.astro
Normal file
|
@ -26,8 +26,8 @@ function initScrollbar() {
|
|||
}
|
||||
}
|
||||
|
||||
document.addEventListener('astro:after-swap', initScrollbar)
|
||||
initScrollbar()
|
||||
document.addEventListener('astro:after-swap', initScrollbar)
|
||||
</script>
|
||||
|
||||
<style is:global>
|
||||
|
|
|
@ -43,9 +43,13 @@ export const themeConfig: ThemeConfig = {
|
|||
comment: {
|
||||
waline: {
|
||||
serverURL: 'https://comment.radishzz.cc', // Waline server URL
|
||||
emoji: ['https://unpkg.com/@waline/emojis@1.2.0/tw-emoji'], // see more at https://waline.js.org/en/guide/features/emoji.html
|
||||
searchGif: false, // whether to enable GIF search
|
||||
imageUploader: false, // whether to enable image uploader
|
||||
emoji: [
|
||||
'https://unpkg.com/@waline/emojis@1.2.0/tw-emoji',
|
||||
// 'https://unpkg.com/@waline/emojis@1.2.0/bmoji',
|
||||
// see more at https://waline.js.org/en/guide/features/emoji.html
|
||||
],
|
||||
search: false, // whether to enable GIF search
|
||||
imageUploader: false, // whether to enable image uploader. BUG:
|
||||
},
|
||||
},
|
||||
// COMMENT SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
import Waline from '@/components/Comments/Waline.astro'
|
||||
import Layout from '@/layouts/Layout.astro'
|
||||
import { checkSlugDuplication } from '@/utils/content'
|
||||
import { generateMultiLangPostPaths } from '@/utils/i18n'
|
||||
|
@ -28,4 +29,5 @@ const { Content, remarkPluginFrontmatter } = await post.render()
|
|||
</time>
|
||||
<Content />
|
||||
</article>
|
||||
<Waline />
|
||||
</Layout>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
import Waline from '@/components/Comments/Waline.astro'
|
||||
import Layout from '@/layouts/Layout.astro'
|
||||
import { checkSlugDuplication } from '@/utils/content'
|
||||
import { generatePostPaths } from '@/utils/i18n'
|
||||
import { getCollection } from 'astro:content'
|
||||
import Waline from '@/components/Comments/Waline.astro'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('posts')
|
||||
|
|
2
src/types/index.d.ts
vendored
2
src/types/index.d.ts
vendored
|
@ -40,7 +40,7 @@ export interface ThemeConfig {
|
|||
waline?: {
|
||||
serverURL?: string
|
||||
emoji?: string[]
|
||||
searchGif?: boolean
|
||||
search?: boolean
|
||||
imageUploader?: boolean
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,18 @@ export const langMap: Record<string, string[]> = {
|
|||
'es': ['es-ES'],
|
||||
'ru': ['ru-RU'],
|
||||
}
|
||||
|
||||
// Waline Language Map
|
||||
// see more at https://waline.js.org/guide/i18n.html
|
||||
export const walineLocaleMap: Record<string, string> = {
|
||||
'zh': 'zh-CN',
|
||||
'zh-tw': 'zh-TW',
|
||||
'ja': 'jp-JP', // Waline uses jp-JP not ja-JP
|
||||
'en': 'en-US',
|
||||
'es': 'es-ES',
|
||||
'ru': 'ru-RU',
|
||||
}
|
||||
|
||||
// Standard Language Code
|
||||
export const langCode = Object.values(langMap).flat()
|
||||
// Abbreviated Language Code
|
||||
|
@ -44,3 +56,19 @@ export const ui = {
|
|||
about: 'О себе',
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the language code of Waline
|
||||
* @param currentPath Current page path
|
||||
* @param defaultLocale Default language
|
||||
* @returns Corresponding Waline language code
|
||||
*/
|
||||
export function getWalineLang(currentPath: string, defaultLocale: string): string {
|
||||
// Extract language code from path
|
||||
const pathLang = Object.keys(walineLocaleMap).find(code =>
|
||||
currentPath.startsWith(`/${code}/`),
|
||||
)
|
||||
// Return found path language or default language
|
||||
const lang = pathLang || defaultLocale
|
||||
return walineLocaleMap[lang as keyof typeof walineLocaleMap]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue