From 2ebc719bc2f11f7fe6a08217f75f891f33a24139 Mon Sep 17 00:00:00 2001 From: spaaaacccee Date: Fri, 24 May 2024 16:30:13 +1000 Subject: [PATCH] Fix trailing slash issue --- blog/2023-09-22-changelog/index.md | 2 +- docs/3-visualiser/contributing.md | 2 +- docusaurus.config.ts | 3 +- src/components/AppBar.tsx | 2 +- src/components/Footer.tsx | 2 +- src/components/Gallery.tsx | 2 +- src/components/GetStartedButton.tsx | 2 +- src/components/Hero.tsx | 2 +- src/components/Logo.tsx | 2 +- src/{pages => l10n}/en-au.json | 20 ++-- src/l10n/index.tsx | 3 + src/l10n/zh-cn.json | 177 ++++++++++++++++++++++++++++ src/pages/index.tsx | 2 +- 13 files changed, 201 insertions(+), 20 deletions(-) rename src/{pages => l10n}/en-au.json (92%) create mode 100644 src/l10n/index.tsx create mode 100644 src/l10n/zh-cn.json diff --git a/blog/2023-09-22-changelog/index.md b/blog/2023-09-22-changelog/index.md index d0d5663..1c0de92 100644 --- a/blog/2023-09-22-changelog/index.md +++ b/blog/2023-09-22-changelog/index.md @@ -156,7 +156,7 @@ Get Posthoc as a standalone application for Linux. [View Releases](https://github.com/ShortestPathLab/posthoc-app/releases) -#### Posthoc PWA (Github Pages) +#### Posthoc PWA (GitHub Pages) Use Posthoc in your browser, or install it as a web app. diff --git a/docs/3-visualiser/contributing.md b/docs/3-visualiser/contributing.md index 199fd86..49b3f5a 100644 --- a/docs/3-visualiser/contributing.md +++ b/docs/3-visualiser/contributing.md @@ -4,6 +4,6 @@ sidebar_position: 4 # Contributing -We welcome new issues, discussions, and PRs on our [Github repository](https://github.com/ShortestPathLab/posthoc-app). +We welcome new issues, discussions, and PRs on our [GitHub repository](https://github.com/ShortestPathLab/posthoc-app). Check out our roadmap [here](https://github.com/orgs/path-visualiser/projects/2/views/2). diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 0652592..38c3a09 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -13,6 +13,7 @@ const config: Config = { // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: "/", + trailingSlash: false, // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. @@ -83,7 +84,7 @@ const config: Config = { }, { href: "https://github.com/ShortestPathLab/posthoc-app", - label: "Github", + label: "GitHub", position: "left", }, { diff --git a/src/components/AppBar.tsx b/src/components/AppBar.tsx index 09bb6fd..7f91333 100644 --- a/src/components/AppBar.tsx +++ b/src/components/AppBar.tsx @@ -15,13 +15,13 @@ import { } from "@mui/material"; import PopupState, { bindTrigger } from "material-ui-popup-state"; import { createPortal } from "react-dom"; -import l10n from "../pages/en-au.json"; import { Logo } from "./Logo"; import { useMode } from "./ModeContext"; import { space } from "./space"; import { usePaper } from "./theme"; import { useSm } from "./useSm"; import BrowserOnly from "@docusaurus/BrowserOnly"; +import { l10n } from "../l10n"; export function AppBar() { const sm = useSm(); diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 4e305e1..84ad866 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,6 +1,6 @@ import { Box, Button, Divider, Stack, Typography } from "@mui/material"; import { grid } from "./grid"; -import l10n from "../pages/en-au.json"; +import { l10n } from "../l10n"; import { Logo } from "./Logo"; import { useSm } from "./useSm"; import { space } from "./space"; diff --git a/src/components/Gallery.tsx b/src/components/Gallery.tsx index 3f319e3..6bb4a4a 100644 --- a/src/components/Gallery.tsx +++ b/src/components/Gallery.tsx @@ -14,7 +14,7 @@ import { clamp, floor } from "lodash"; import { useEffect, useState } from "react"; import AutoSize from "react-virtualized-auto-sizer"; import resolve from "resolve-url"; -import l10n from "../pages/en-au.json"; +import { l10n } from "../l10n"; import { usePaper } from "./theme"; import { useSm } from "./useSm"; diff --git a/src/components/GetStartedButton.tsx b/src/components/GetStartedButton.tsx index 0083400..97dc864 100644 --- a/src/components/GetStartedButton.tsx +++ b/src/components/GetStartedButton.tsx @@ -1,6 +1,6 @@ import { ArrowForward } from "@mui/icons-material"; import { Button, useTheme } from "@mui/material"; -import l10n from "../pages/en-au.json"; +import { l10n } from "../l10n"; export function GetStartedButton() { const mode = useTheme().palette.mode; diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx index 3b62e04..43f79ff 100644 --- a/src/components/Hero.tsx +++ b/src/components/Hero.tsx @@ -1,6 +1,6 @@ import { FilterTiltShiftOutlined as ShowVideoIcon } from "@mui/icons-material"; import { Button, Link, Stack, Typography } from "@mui/material"; -import l10n from "../pages/en-au.json"; +import { l10n } from "../l10n"; import { space } from "./space"; import { GetStartedButton } from "./GetStartedButton"; import { useSm } from "./useSm"; diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index 36fab5b..f6874d3 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -1,5 +1,5 @@ import { ComponentProps } from "react"; -import l10n from "../pages/en-au.json"; +import { l10n } from "../l10n"; export function Logo(props: ComponentProps<"img">) { return ; diff --git a/src/pages/en-au.json b/src/l10n/en-au.json similarity index 92% rename from src/pages/en-au.json rename to src/l10n/en-au.json index 62026f2..de22297 100644 --- a/src/pages/en-au.json +++ b/src/l10n/en-au.json @@ -17,13 +17,13 @@ { "key": "blog", "label": "Blog", "url": "./blog" }, { "key": "github", - "label": "Github", + "label": "GitHub", "url": "https://github.com/shortestpathlab/posthoc-app" } ], "gallery": [ { - "tagline": "Analysis", + "tagline": "Analyse", "url": "/img/gallery/complex-view.png", "workspace": "/content/starcraft.min.workspace", "label": "Post-game breakdown", @@ -34,14 +34,14 @@ { "tagline": "Showcase", "url": "/img/gallery/image-7.png", - "label": "Video compression", + "label": "Animation demo", "workspace": "/content/apple.min.workspace", "author": "Mark Carlson", "avatar": null, "description": "A simple encoding scheme for black and white video based on run-length encoding." }, { - "tagline": "Interrogation", + "tagline": "Understand", "url": "/img/gallery/astar.png", "label": "A* search", "workspace": "/content/astar.min.workspace", @@ -50,16 +50,16 @@ "description": "Get to know Posthoc by taking apart and inspecting the classic A* algorithm on a small grid map." }, { - "tagline": "Debugging", + "tagline": "Explore", "url": "/img/gallery/image-3.png", "workspace": "/content/dps.workspace", - "label": "Dual euclidean path search", - "description": "Visually verify that DPS can correctly generate shortest paths for a simple map.", + "label": "Dual Euclidean path search", + "description": "DPS is an exciting new approach for Euclidean pathfinding. See how it works on a small poly map problem.", "avatar": "https://github.com/heavenfall.png", "author": "Ryan Hechenberger" }, { - "tagline": "Demonstration", + "tagline": "Demonstrate", "url": "/img/gallery/mcp.png", "label": "Minimum communication policy", "workspace": "/content/mcp.min.workspace", @@ -125,7 +125,7 @@ }, { "label": "Docs", "url": "./docs/overview" }, { - "label": "Github", + "label": "GitHub", "url": "https://github.com/shortestpathlab/posthoc-app" } ] @@ -145,7 +145,7 @@ "label": "Tracker", "url": "https://tracker.pathfinding.ai/" }, - { "label": "Github", "url": "https://github.com/ShortestPathLab" } + { "label": "GitHub", "url": "https://github.com/ShortestPathLab" } ] }, { diff --git a/src/l10n/index.tsx b/src/l10n/index.tsx new file mode 100644 index 0000000..af22915 --- /dev/null +++ b/src/l10n/index.tsx @@ -0,0 +1,3 @@ +import enAu from "./en-au.json"; +import zhCn from "./zh-cn.json"; +export const l10n = enAu; diff --git a/src/l10n/zh-cn.json b/src/l10n/zh-cn.json new file mode 100644 index 0000000..90ea026 --- /dev/null +++ b/src/l10n/zh-cn.json @@ -0,0 +1,177 @@ +{ + "org": "ShortestPathLab", + "orgUrl": "https://pathfinding.ai", + "name": "Posthoc", + "openAppLabel": "打开 Posthoc", + "logoUrl": "/img/logo192.png", + "closeVideo": "关闭视频", + "playVideo": "播放 ICAPS24 演示", + "backdropVideoUrl": "media/clip.webm", + "backdropVideoMime": "video/webm", + "demoVideoUrl": "https://drive.google.com/file/d/1ve-GQbgj0MGcouCdE0gxQON-20rpxtW5/preview", + "demoVideoThumbnail": "/img/primer-thumbnail.png", + "demoVideoMime": "video/webm", + "appUrl": "https://posthoc-app.pathfinding.ai", + "sections": [ + { "key": "docs", "label": "文档", "url": "./docs/overview" }, + { "key": "blog", "label": "博客", "url": "./blog" }, + { + "key": "github", + "label": "GitHub", + "url": "https://github.com/shortestpathlab/posthoc-app" + } + ], + "gallery": [ + { + "tagline": "分析", + "url": "/img/gallery/complex-view.png", + "workspace": "/content/starcraft.min.workspace", + "label": "赛后分析", + "author": "Ryan Hechenberger", + "avatar": "https://github.com/heavenfall.png", + "description": "探索记录的星际争霸游戏中 AI 单位的决策。" + }, + { + "tagline": "展示", + "url": "/img/gallery/image-7.png", + "label": "视频压缩", + "workspace": "/content/apple.min.workspace", + "author": "Mark Carlson", + "avatar": null, + "description": "基于游程编码的黑白视频的简单编码方案。" + }, + { + "tagline": "审问", + "url": "/img/gallery/astar.png", + "label": "A* 搜索", + "workspace": "/content/astar.min.workspace", + "author": "ShortestPathLab", + "avatar": "https://github.com/ShortestPathLab.png", + "description": "通过拆解和检查小型网格地图上的经典 A* 算法,了解 Posthoc。" + }, + { + "tagline": "调试", + "url": "/img/gallery/image-3.png", + "workspace": "/content/dps.workspace", + "label": "双欧几里得路径搜索", + "description": "直观验证 DPS 能否为简单地图正确生成最短路径。", + "avatar": "https://github.com/heavenfall.png", + "author": "Ryan Hechenberger" + }, + { + "tagline": "演示", + "url": "/img/gallery/mcp.png", + "label": "最小通信策略", + "workspace": "/content/mcp.min.workspace", + "description": "查看代理如何通过最小通信策略处理执行延迟。", + "avatar": "https://github.com/YueZhang-studyuse.png", + "author": "Yue Zhang" + } + ], + "galleryCallToAction": "在 Posthoc 中查看更多示例", + "heroTitle": "探索搜索中的决策制定", + "heroSubtitle": "Posthoc 是一种从日志创建简单有效的可视化的方法,帮助您理解搜索。", + "heroCallToAction": "开始使用", + "heroCallToActionUrl": "./docs/get-started", + "endCallToActionTitle": "准备尝试 Posthoc 吗?", + "demoSectionTitle": "在 ICAPS24 上展示", + "demoSectionSubtitle": "我们很高兴向搜索和规划社区介绍 Posthoc", + "featuresSectionTitle": "特点", + "featuresSectionSubtitle": "featuresSectionSubtitle", + "teamSectionTitle": "团队", + "teamSectionSubtitle": "由 Monash University ShortestPathLab 团队热情打造", + "features": [ + { + "image": null, + "title": "", + "subtitle": "" + } + ], + "docsSectionTitle": "docsSectionTitle", + "docsSectionSubtitle": "docsSectionSubtitle", + "docsUrlGeneric": "./docs/overview", + "docs": [ + { + "key": "os", + "label": "操作系统", + "options": [ + { "key": "linux", "label": "Linux" }, + { "key": "windows", "label": "Windows" }, + { "key": "macos", "label": "MacOS" }, + { "key": "other", "label": "其他" } + ] + }, + { + "key": "lang", + "label": "语言", + "options": [ + { "key": "cpp", "label": "C++" }, + { "key": "python", "label": "Python" }, + { "key": "rust", "label": "Rust" }, + { "key": "other", "label": "其他" } + ] + } + ], + "docsCallToAction": "查看 %os 的 %lang Posthoc 文档", + "docsCallToActionGeneric": "了解 Posthoc 如何为您服务", + "showVideo": "观看 ICAPS24 演示", + "footerLinks": [ + { + "title": "Posthoc", + "links": [ + { + "label": "打开 Posthoc", + "url": "https://posthoc.pathfinding.ai" + }, + { "label": "文档", "url": "./docs/overview" }, + { + "label": "GitHub", + "url": "https://github.com/shortestpathlab/posthoc-app" + } + ] + }, + { + "title": "ShortestPathLab", + "links": [ + { + "label": "首页", + "url": "https://pathfinding.ai/" + }, + { + "label": "基准测试", + "url": "https://benchmarks.pathfinding.ai/" + }, + { + "label": "追踪器", + "url": "https://tracker.pathfinding.ai/" + }, + { "label": "GitHub", "url": "https://github.com/ShortestPathLab" } + ] + }, + { + "title": "Monash Optimisation", + "links": [{ "label": "首页", "url": "https://www.monash.edu" }] + } + ], + "team": [ + { + "name": "Kevin Zheng", + "title": "Posthoc 首席开发者", + "avatar": null, + "github": "https://github.com/Spaaaacccee" + }, + { + "name": "Dr Daniel Harabor", + "title": "副教授", + "avatar": null, + "github": "https://harabor.net/daniel" + }, + { + "name": "Dr Michael Wybrow", + "title": "副教授", + "avatar": null, + "github": "https://harabor.net/daniel" + } + ], + "footerCopyright": "版权所有 © 2024 Monash University" +} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f8e7d46..2f4b39e 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -22,8 +22,8 @@ import { SectionTitle } from "../components/SectionTitle"; import { grid } from "../components/grid"; import { useSm } from "../components/useSm"; import { useTitleBar } from "../components/useTitleBar"; -import l10n from "./en-au.json"; import "./index.module.css"; +import { l10n } from "../l10n"; function Content() { const sm = useSm();