File tree Expand file tree Collapse file tree 4 files changed +32
-30
lines changed
[article_year]/[month]/[aid] Expand file tree Collapse file tree 4 files changed +32
-30
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import { getArticleIndexes } from "@/app/article/article";
33import { toHTML } from "@/app/article/article" ;
44import "./page.css" ;
55import { Metadata } from "next" ;
6+ import Loading from "@/app/loading" ;
7+ import { Suspense } from "react" ;
68export async function generateStaticParams ( ) {
79 const indexes = getArticleIndexes ( ) ;
810
@@ -46,7 +48,7 @@ export async function generateMetadata({
4648 const og_image_url = `${ slug } /${ article ?. thumbnail ?. split ( "/" ) . slice ( - 1 ) [ 0 ] } ` ;
4749 const metadata : Metadata = {
4850 metadataBase : new URL (
49- process . env . BASE_URL || "https://the-infinitys.f5.si" ,
51+ process . env . BASE_URL || "https://the-infinitys.f5.si"
5052 ) ,
5153 title : fullTitle , // ページのタイトルを設定
5254 description : description , // ページのディスクリプションを設定
@@ -72,5 +74,9 @@ export default function ArticlePage({
7274} : {
7375 params : Promise < { article_year : string ; month : string ; aid : string } > ;
7476} ) {
75- return < ArticleServer params = { params } /> ;
77+ return (
78+ < Suspense fallback = { < Loading /> } >
79+ < ArticleServer params = { params } />
80+ </ Suspense >
81+ ) ;
7682}
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ import "./page.css";
33import Explains from "./components/explains" ;
44import ArticlePage from "./components/articlepage" ; // クライアントコンポーネントをインポート
55import { Metadata } from "next" ;
6-
6+ import Loading from "@/app/loading" ;
7+ import { Suspense } from "react" ;
78export const metadata : Metadata = {
89 title : "The Infinity's Articles" ,
910 description : "Much! A lot of! Ideas!" ,
@@ -13,7 +14,9 @@ export default function Article() {
1314 return (
1415 < >
1516 < Explains />
16- < ArticlePage />
17+ < Suspense fallback = { < Loading /> } >
18+ < ArticlePage />
19+ </ Suspense >
1720 </ >
1821 ) ;
1922}
Original file line number Diff line number Diff line change 11import "./globals.css" ;
22import Header from "./layout/header" ;
33import Footer from "./layout/footer" ;
4- import { Suspense } from "react" ;
54import BackToTopButton from "./layout/back2top" ;
65import I18nProvider from "./i18nProvider" ;
76import { Geist , Geist_Mono } from "next/font/google" ;
87import type { Metadata } from "next" ;
9- import Loading from "./loading" ;
108export const metadata : Metadata = {
119 title : "The Infinity's" ,
1210 description : "Believe in The Infinite Possibilities!" ,
@@ -32,11 +30,9 @@ export default async function RootLayout({
3230 className = { `${ geistSans . variable } ${ geistMono . variable } antialiased` }
3331 >
3432 < I18nProvider >
35- < Suspense fallback = { < Loading /> } >
36- < Header />
37- { children }
38- < Footer />
39- </ Suspense >
33+ < Header />
34+ { children }
35+ < Footer />
4036 </ I18nProvider >
4137 < BackToTopButton />
4238 </ body >
Original file line number Diff line number Diff line change 11"use client" ;
22import { motion } from "framer-motion" ;
33import React from "react" ;
4- import { AnimatePresence } from "framer-motion" ;
5-
64const variants = {
75 hidden : { opacity : 0 } ,
86 enter : { opacity : 1 } ,
97} ;
108
119export default function Template ( { children } : { children : React . ReactNode } ) {
1210 return (
13- < AnimatePresence exitBeforeEnter >
14- < motion . main
15- className = "site-wrapper"
16- variants = { variants }
17- initial = "hidden"
18- animate = "enter"
19- style = { {
20- minHeight : "100vh" ,
21- } }
22- transition = { {
23- type : "linear" ,
24- duration : 2 ,
25- } }
26- >
27- { children }
28- </ motion . main >
29- </ AnimatePresence >
11+ < motion . main
12+ className = "site-wrapper"
13+ variants = { variants }
14+ initial = { { opacity : 0 } }
15+ animate = { { opacity : 1 } }
16+ // exit={{ opacity: 0 }} // no means
17+ style = { {
18+ minHeight : "100vh" ,
19+ } }
20+ transition = { {
21+ type : "linear" ,
22+ duration : 2 ,
23+ } }
24+ >
25+ { children }
26+ </ motion . main >
3027 ) ;
3128}
You can’t perform that action at this time.
0 commit comments