diff --git a/README.md b/README.md index a8ea881..ef3ba6a 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,8 @@ Source code of [yude.jp](https://yude.jp).\ Built with [Next.js](https://nextjs.org/) and [Tailwind CSS](https://tailwindcss.com/) and deployed on [Vercel](https://vercel.com). ## Development -### Setup -1. Run `yarn`. -1. Copy `.env.local.sample` as `.env.local` and set value. -### Preview -* Run `yarn dev`. +1. Run `yarn` to install dependencies. +2. Run `yarn dev` to serve. ## License This repository is provided under the MIT License. diff --git a/package.json b/package.json index 61a1c0a..da14d5f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "autoprefixer": "^10.3.4", "axios": "^0.21.4", "date-fns": "^2.24.0", - "microcms-js-sdk": "^1.2.0", "moment": "^2.29.1", "next": "^11.1.3", "next-export-i18n": "^1.2.1", diff --git a/pages/posts/[id].js b/pages/posts/[id].js deleted file mode 100644 index cf4da22..0000000 --- a/pages/posts/[id].js +++ /dev/null @@ -1,58 +0,0 @@ -// Base layout -import Layout from "../components/Layout" - -// microCMS library -import { client } from "../../libs/client"; - -// next-seo -import { NextSeo } from 'next-seo'; - -// React -import * as React from "react"; - -// React Moment -import Moment from 'react-moment'; - -export default function BlogId({ blog }) { - return ( - <> - - -

{blog.title}

-

- - {blog.updated} - -

-
- - - ); -} - -// Specify path for static generator -export const getStaticPaths = async () => { - const data = await client.get({ endpoint: "blog" }); - - const paths = data.contents.map((content) => `/posts/${content.id}`); - return { paths, fallback: false }; -}; - -// Passing data to template -export const getStaticProps = async (context) => { - const id = context.params.id; - const data = await client.get({ endpoint: "blog", contentId: id }); - - return { - props: { - blog: data, - }, - }; -}; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index f95d2b1..b1fb1fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3090,14 +3090,6 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -microcms-js-sdk@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/microcms-js-sdk/-/microcms-js-sdk-1.2.0.tgz#ad61d35c849fb7dfdda47fc66df2a4069e2ced9e" - integrity sha512-ipjiRb4B2ASI2BoDhmusALn7UV7OXIQ38WSdRUDfekBIk34ZjLplPTYq3XDAqQBtoOgA6mKnY/67YIeO4C4jDw== - dependencies: - node-fetch "^2.6.1" - qs "^6.10.1" - micromark-core-commonmark@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.0.1.tgz#a64987cafe872e8b80bc8f2352a5d988586ac4f1" @@ -3545,13 +3537,6 @@ node-fetch@2.6.1: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== -node-fetch@^2.6.1: - version "2.6.4" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.4.tgz#7f1d13b8f9ff0c1a994dc6f73c69f7d652c7ace2" - integrity sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA== - dependencies: - whatwg-url "^5.0.0" - node-html-parser@1.4.9: version "1.4.9" resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-1.4.9.tgz#3c8f6cac46479fae5800725edb532e9ae8fd816c" @@ -4131,13 +4116,6 @@ purgecss@^4.0.3: postcss "^8.2.1" postcss-selector-parser "^6.0.2" -qs@^6.10.1: - version "6.10.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== - dependencies: - side-channel "^1.0.4" - querystring-es3@0.2.1, querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -5023,11 +5001,6 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - trough@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/trough/-/trough-2.0.2.tgz#94a3aa9d5ce379fc561f6244905b3f36b7458d96" @@ -5298,11 +5271,6 @@ watchpack@^2.2.0: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -5343,14 +5311,6 @@ webpack@^5.53.0: watchpack "^2.2.0" webpack-sources "^3.2.0" -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - whatwg-url@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06"