Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: build-artifacts
path: website/dist
path: website/typst-docs-web/dist
- name: Deploy
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
with:
folder: website/dist # The folder the action should deploy.
folder: website/typst-docs-web/dist # The folder the action should deploy.

textlint-md:
runs-on: ubuntu-24.04
Expand All @@ -52,7 +52,7 @@ jobs:
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: build-artifacts
path: website/dist
path: website/typst-docs-web/dist
- uses: jdx/mise-action@13abe502c30c1559a5c37dff303831bab82c9402 # v2.2.3
- name: Install dependencies
run: bun install --frozen-lockfile
Expand All @@ -63,7 +63,7 @@ jobs:
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ./website
working-directory: website/typst-docs-web
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .textlintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# hayagrivaのsrc/csl/archive.rsで管理されている参考文献フォーマット
website/dist/reference/model/bibliography/index.html
website/dist/reference/model/cite/index.html
website/typst-docs-web/dist/reference/model/bibliography/index.html
website/typst-docs-web/dist/reference/model/cite/index.html
8 changes: 4 additions & 4 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ run = "cargo run --package typst-docs -- --assets-dir assets --out-file docs.jso
[tasks.generate-web]
depends = ["install-website"]
run = ["bun run build"]
dir = "./website"
dir = "./website/typst-docs-web"

[tasks.generate]
run = [
Expand All @@ -27,17 +27,17 @@ run = [

[tasks.install-website]
run = "bun install --frozen-lockfile"
dir = "./website"
dir = "./website/typst-docs-web"

[tasks.dev]
depends = ["install-website"]
run = "bun run dev"
dir = "./website"
dir = "./website/typst-docs-web"

[tasks.preview]
depends = ["install-website"]
run = "bun run preview"
dir = "./website"
dir = "./website/typst-docs-web"

[tasks.install-textlint]
run = "bun install --frozen-lockfile"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"textlint-md": "textlint ./docs/",
"textlint-md:fix": "textlint --fix ./docs/",
"textlint-html": "textlint ./website/dist/"
"textlint-html": "textlint ./website/typst-docs-web/dist/"
},
"devDependencies": {
"@types/bun": "latest",
Expand Down
2 changes: 1 addition & 1 deletion website/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "./metadata.schema.json",
"$schema": "./typst-docs-web/metadata.schema.json",
"language": "ja-JP",
"version": "0.13.1",
"typstOfficialUrl": "https://typst.app",
Expand Down
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "./translation-status.schema.json",
"$schema": "./typst-docs-web/translation-status.schema.json",
"/docs/": "translated",
"/docs/tutorial/": "translated",
"/docs/tutorial/writing-in-typst/": "translated",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { serveStatic } from "@hono/node-server/serve-static";
import { Hono } from "hono";
import { appendTrailingSlash, trimTrailingSlash } from "hono/trailing-slash";
// Documentation generated by typst-docs.
import docsJson from "../../docs.json";
import docsJson from "../../../docs.json";
import {
CategoryTemplate,
FuncTemplate,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import metadataJson from "../metadata.json";
import metadataJson from "../../metadata.json";

type Metadata = {
language: "ja-JP" | "en-US";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type TranslationStatusMap = {
};

const TRANSLATION_STATUS_FILE = path.resolve(
process.cwd(),
path.dirname(process.cwd()),
"translation-status.json",
);

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { basePath, originUrl } from "./src/metadata";
import { joinPath } from "./src/utils/path";

// Create a symbolic link to the assets generated by typst-docs in ./public/assets/
const assetsDocsPath = resolve(__dirname, "../assets/");
const assetsDocsPath = resolve(__dirname, "../../assets/");
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If typst-docs-web is meant to be a git submodule in the future, then I don't think ../../ is a good idea. It will be difficult to test typst-docs-web separately.

Would [Option A] something like readFile(env.TYPST_DOCS_RESULT + 'assets/') be better? Or [Option B] read from metadata.json?
Both approaches require a mechanism to specify where metadata.json is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current approach requires that the git submodule for SSG and the docs.json and assets/ directories output by typst-docs are located in the specified places.
Although using environment variables is one option, since we have a schema-based metadata JSON file, I think injecting the path through this file is a better idea.

const publicAssetsDocsPath = resolve(__dirname, "./public/assets/");
rmSync(publicAssetsDocsPath, { recursive: true, force: true });
symlinkSync(assetsDocsPath, publicAssetsDocsPath, "dir");
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about [Option C] letting typst-docs-web always read typst-docs-web/public/, and creating symlinks in mise.toml?

[Option C'] Also creating a symlink from metadata.json to typst-docs-web/public/metadata.json.


// Create a symbolic link to the assets generated by typst-docs in ./public/docs.json
const jsonDocsPath = resolve(__dirname, "../docs.json");
const jsonDocsPath = resolve(__dirname, "../../docs.json");
const publicJsonDocsPath = resolve(__dirname, "./public/docs.json");
rmSync(publicJsonDocsPath, { recursive: true, force: true });
symlinkSync(jsonDocsPath, publicJsonDocsPath, "file");
Expand Down