From 39613b966e2e96caa9e3a10647784daa97719ac4 Mon Sep 17 00:00:00 2001 From: tomolld Date: Fri, 28 Feb 2025 23:21:30 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=83=96=E3=83=98=E3=83=83=E3=83=80?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E6=94=B9=E5=96=84=E3=81=97=E3=80=81TOC=E3=81=AE=E3=82=AB?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=83=A0=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82=E3=81=BE=E3=81=9F=E3=80=81=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=93=E3=83=A5=E3=83=BC=E5=8F=96=E5=BE=97=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=80=81=E3=82=B0=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=ABCSS=E3=81=ABTOC=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=81=AE=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../page/[slug]/components/sub-header.tsx | 6 +- .../[handle]/page/[slug]/components/toc.tsx | 10 ---- next/src/app/[locale]/lib/get-page-views.ts | 57 ------------------- next/src/app/globals.css | 15 +++-- 4 files changed, 12 insertions(+), 76 deletions(-) delete mode 100644 next/src/app/[locale]/lib/get-page-views.ts diff --git a/next/src/app/[locale]/(common-layout)/user/[handle]/page/[slug]/components/sub-header.tsx b/next/src/app/[locale]/(common-layout)/user/[handle]/page/[slug]/components/sub-header.tsx index cbe6795b..e0cf622d 100644 --- a/next/src/app/[locale]/(common-layout)/user/[handle]/page/[slug]/components/sub-header.tsx +++ b/next/src/app/[locale]/(common-layout)/user/[handle]/page/[slug]/components/sub-header.tsx @@ -57,9 +57,9 @@ export function SubHeader({ return (
{ tocbot.destroy(); diff --git a/next/src/app/[locale]/lib/get-page-views.ts b/next/src/app/[locale]/lib/get-page-views.ts deleted file mode 100644 index 8a6fea9b..00000000 --- a/next/src/app/[locale]/lib/get-page-views.ts +++ /dev/null @@ -1,57 +0,0 @@ -// import { BetaAnalyticsDataClient } from "@google-analytics/data"; - -// // 環境変数から認証情報とプロパティIDを取得 -// const GOOGLE_ANALYTICS_CREDENTIALS_BASE64 = -// process.env.GOOGLE_ANALYTICS_CREDENTIALS_BASE64; -// const GOOGLE_ANALYTICS_PROPERTY_ID = process.env.GOOGLE_ANALYTICS_PROPERTY_ID; - -// interface PageViewData { -// pagePath: string; -// screenPageViews: number; -// } - -// export async function getPageViews(startDate: string, endDate: string) { -// if (!GOOGLE_ANALYTICS_CREDENTIALS_BASE64 || !GOOGLE_ANALYTICS_PROPERTY_ID) { -// throw new Error( -// "Google Analytics認証情報またはプロパティIDが設定されていません。", -// ); -// } - -// try { -// const credentials = JSON.parse( -// Buffer.from(GOOGLE_ANALYTICS_CREDENTIALS_BASE64, "base64").toString( -// "ascii", -// ), -// ); -// const analyticsDataClient = new BetaAnalyticsDataClient({ credentials }); -// const [response] = await analyticsDataClient.runReport({ -// property: `properties/${GOOGLE_ANALYTICS_PROPERTY_ID}`, -// dateRanges: [{ startDate, endDate }], -// dimensions: [{ name: "pagePath" }], -// metrics: [{ name: "screenPageViews" }], -// }); - -// if (!response || !response.rows) return null; - -// const pageViewData: PageViewData[] = []; - -// for (const row of response.rows) { -// if (row.dimensionValues && row.metricValues) { -// pageViewData.push({ -// pagePath: row.dimensionValues[0].value || "", -// screenPageViews: Number.parseInt( -// row.metricValues[0].value || "0", -// 10, -// ), -// }); -// } -// } - -// return pageViewData; -// } catch (error) { -// console.error( -// "Google Analyticsのデータ取得中にエラーが発生しました:", -// error, -// ); -// } -// } diff --git a/next/src/app/globals.css b/next/src/app/globals.css index 52a8bba7..b1a8fd7b 100644 --- a/next/src/app/globals.css +++ b/next/src/app/globals.css @@ -101,19 +101,22 @@ body.virtual-keyboard-shown { margin-top: var(--visual-viewport-offset-top, 0px); } +.toc-link { + @apply !no-underline; + @apply whitespace-pre-wrap; +} .toc-link:before { @apply !hidden; } -.toc-list { - @apply text-slate-400 !list-none; -} -.toc-link { - @apply !no-underline; -} .toc-link:hover { @apply !underline; } + +.toc-list { + @apply text-slate-400; +} + .is-active-link { @apply !text-primary; }