diff --git a/src/components/PageHeader.astro b/src/components/PageHeader.astro index be93c75..ea76d61 100644 --- a/src/components/PageHeader.astro +++ b/src/components/PageHeader.astro @@ -1,6 +1,6 @@ --- import { Image } from 'astro:assets'; -import { SITE_TITLE } from '../consts'; +import { siteTitle } from '../consts'; interface Props { title: string; @@ -28,7 +28,7 @@ const Title = isHome ? 'p' : 'h1'; src={import('../assets/favicon.svg')} alt="" /> - {SITE_TITLE} + {siteTitle} diff --git a/src/consts.ts b/src/consts.ts index 330e06f..65ab387 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -1,6 +1,6 @@ -export const SITE_TITLE = 'Yuhei Yasuda'; -export const SITE_LANG = 'ja'; -export const SITE_REGION = 'JP'; -export const SITE_TWITTER_ID = '_yuheiy'; -export const SITE_DESCRIPTION = +export const siteTitle = 'Yuhei Yasuda'; +export const siteLang = 'ja'; +export const siteRegion = 'JP'; +export const siteTwitterId = '_yuheiy'; +export const siteDescription = 'フロントエンドウェブ開発者。HTMLやWAI-ARIA、CSS設計、レスポンシブデザイン、Jamstack、シングルページアプリケーション、アクセシビリティ、インターフェースデザインが関心領域。'; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 9e7c665..cb847b9 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,7 +1,7 @@ --- import appleTouchIconImage from '../assets/apple-touch-icon.png'; import faviconImage from '../assets/favicon.svg'; -import { SITE_LANG, SITE_REGION, SITE_TITLE, SITE_TWITTER_ID } from '../consts'; +import { siteLang, siteRegion, siteTitle, siteTwitterId } from '../consts'; interface BaseProps { isHome?: false | undefined; @@ -35,7 +35,7 @@ const { twitterCard = 'summary', } = Astro.props; -const title = isHome ? SITE_TITLE : Astro.props.title; +const title = isHome ? siteTitle : Astro.props.title; const resolvedOgImage = new URL(ogImage, Astro.site); let canonicalURL: URL | null = null; @@ -53,7 +53,7 @@ if (!is404) { --> { @@ -72,7 +72,7 @@ if (!is404) { {description && } - + @@ -80,8 +80,8 @@ if (!is404) { {canonicalURL && } {description && } - - + + diff --git a/src/lib/render-date-to-html.ts b/src/lib/render-date-to-html.ts index 6d5a2cc..c8177bc 100644 --- a/src/lib/render-date-to-html.ts +++ b/src/lib/render-date-to-html.ts @@ -1,6 +1,6 @@ -import { SITE_LANG, SITE_REGION } from '../consts'; +import { siteLang, siteRegion } from '../consts'; -const locale = `${SITE_LANG}-${SITE_REGION}`; +const locale = `${siteLang}-${siteRegion}`; const dateFormatter = new Intl.DateTimeFormat(locale, { dateStyle: 'long', diff --git a/src/lib/render-year-month-range-to-html.ts b/src/lib/render-year-month-range-to-html.ts index d215322..64e2bcf 100644 --- a/src/lib/render-year-month-range-to-html.ts +++ b/src/lib/render-year-month-range-to-html.ts @@ -1,4 +1,4 @@ -import { SITE_LANG, SITE_REGION } from '../consts'; +import { siteLang, siteRegion } from '../consts'; interface YearMonth { year: number; @@ -9,7 +9,7 @@ function convertYearMonthToDate({ year, month }: YearMonth) { return new Date(Date.UTC(year, month - 1)); } -const locale = `${SITE_LANG}-${SITE_REGION}`; +const locale = `${siteLang}-${siteRegion}`; const yearMonthFormatter = new Intl.DateTimeFormat(locale, { year: 'numeric', diff --git a/src/pages/feed.ts b/src/pages/feed.ts index fbe8475..e437265 100644 --- a/src/pages/feed.ts +++ b/src/pages/feed.ts @@ -2,7 +2,7 @@ import rss from '@astrojs/rss'; import type { APIContext } from 'astro'; import { getCollection } from 'astro:content'; import invariant from 'tiny-invariant'; -import { SITE_DESCRIPTION, SITE_TITLE } from '../consts'; +import { siteDescription, siteTitle } from '../consts'; import { getBlogDescription } from '../lib/get-blog-description'; export async function GET(context: APIContext) { @@ -25,8 +25,8 @@ export async function GET(context: APIContext) { .then((promises) => Promise.all(promises)); return rss({ - title: SITE_TITLE, - description: SITE_DESCRIPTION, + title: siteTitle, + description: siteDescription, site: context.site, items, trailingSlash: false, diff --git a/src/pages/index.astro b/src/pages/index.astro index 8c47bcf..de20d90 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -4,7 +4,7 @@ import { getCollection, getEntry } from 'astro:content'; import type { DetailsListItem } from '../components/DetailsList.astro'; import DetailsList from '../components/DetailsList.astro'; import PageHeader from '../components/PageHeader.astro'; -import { SITE_DESCRIPTION, SITE_TITLE } from '../consts'; +import { siteDescription, siteTitle } from '../consts'; import Layout from '../layouts/Layout.astro'; import { getBlogDescription } from '../lib/get-blog-description'; import { renderDateToHtml } from '../lib/render-date-to-html'; @@ -129,10 +129,10 @@ const latestBlogItems = await getCollection('blog') .then((promises) => Promise.all(promises)); --- - +
-

{SITE_DESCRIPTION}

+

{siteDescription}

監訳を担当した書籍『Every Layout——モジュラーなレスポンシブデザインを実現するCSS設計論