Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3,920 changes: 2,016 additions & 1,904 deletions package-lock.json

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,49 @@
"unused-asset": "node scripts/unused-asset.js"
},
"dependencies": {
"@astrojs/mdx": "2.3.1",
"@astrojs/mdx": "4.0.8",
"@astrojs/partytown": "^2.1.4",
"@astrojs/react": "3.6.1",
"@astrojs/rss": "^4.0.7",
"@fontsource-variable/open-sans": "^5.0.29",
"@fontsource/material-icons": "^5.0.18",
"@astrojs/react": "4.2.0",
"@astrojs/rss": "^4.0.11",
"@fontsource-variable/open-sans": "^5.1.1",
"@fontsource/material-icons": "^5.1.1",
"@rollup/plugin-yaml": "4.1.2",
"astro": "4.13.1",
"astro": "5.3.0",
"astro-seo": "0.8.4",
"estree-util-visit": "2.0.0",
"github-slugger": "^2.0.0",
"glob": "^11.0.0",
"glob": "^11.0.1",
"gray-matter": "^4.0.3",
"hast-util-select": "6.0.2",
"hast-util-select": "6.0.4",
"hast-util-to-text": "^4.0.2",
"mdast-util-mdx": "3.0.0",
"mdast-util-to-hast": "^13.2.0",
"micromark-core-commonmark": "2.0.1",
"micromark-util-character": "2.1.0",
"micromark-util-symbol": "2.0.0",
"micromark-core-commonmark": "2.0.2",
"micromark-util-character": "2.1.1",
"micromark-util-symbol": "2.0.1",
"normalize.css": "^8.0.1",
"prettier": "^3.3.3",
"prettier": "^3.5.2",
"rehype-external-links": "3.0.0",
"rehype-minify-whitespace": "^6.0.0",
"rehype-parse": "9.0.0",
"rehype-minify-whitespace": "^6.0.2",
"rehype-parse": "9.0.1",
"rehype-raw": "7.0.0",
"rehype-remove-comments": "^6.0.0",
"rehype-remove-empty-attribute": "^4.0.0",
"rehype-stringify": "10.0.0",
"rehype-remove-comments": "^6.1.1",
"rehype-remove-empty-attribute": "^4.0.1",
"rehype-stringify": "10.0.1",
"remark-attribute-list": "0.3.1",
"remark-parse": "^11.0.0",
"sass": "^1.77.8",
"sass": "^1.85.0",
"to-vfile": "8.0.0",
"unified": "11.0.5",
"unist-util-remove": "^4.0.0",
"unist-util-visit": "5.0.0",
"vfile": "6.0.2"
"vfile": "6.0.3"
},
"devDependencies": {
"@types/hast": "3.0.4",
"@types/mdast": "4.0.4",
"@types/node": "^22.8.7",
"@types/unist": "3.0.2",
"typescript": "^5.5.4"
"@types/node": "^22.13.5",
"@types/unist": "3.0.3",
"typescript": "^5.7.3"
}
}
5 changes: 2 additions & 3 deletions src/components/en/systems/utokyo_account/ChangePassword.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import UtacPasswordNotice from "./20230811UtacPasswordNotice.mdx";
* @property {import("@components/types").Variant} variant
*/}

export const students = <Fragment>You should receive this notification well before classes start; however, if you do not, please contact your faculty/graduate school. (The notification is available to first year undergraduate students entering in April 2025 at the web registration system starting March 21, 2025.)</Fragment>
export const faculty_members = <Fragment>Faculty members who need it for classes should receive the notification, but if you have not, please contact the relevant office of your faculty/graduate school.</Fragment>

export const students = <>You should receive this notification well before classes start; however, if you do not, please contact your faculty/graduate school. (The notification is available to first year undergraduate students entering in April 2025 at the web registration system starting March 21, 2025.)</>
export const faculty_members = <>Faculty members who need it for classes should receive the notification, but if you have not, please contact the relevant office of your faculty/graduate school.</>

1. You will receive the "Notification regarding password for the UTokyo Account", which will include your initial password from your faculty or graduate school.
<Switch variant={props.variant}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ja/systems/utokyo_account/ChangePassword.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import UtacPasswordNotice from "./20230321UtacPasswordNotice.mdx";
* @property {import("@components/types").Variant} variant ページの種類 パスワード通知書を受け取る手順での説明が異なるため必要
*/}

export const students = <Fragment>授業開始に十分間に合うように配布されるはずですが,不明な場合は所属の学部・研究科等に問い合わせてみてください(※2025年4月入学の学部1年生には2025年3月21日からウェブ登録システムで配布されます).</Fragment>
export const faculty_members = <Fragment>授業に必要な教員には発行されているはずですが,もらっていない場合は所属部局の事務に問い合わせてください.</Fragment>
export const students = <>授業開始に十分間に合うように配布されるはずですが,不明な場合は所属の学部・研究科等に問い合わせてみてください(※2025年4月入学の学部1年生には2025年3月21日からウェブ登録システムで配布されます).</>
export const faculty_members = <>授業に必要な教員には発行されているはずですが,もらっていない場合は所属部局の事務に問い合わせてください.</>

