<commit_before>import dynamic from 'next/dynamic';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { ReactNode } from 'react';

import TweetButton from './tweet_button';

const HomeButton = dynamic(() => import('./button'), { ssr: false });

const Layout = (params: {
  children: ReactNode;
  title?: string;
  ogImagePath?: string;
  showTweetButton?: boolean;
}): JSX.Element => {
  const ogImageFileName = params.ogImagePath?.replace('/images/', '');
  return (
    <div className="max-w-4xl m-6 lg:m-auto">
      <Head>
        <link rel="icon" href="/favicon.png" />
        <link
          rel="alternate"
          type="application/rss+xml"
          title="horimisli.me"
          href="/feed.xml"
        />
        <meta
          name="og:title"
          content={params.title ?? process.env.NEXT_PUBLIC_SITE_NAME}
        />
        <meta name="description" content="Personal website by horimislime" />
        {ogImageFileName ? (
          <>
            <meta name="twitter:card" content="summary_large_image" />
            <meta
              property="og:image"
              content={`https://${process.env.NEXT_PUBLIC_SITE_DOMAIN}${require(`@public/images/${ogImageFileName}`)}`}
            />
          </>
        ) : (
          <meta name="twitter:card" content="summary" />
        )}
      </Head>
      <header className="py-4">
        <div
          className="text-xl flex space-x-4 justify-between"
          role="navigation"
        >
          <HomeButton />
          <div className="border-2 border-transparent px-2 py-1">
            <div className="menu justify-between">
              {/* <Link href="/entry">
                <a className="ml-4 border-b-4 border-gray-800 font-semibold hover:text-blue-600">
                  Posts
                </a>
              </Link>
              <Link href="/about">
                <a className="ml-4 font-semibold hover:text-blue-600">About</a>
              </Link> */}
            </div>
          </div>
        </div>
      </header><commit_msg>Add workaround<commit_after>import dynamic from 'next/dynamic';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { ReactNode } from 'react';

import TweetButton from './tweet_button';

const HomeButton = dynamic(() => import('./button'), { ssr: false });

const Layout = (params: {
  children: ReactNode;
  title?: string;
  ogImagePath?: string;
  showTweetButton?: boolean;
}): JSX.Element => {
  const ogImageFileName = params.ogImagePath?.replace('/images/', '');
  let ogImageSrc = ''
  try {
    ogImageSrc = `https://${process.env.NEXT_PUBLIC_SITE_DOMAIN}${require(`@public/images/${ogImageFileName}`)}`
  } catch(_) {
    // Workaround for Renovate CI
  }
  return (
    <div className="max-w-4xl m-6 lg:m-auto">
      <Head>
        <link rel="icon" href="/favicon.png" />
        <link
          rel="alternate"
          type="application/rss+xml"
          title="horimisli.me"
          href="/feed.xml"
        />
        <meta
          name="og:title"
          content={params.title ?? process.env.NEXT_PUBLIC_SITE_NAME}
        />
        <meta name="description" content="Personal website by horimislime" />
        {ogImageSrc.length > 0 ? (
          <>
            <meta name="twitter:card" content="summary_large_image" />
            <meta
              property="og:image"
              content={ogImageSrc}
            />
          </>
        ) : (
          <meta name="twitter:card" content="summary" />
        )}
      </Head>
      <header className="py-4">
        <div
          className="text-xl flex space-x-4 justify-between"
          role="navigation"
        >
          <HomeButton />
          <div className="border-2 border-transparent px-2 py-1">
            <div className="menu justify-between">
              {/* <Link href="/entry">
                <a className="ml-4 border-b-4 border-gray-800 font-semibold hover:text-blue-600">
                  Posts
                </a>
              </Link>
              <Link href="/about">
                <a className="ml-4 font-semibold hover:text-blue-600">About</a>
              </Link> */}
            </div>
          </div>
        </div>
      </header>
{'fraction_non_alphanumeric': 0.15388235294117647, 'fraction_numerical': 0.009176470588235295, 'mean_word_length': 1.8938053097345133, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 66, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3594637', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1253, 'n_words': 241}