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
26 changes: 1 addition & 25 deletions .vitepress/ja.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,6 @@ export const ja = defineConfig({
title: "Frontend Fundamentals",
description: "変更しやすいフロントエンドコードのためのガイドライン",
lastUpdated: true,
head: [
["link", { rel: "icon", href: "/images/favicon.ico" }],
[
"meta",
{
property: "og:image",
content: "https://static.toss.im/illusts/ff-meta.png"
}
],
[
"meta",
{
name: "twitter:image",
content: "https://static.toss.im/illusts/ff-meta.png"
}
],
[
"meta",
{
name: "twitter:card",
content: "https://static.toss.im/illusts/ff-meta.png"
}
]
],
themeConfig: {
logo: "/images/ff-symbol.svg",
nav: nav(),
Expand Down Expand Up @@ -213,7 +189,7 @@ function sidebar(): DefaultTheme.Sidebar {
}

export const search: DefaultTheme.LocalSearchOptions["locales"] = {
root: {
ja: {
translations: {
button: {
buttonText: "検索",
Expand Down
16 changes: 11 additions & 5 deletions .vitepress/shared.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig, HeadConfig } from "vitepress";
import { search as koSearch } from "./ko.mts";
import { search as jaSearch } from "./ja.mts";

export const shared = defineConfig({
lastUpdated: true,
Expand Down Expand Up @@ -30,11 +31,15 @@ export const shared = defineConfig({

transformHead: ({ pageData }) => {
const head: HeadConfig[] = [];
const title = pageData.frontmatter.title || pageData.title || 'Frontend Fundamentals';
const description = pageData.frontmatter.description || pageData.description || 'Guidelines for easily modifiable frontend code';
const title =
pageData.frontmatter.title || pageData.title || "Frontend Fundamentals";
const description =
pageData.frontmatter.description ||
pageData.description ||
"Guidelines for easily modifiable frontend code";

head.push(['meta', { property: 'og:title', content: title }]);
head.push(['meta', { property: 'og:description', content: description }]);
head.push(["meta", { property: "og:title", content: title }]);
head.push(["meta", { property: "og:description", content: description }]);

return head;
},
Expand All @@ -50,7 +55,8 @@ export const shared = defineConfig({
provider: "local",
options: {
locales: {
...koSearch
...koSearch,
...jaSearch
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion ja/code/examples/user-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function Page() {
function Page() {
const user = useUser();
const policy = {
admin: { canInvite: true, canRead: true },
admin: { canInvite: true, canView: true },
viewer: { canInvite: false, canView: true }
}[user.role];

Expand Down