1. 所属の学部・研究科等から,初期パスワードが記載された「パスワード通知書」を受け取ってください.
<Switch variant={props.variant}>
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const resolvedBreadcrumb =
font-weight: bold;
color: black;
}
main[data-toc] {
main[data-toc="true"] {
#article {
display: flex;
flex-direction: row-reverse;
Expand All @@ -215,7 +215,7 @@ const resolvedBreadcrumb =
}
}
@media screen and (max-width: calc(768px + $toc-width + $article-gap)) {
main[data-toc] {
main[data-toc="true"] {
#article {
flex-direction: column;
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/AssetFileNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const IMAGE_EXTS = [

// This function adds a SHA-1 (base64url) hash to the filename of image assets,
// so that they can later be identified in `scripts/unused-asset.js`.
const assetFileNames = ({ name, source }: PreRenderedAsset): string => {
const assetFileNames = ({ names, source }: PreRenderedAsset): string => {
const name = names[0];
if (
name &&
IMAGE_EXTS.includes(parse(name).ext) &&
Expand Down
8 changes: 5 additions & 3 deletions src/lib/CollectHtmlImagesPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import type { Root } from "hast";
import type { VFile } from "vfile";
import { selectAll } from "hast-util-select";
import type { MarkdownVFile } from "@astrojs/markdown-remark";

const ALLOWED_PREFIXES = ["/", "./", "../", "@"];

export default function collectHtmlImages() {
return (node: Root, file: MarkdownVFile) => {
return (node: Root, file: VFile) => {
selectAll("img", node).forEach((img) => {
if (typeof img.properties?.src !== "string") return;

const src = img.properties.src;
if (!ALLOWED_PREFIXES.some((prefix) => src.startsWith(prefix))) {
img.properties.src = `./${src}`;
}
file.data.imagePaths!.add(img.properties.src);
const imagePaths = file.data.astro!.imagePaths;
if (imagePaths?.includes(img.properties.src)) return;
imagePaths?.push(img.properties.src);
});
};
}
14 changes: 9 additions & 5 deletions src/lib/CopyAssetIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AstroIntegration } from "astro";
import type { AstroIntegration, IntegrationResolvedRoute } from "astro";

import { existsSync } from "node:fs";
import { copyFile, mkdir } from "node:fs/promises";
Expand All @@ -19,20 +19,24 @@ const assetPathsCache = new Set<string>();

export default function CopyAssetIntegration(): AstroIntegration {
const parser = unified().use(rehypeParse);
let routes: IntegrationResolvedRoute[] = [];

return {
name: "copy-asset",
hooks: {
"astro:build:done": async ({ dir, routes }) => {
"astro:routes:resolved": (params) => {
routes = params.routes;
},
"astro:build:done": async ({ dir }) => {
await Promise.all(
routes.map(async ({ pathname, component }) => {
routes.map(async ({ pathname, entrypoint }) => {
if (!pathname || pathname.endsWith("/rss.xml")) return;
const path = getDistFilePath(dir, pathname, component);
const path = getDistFilePath(dir, pathname, entrypoint);
const source = await read(path);
const hast = parser.parse(source);

const base = new URL(
join(relative("src/pages", dirname(component)), sep),
join(relative("src/pages", dirname(entrypoint)), sep),
ORIGINS[0],
);

Expand Down
9 changes: 4 additions & 5 deletions src/lib/DefaultFrontmatterPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { VFile } from "vfile";
import type { Node } from "unist";
import { join, relative } from "path";
import type { MarkdownAstroData } from "@astrojs/markdown-remark";

interface Options {
layout: string;
Expand All @@ -12,13 +11,13 @@ interface Options {
*/
export default function defaultFrontmatterPlugin({ layout }: Options) {
return function (_: Node, file: VFile) {
const astro = file.data.astro as MarkdownAstroData;
const frontmatter = file.data.astro!.frontmatter!;
const path = relative(join(file.cwd, "src", "pages"), file.path);
if (path.startsWith("..") || file.basename?.startsWith("_")) {
astro.frontmatter.layout = false;
frontmatter.layout = false;
return;
}
astro.frontmatter.layout ??= layout;
astro.frontmatter.lang ??= path.startsWith("en") ? "en" : "ja";
frontmatter.layout ??= layout;
frontmatter.lang ??= path.startsWith("en") ? "en" : "ja";
};
}
4 changes: 2 additions & 2 deletions src/pages/microsoft/onedrive/_ReceiveFiles.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const univLink = <Fragment>「<a href="#univ-share">学内の関係者とファイル・フォルダを共同編集する場合</a>」</Fragment>;
export const outsideLink = <Fragment>「<a href="#outside-share">学外の関係者とファイルを共同編集する場合</a>」</Fragment>;
export const univLink = <>「<a href="#univ-share">学内の関係者とファイル・フォルダを共同編集する場合</a>」</>;
export const outsideLink = <>「<a href="#outside-share">学外の関係者とファイルを共同編集する場合</a>」</>;

{/* * @typedef {object} Props
* @property {boolean} isOnCampus */}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
max-width: 64rem;
margin: 0 auto;

&[data-toc] {
&[data-toc="true"] {
max-width: 84rem;
}
}
Expand Down