diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-01-12 19:43:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-01-12 21:37:23 +0900 |
| commit | 98abcc023b99898f3a7e182e2330ea809a4c99e2 (patch) | |
| tree | be8aab31e6185dabac929146426a52dd3b98b26c /vhosts/blog/nuldoc-src/components/PageLayout.tsx | |
| parent | f3a77cb2f83ff2f91a5cc78da2bd735ad0d4edec (diff) | |
| download | nsfisis.dev-98abcc023b99898f3a7e182e2330ea809a4c99e2.tar.gz nsfisis.dev-98abcc023b99898f3a7e182e2330ea809a4c99e2.tar.zst nsfisis.dev-98abcc023b99898f3a7e182e2330ea809a4c99e2.zip | |
refactor(blog/nuldoc): convert components/*.ts to TSX
Diffstat (limited to 'vhosts/blog/nuldoc-src/components/PageLayout.tsx')
| -rw-r--r-- | vhosts/blog/nuldoc-src/components/PageLayout.tsx | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/vhosts/blog/nuldoc-src/components/PageLayout.tsx b/vhosts/blog/nuldoc-src/components/PageLayout.tsx new file mode 100644 index 00000000..c7145e0a --- /dev/null +++ b/vhosts/blog/nuldoc-src/components/PageLayout.tsx @@ -0,0 +1,63 @@ +import { Config } from "../config.ts"; +import { JSXNode } from "myjsx/jsx-runtime"; +import StaticStylesheet from "./StaticStylesheet.tsx"; + +type Props = { + metaCopyrightYear: number; + metaDescription: string; + metaKeywords?: string[]; + metaTitle: string; + metaAtomFeedHref?: string; + requiresSyntaxHighlight?: boolean; + config: Config; + children: JSXNode; +}; + +export default function PageLayout( + { + metaCopyrightYear, + metaDescription, + metaKeywords, + metaTitle, + metaAtomFeedHref, + requiresSyntaxHighlight, + config, + children, + }: Props, +) { + return ( + <html lang="ja-JP"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="author" content={config.blog.author} /> + <meta + name="copyright" + content={`© ${metaCopyrightYear} ${config.blog.author}`} + /> + <meta name="description" content={metaDescription} /> + {metaKeywords && metaKeywords.length !== 0 && + <meta name="keywords" content={metaKeywords.join(",")} />} + <meta property="og:type" content="article" /> + <meta property="og:title" content={metaTitle} /> + <meta property="og:description" content={metaDescription} /> + <meta property="og:site_name" content={config.blog.siteName} /> + <meta property="og:locale" content="ja_JP" /> + {metaAtomFeedHref && + ( + <link + rel="alternate" + href={metaAtomFeedHref} + type="application/atom+xml" + /> + )} + <link rel="icon" href="/favicon.svg" type="image/svg+xml" /> + <title>{metaTitle}</title> + <StaticStylesheet fileName="/style.css" config={config} /> + {requiresSyntaxHighlight && + <StaticStylesheet fileName="/hl.css" config={config} />} + </head> + {children} + </html> + ); +} |
