Compare commits

..

3 Commits

Author SHA1 Message Date
Nhat
13ff64db97 feat(i18n): update Vietnamese translations (#2228)
Some checks failed
Build and Test / build-and-test (ubuntu-latest) (push) Has been skipped
Build and Test / publish-tag (push) Has been skipped
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
* feat(i18n): update Vietnamese translations

* Apply suggestion from @aarnphm

Co-authored-by: Aaron Pham <contact@aarnphm.xyz>

---------

Co-authored-by: Aaron Pham <contact@aarnphm.xyz>
2025-11-29 13:31:17 -05:00
Adam Laycock
87f7f4804e Prevent double-loading of afterDOMReady scripts (#2213)
Some checks failed
Build and Test / build-and-test (ubuntu-latest) (push) Has been skipped
Build and Test / publish-tag (push) Has been skipped
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Co-authored-by: Adam <adam@canny.io>
2025-11-27 14:51:56 -08:00
dependabot[bot]
c99c8070f2 chore(deps): bump the production-dependencies group across 1 directory with 7 updates (#2210)
Bumps the production-dependencies group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [globby](https://github.com/sindresorhus/globby) | `15.0.0` | `16.0.0` |
| [js-yaml](https://github.com/nodeca/js-yaml) | `4.1.0` | `4.1.1` |
| [pixi.js](https://github.com/pixijs/pixijs) | `8.14.0` | `8.14.1` |
| [sharp](https://github.com/lovell/sharp) | `0.34.4` | `0.34.5` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `24.10.0` | `24.10.1` |
| [@types/yargs](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/yargs) | `17.0.34` | `17.0.35` |
| [esbuild](https://github.com/evanw/esbuild) | `0.25.12` | `0.27.0` |



Updates `globby` from 15.0.0 to 16.0.0
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v15.0.0...v16.0.0)

Updates `js-yaml` from 4.1.0 to 4.1.1
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

Updates `pixi.js` from 8.14.0 to 8.14.1
- [Release notes](https://github.com/pixijs/pixijs/releases)
- [Commits](https://github.com/pixijs/pixijs/compare/v8.14.0...v8.14.1)

Updates `sharp` from 0.34.4 to 0.34.5
- [Release notes](https://github.com/lovell/sharp/releases)
- [Commits](https://github.com/lovell/sharp/compare/v0.34.4...v0.34.5)

Updates `@types/node` from 24.10.0 to 24.10.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@types/yargs` from 17.0.34 to 17.0.35
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/yargs)

Updates `esbuild` from 0.25.12 to 0.27.0
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.12...v0.27.0)

---
updated-dependencies:
- dependency-name: globby
  dependency-version: 16.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: production-dependencies
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: pixi.js
  dependency-version: 8.14.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: sharp
  dependency-version: 0.34.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@types/node"
  dependency-version: 24.10.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@types/yargs"
  dependency-version: 17.0.35
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: esbuild
  dependency-version: 0.27.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-20 13:47:47 -05:00
6 changed files with 844 additions and 342 deletions

1083
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -48,20 +48,20 @@
"esbuild-sass-plugin": "^3.3.1",
"flexsearch": "^0.8.205",
"github-slugger": "^2.0.0",
"globby": "^15.0.0",
"globby": "^16.0.0",
"gray-matter": "^4.0.3",
"hast-util-to-html": "^9.0.5",
"hast-util-to-jsx-runtime": "^2.3.6",
"hast-util-to-string": "^3.0.1",
"is-absolute-url": "^5.0.0",
"js-yaml": "^4.1.0",
"js-yaml": "^4.1.1",
"lightningcss": "^1.30.2",
"mdast-util-find-and-replace": "^3.0.2",
"mdast-util-to-hast": "^13.2.0",
"mdast-util-to-string": "^4.0.0",
"micromorph": "^0.4.5",
"minimatch": "^10.1.1",
"pixi.js": "^8.14.0",
"pixi.js": "^8.14.1",
"preact": "^10.27.2",
"preact-render-to-string": "^6.6.3",
"pretty-bytes": "^7.1.0",
@@ -85,7 +85,7 @@
"rfdc": "^1.4.1",
"satori": "^0.18.3",
"serve-handler": "^6.1.6",
"sharp": "^0.34.4",
"sharp": "^0.34.5",
"shiki": "^1.26.2",
"source-map-support": "^0.5.21",
"to-vfile": "^8.0.0",
@@ -101,12 +101,12 @@
"@types/d3": "^7.4.3",
"@types/hast": "^3.0.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^24.10.0",
"@types/node": "^24.10.1",
"@types/pretty-time": "^1.1.5",
"@types/source-map-support": "^0.5.10",
"@types/ws": "^8.18.1",
"@types/yargs": "^17.0.34",
"esbuild": "^0.25.12",
"@types/yargs": "^17.0.35",
"esbuild": "^0.27.0",
"prettier": "^3.6.2",
"tsx": "^4.20.6",
"typescript": "^5.9.3"

View File

@@ -294,7 +294,7 @@ export function renderPage(
</body>
{pageResources.js
.filter((resource) => resource.loadTime === "afterDOMReady")
.map((res) => JSResourceToScriptElement(res))}
.map((res) => JSResourceToScriptElement(res, true))}
</html>
)

View File

@@ -115,9 +115,9 @@ async function _navigate(url: URL, isBack: boolean = false) {
}
// now, patch head, re-executing scripts
const elementsToRemove = document.head.querySelectorAll(":not([spa-preserve])")
const elementsToRemove = document.head.querySelectorAll(":not([data-persist])")
elementsToRemove.forEach((el) => el.remove())
const elementsToAdd = html.head.querySelectorAll(":not([spa-preserve])")
const elementsToAdd = html.head.querySelectorAll(":not([data-persist])")
elementsToAdd.forEach((el) => document.head.appendChild(el))
// delay setting the url until now

View File

@@ -3,85 +3,83 @@ import { Translation } from "./definition"
export default {
propertyDefaults: {
title: "Không có tiêu đề",
description: "Không có mô tả được cung cấp",
description: "Không có mô tả",
},
components: {
callout: {
note: "Ghi Chú",
abstract: "Tóm Tắt",
note: "Ghi chú",
abstract: "Tổng quan",
info: "Thông tin",
todo: "Cần Làm",
tip: "Gợi Ý",
success: "Thành Công",
question: "Nghi Vấn",
warning: "Cảnh Báo",
failure: "Thất Bại",
danger: "Nguy Hiểm",
todo: "Cần phải làm",
tip: "Gợi ý",
success: "Thành công",
question: "Câu hỏi",
warning: "Cảnh báo",
failure: "Thất bại",
danger: "Nguy hiểm",
bug: "Lỗi",
example: "Ví Dụ",
quote: "Trích Dẫn",
example: "Ví dụ",
quote: "Trích dẫn",
},
backlinks: {
title: "Liên Kết Ngược",
noBacklinksFound: "Không có liên kết ngược được tìm thấy",
title: "Liên kết ngược",
noBacklinksFound: "Không có liên kết ngược nào",
},
themeToggle: {
lightMode: "Sáng",
darkMode: "Tối",
lightMode: "Chế độ sáng",
darkMode: "Chế độ tối",
},
readerMode: {
title: "Chế độ đọc",
},
explorer: {
title: "Trong bài này",
title: "Nội dung",
},
footer: {
createdWith: "Được tạo bởi",
createdWith: "Được tạo bằng",
},
graph: {
title: "Biểu Đồ",
title: "Sơ đồ",
},
recentNotes: {
title: "Bài viết gần đây",
seeRemainingMore: ({ remaining }) => `Xem ${remaining} thêm`,
title: "Ghi chú gần đây",
seeRemainingMore: ({ remaining }) => `Xem thêm ${remaining} ghi chú`,
},
transcludes: {
transcludeOf: ({ targetSlug }) => `Bao gồm ${targetSlug}`,
linkToOriginal: "Liên Kết Gốc",
transcludeOf: ({ targetSlug }) => `Trích dẫn toàn bộ từ ${targetSlug}`,
linkToOriginal: "Xem trang gốc",
},
search: {
title: "Tìm Kiếm",
title: "Tìm",
searchBarPlaceholder: "Tìm kiếm thông tin",
},
tableOfContents: {
title: "Bảng Nội Dung",
title: "Mục lục",
},
contentMeta: {
readingTime: ({ minutes }) => `đọc ${minutes} phút`,
readingTime: ({ minutes }) => `${minutes} phút đọc`,
},
},
pages: {
rss: {
recentNotes: "Những bài gần đây",
lastFewNotes: ({ count }) => `${count} Bài gần đây`,
recentNotes: "Ghi chú gần đây",
lastFewNotes: ({ count }) => `${count} Trang gần đây`,
},
error: {
title: "Không Tìm Thấy",
notFound: "Trang này được bảo mật hoặc không tồn tại.",
home: "Trở về trang chủ",
title: "Không tìm thấy",
notFound: "Trang này riêng tư hoặc không tồn tại.",
home: "Về trang chủ",
},
folderContent: {
folder: "Thư Mục",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 mục trong thư mục này." : `${count} mục trong thư mục này.`,
folder: "Thư mục",
itemsUnderFolder: ({ count }) => `${count} trang trong thư mục này.`,
},
tagContent: {
tag: "Thẻ",
tagIndex: "Thẻ Mục Lục",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 mục gắn thẻ này." : `${count} mục gắn thẻ này.`,
showingFirst: ({ count }) => `Hiển thị trước ${count} thẻ.`,
totalTags: ({ count }) => `Tìm thấy ${count} thẻ tổng cộng.`,
tagIndex: "Danh sách thẻ",
itemsUnderTag: ({ count }) => `${count} trang gắn thẻ này.`,
showingFirst: ({ count }) => `Đang hiển thị ${count} trang đầu tiên.`,
totalTags: ({ count }) => `Có tổng cộng ${count} thẻ.`,
},
},
} as const satisfies Translation

View File

@@ -26,9 +26,10 @@ export type CSSResource = {
export function JSResourceToScriptElement(resource: JSResource, preserve?: boolean): JSX.Element {
const scriptType = resource.moduleType ?? "application/javascript"
const spaPreserve = preserve ?? resource.spaPreserve
if (resource.contentType === "external") {
return (
<script key={resource.src} src={resource.src} type={scriptType} spa-preserve={spaPreserve} />
<script key={resource.src} src={resource.src} type={scriptType} data-persist={spaPreserve} />
)
} else {
const content = resource.script
@@ -36,7 +37,7 @@ export function JSResourceToScriptElement(resource: JSResource, preserve?: boole
<script
key={randomUUID()}
type={scriptType}
spa-preserve={spaPreserve}
data-persist={spaPreserve}
dangerouslySetInnerHTML={{ __html: content }}
></script>
)
@@ -54,7 +55,7 @@ export function CSSResourceToStyleElement(resource: CSSResource, preserve?: bool
href={resource.content}
rel="stylesheet"
type="text/css"
spa-preserve={spaPreserve}
data-persist={spaPreserve}
/>
)
}