Skip to content

Commit 966d8cf

Browse files
authored
Merge pull request #95 from first-contributions-ja/feat/#91_set_metadata
metadataの設定、constants.tsの作成等
2 parents 67a11ae + 1c76c25 commit 966d8cf

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

lib/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const SITE_NAME = "first-contributions-ja";
2+
export const SITE_URL = "https://first-contributions-ja.github.io/";
3+
export const SITE_DESC = "Git/Githubの実践的な使い方やオープンソースでコラボレーションする作法を学ぶための日本語のチュートリアルです!";

src/app/layout.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
22
import { Inter, Noto_Sans_JP } from "next/font/google";
33
import "./globals.css";
44
import Footer from "@/components/footer";
5+
import { SITE_NAME, SITE_URL, SITE_DESC } from "../../lib/constants";
56

67
const inter = Inter({
78
subsets: ["latin"],
@@ -14,8 +15,24 @@ const notojp = Noto_Sans_JP({
1415
});
1516

1617
export const metadata: Metadata = {
17-
title: "Create Next App",
18-
description: "Generated by create next app",
18+
title: {
19+
default: SITE_NAME,
20+
template: `%s - ${SITE_NAME}`,
21+
},
22+
description: SITE_DESC,
23+
openGraph: {
24+
title: SITE_NAME,
25+
description: SITE_DESC,
26+
url: SITE_URL,
27+
siteName: SITE_NAME,
28+
locale: 'ja_JP',
29+
type: 'website',
30+
},
31+
twitter: {
32+
card: 'summary_large_image',
33+
title: SITE_NAME,
34+
description: SITE_DESC,
35+
},
1936
};
2037

2138
export default function RootLayout({

src/app/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Image from "next/image";
22
import { basePath } from "../../next.config";
33
const BASE_PATH = basePath ? basePath : "";
44
import GitHubIcon from '@mui/icons-material/GitHub';
5+
import { SITE_NAME } from "../../lib/constants";
56

67
export default function Home() {
78
return (
@@ -18,7 +19,7 @@ export default function Home() {
1819
コントリビューション体験
1920
</p>
2021
<h2 className="bg-red-600 text-white text-5xl inline-block px-4 py-2 font-bold mt-4">
21-
first-contributions-ja
22+
{SITE_NAME}
2223
</h2>
2324
<p className="mt-4">
2425
完全日本語のコントリビューション体験リポジトリです。フォーク、クローン、コミット、プルリクを行うことでOSSプロジェクト貢献方法を学べます。

src/components/footer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { SITE_NAME } from "../../lib/constants";
2+
13
export default function Footer() {
24
return (
35
<footer className="bg-red-600 text-white text-center py-2">
4-
<small>&copy; first-contributions-ja</small>
6+
<small>&copy; {SITE_NAME}</small>
57
</footer>
68
);
79
}

0 commit comments

Comments
 (0)