mirror of
https://github.com/yude-jp/yude.jp
synced 2024-12-22 12:10:11 +09:00
Remove microCMS
This commit is contained in:
parent
b446a2ebae
commit
db6855fbc6
@ -1,6 +0,0 @@
|
||||
import { createClient } from 'microcms-js-sdk';
|
||||
|
||||
export const client = createClient({
|
||||
serviceDomain: 'yude',
|
||||
apiKey: process.env.MICROCMS_API_KEY,
|
||||
});
|
@ -1,56 +0,0 @@
|
||||
// Base layout
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// Next.js
|
||||
import Link from "next/link";
|
||||
|
||||
// React
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
// microCMS library
|
||||
import { client } from "../libs/client";
|
||||
|
||||
// next-seo
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
export default function Home({ blog }) {
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
return (
|
||||
<>
|
||||
<NextSeo
|
||||
title="記事一覧"
|
||||
description="yude のブログの記事一覧 / yude's blog posts listing"
|
||||
/>
|
||||
<Layout title={t('common:post_list')}>
|
||||
<div>
|
||||
<h1 className="text-center">{t('common:post_list')}</h1>
|
||||
<ul>
|
||||
{blog.map((blog) => (
|
||||
<li key={blog.id}>
|
||||
<Link href={`/posts/${blog.id}`}>
|
||||
<a>{blog.title}</a>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</Layout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// Passing data to template
|
||||
export const getStaticProps = async () => {
|
||||
const data = await client.get({ endpoint: "blog" });
|
||||
|
||||
return {
|
||||
props: {
|
||||
blog: data.contents,
|
||||
},
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user