Repository: ebisucom/next-react-website Branch: main Commit: 7217e8a8ad9d Files: 164 Total size: 103.2 KB Directory structure: gitextract_acizzom2/ ├── README.md ├── blog/ │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── components/ │ │ ├── accordion.js │ │ ├── contact.js │ │ ├── container.js │ │ ├── convert-body.js │ │ ├── convert-date.js │ │ ├── footer.js │ │ ├── header.js │ │ ├── hero.js │ │ ├── layout.js │ │ ├── logo.js │ │ ├── meta.js │ │ ├── nav.js │ │ ├── pagination.js │ │ ├── post-body.js │ │ ├── post-categories.js │ │ ├── post-header.js │ │ ├── posts.js │ │ ├── social.js │ │ └── two-column.js │ ├── jsconfig.json │ ├── lib/ │ │ ├── api.js │ │ ├── constants.js │ │ ├── extract-text.js │ │ ├── gtag.js │ │ └── prev-next-post.js │ ├── next.config.js │ ├── package.json │ ├── pages/ │ │ ├── _app.js │ │ ├── _document.js │ │ ├── about.js │ │ ├── api/ │ │ │ └── hello.js │ │ ├── blog/ │ │ │ ├── [slug].js │ │ │ ├── category/ │ │ │ │ └── [slug].js │ │ │ └── index.js │ │ └── index.js │ └── styles/ │ ├── accordion.module.css │ ├── contact.module.css │ ├── container.module.css │ ├── footer.module.css │ ├── globals.css │ ├── header.module.css │ ├── hero.module.css │ ├── layout.module.css │ ├── logo.module.css │ ├── nav.module.css │ ├── pagination.module.css │ ├── post-body.module.css │ ├── post-categories.module.css │ ├── post-header.module.css │ ├── posts.module.css │ ├── social.module.css │ ├── two-column.module.css │ └── utils.module.css ├── blog-app-router/ │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── app/ │ │ ├── about/ │ │ │ └── page.js │ │ ├── api/ │ │ │ ├── hello/ │ │ │ │ └── route.js │ │ │ └── revalidate/ │ │ │ └── route.js │ │ ├── blog/ │ │ │ ├── [slug]/ │ │ │ │ └── page.js │ │ │ ├── category/ │ │ │ │ └── [slug]/ │ │ │ │ └── page.js │ │ │ └── page.js │ │ ├── layout.js │ │ ├── not-found.js │ │ ├── page.js │ │ └── sitemap.js │ ├── components/ │ │ ├── accordion.js │ │ ├── contact.js │ │ ├── container.js │ │ ├── convert-body.js │ │ ├── convert-date.js │ │ ├── footer.js │ │ ├── googleanalytics.js │ │ ├── header.js │ │ ├── hero.js │ │ ├── layout.js │ │ ├── logo.js │ │ ├── meta.js │ │ ├── nav.js │ │ ├── pagination.js │ │ ├── post-body.js │ │ ├── post-categories.js │ │ ├── post-header.js │ │ ├── posts.js │ │ ├── social.js │ │ └── two-column.js │ ├── jsconfig.json │ ├── lib/ │ │ ├── api.js │ │ ├── baseMetadata.js │ │ ├── constants.js │ │ ├── extract-text.js │ │ ├── gtag.js │ │ └── prev-next-post.js │ ├── next.config.js │ ├── package.json │ └── styles/ │ ├── accordion.module.css │ ├── contact.module.css │ ├── container.module.css │ ├── footer.module.css │ ├── globals.css │ ├── header.module.css │ ├── hero.module.css │ ├── layout.module.css │ ├── logo.module.css │ ├── nav.module.css │ ├── pagination.module.css │ ├── post-body.module.css │ ├── post-categories.module.css │ ├── post-header.module.css │ ├── posts.module.css │ ├── social.module.css │ ├── two-column.module.css │ └── utils.module.css ├── blog-chap6/ │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── components/ │ │ ├── contact.js │ │ ├── container.js │ │ ├── footer.js │ │ ├── header.js │ │ ├── hero.js │ │ ├── layout.js │ │ ├── logo.js │ │ ├── meta.js │ │ ├── nav.js │ │ ├── post-body.js │ │ ├── social.js │ │ └── two-column.js │ ├── jsconfig.json │ ├── lib/ │ │ └── constants.js │ ├── next.config.js │ ├── package.json │ ├── pages/ │ │ ├── _app.js │ │ ├── _document.js │ │ ├── about.js │ │ ├── api/ │ │ │ └── hello.js │ │ ├── blog/ │ │ │ └── index.js │ │ └── index.js │ └── styles/ │ ├── contact.module.css │ ├── container.module.css │ ├── footer.module.css │ ├── globals.css │ ├── header.module.css │ ├── hero.module.css │ ├── layout.module.css │ ├── logo.module.css │ ├── nav.module.css │ ├── post-body.module.css │ ├── social.module.css │ ├── two-column.module.css │ └── utils.module.css ├── figma/ │ └── next-react-website.fig ├── images-local/ │ ├── README.md │ └── README.txt ├── images-post/ │ ├── README.md │ └── README.txt └── import/ ├── api-blogs.json ├── api-categories.json ├── contents-blogs.csv └── contents-categories.csv ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ # 作って学ぶ Next.js/React Webサイト構築 ![作って学ぶ Next.js/React Webサイト構築](https://repository-images.githubusercontent.com/510925642/56e98f7c-6e99-47a1-bae1-1203afbd0b82) --- **plaiceholderのバージョンについて[サポートWiki](https://github.com/ebisucom/next-react-website/wiki)に追加しました。 [2023年8月13日]** **「Next.js 13 対応ガイド」(next13.pdf)を速報版から更新しました。 [2023年7月5日]** * **「Next.js 13で本書を進める方法」** * **「本書のプロジェクトをApp Routerへ移行する方法」** **をまとめています。** ※最新の情報は著者NOTE(https://ebisu.com/note/ ) や Twitter ( https://twitter.com/ebisucom ) でも出していますので、参考にしてください。 --- **ダウンロードデータ** セットアップPDFや、本書で作成するプロジェクトデータ、使用する画像素材、インポート用のコンテンツデータなどを収録しています。詳しくは、本書を参照してください。 * [サポートサイト](https://book.mynavi.jp/supportsite/detail/9784839980177.html) * [書籍情報](https://ebisu.com/next-react-website/) ## ■【副読本:Next.js 13 対応ガイド】next13.pdf * 「Next.js 13で本書を進める方法」 * 「本書のプロジェクトをApp Routerへ移行する方法」 をまとめたPDFです。 ## ■【副読本:セットアップPDF】setup.pdf 開発環境などを準備する方法についてまとめたPDFです。 ### setup.pdfの内容 * アカウントの作成[GitHub、microCMS、Vercel、Netlify、Figma] * 開発環境の準備[Node.js、Git、エディタ(Visual Studio Code)] * サイトの公開と更新 * microCMSで管理するコンテンツの準備 * Figmaとデザインデータの使い方 ## ■【プロジェクトデータ】 本書で作成するブログサイトのプロジェクトデータです。 ディレクトリ | 内容 ---------------- | ----- blog/ | Chapter 10で完成させるプロジェクトデータです。microCMSのデータを使用します。 blog-chap6/ | Chapter 6のプロジェクトデータです。外部データは使用しません。 blog-app-router/ | 「Next.js 13 対応ガイド」(next13.pdf)の「本書のプロジェクトをApp Routerへ移行する方法」で完成させるプロジェクトデータです。 ※プロジェクトデータをそのまま利用する場合、各ディレクトリのルートで ``` npm install ``` を実行してください。 ## ■【デモ】 本書で作成するブログサイトをVercelとNetlifyにデプロイしたものです。 * https://next-react-website.vercel.app * https://next-react-website.netlify.app ## ■【インポートデータ】 microCMS用のフィールドとコンテンツのインポートデータです。 ディレクトリ | ファイル | 内容 ------------ | ----------------------- | --------------------- import/ | api-blogs.json | ブログAPIのフィールド   | contents-blogs.csv | ブログ記事のコンテンツ   | api-categories.json | カテゴリAPIのフィールド   | contents-categories.csv | カテゴリのコンテンツ ## ■【画像データ】 ブログサイトで使用する画像データです。 ディレクトリ | 内容 ------------- | ----- images-local/ | ローカル環境で使用する画像です。 images-post/ | microCMSで使用するアイキャッチ画像と記事本文に挿入する画像です。 ## ■【Figmaのデザインデータ】 Figmaで作成したデザインデータです。 ディレクトリ | ファイル&ディレクトリ | 内容 ------------ | ----------------------- | --------------------------------------------- Figma/ | next-react-website.fig | Figmaのデザインデータ   | jpg/ | FigmaのデザインデータをJPEG画像として出力したもの ## ■ ブログサイトのコンテンツについて ブログサイトのコンテンツは、日本語に特化したrinna株式会社のGPT言語モデル(rinna/japanese-gpt-1b)を使用して生成した文章を編集したものです。 * [rinna/japanese-gpt-1b](https://huggingface.co/rinna/japanese-gpt-1b) [[License](https://huggingface.co/rinna/japanese-gpt-1b#licenese)] ----------------------------------------------- ## ■ ご利用にあたって 本書に記載されている内容や本ダウンロードデータの運用によって、いかなる損害が生じても、株式会社マイナビ出版および著者は責任を負いかねますので、あらかじめご了承ください。 (c)2022 EBISUCOM / マイナビ出版 ================================================ FILE: blog/.eslintrc.json ================================================ { "extends": "next/core-web-vitals" } ================================================ FILE: blog/.gitignore ================================================ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies /node_modules /.pnp .pnp.js # testing /coverage # next.js /.next/ /out/ # production /build # misc .DS_Store *.pem # debug npm-debug.log* yarn-debug.log* yarn-error.log* .pnpm-debug.log* # local env files .env*.local # vercel .vercel ================================================ FILE: blog/README.md ================================================ # ブログサイトのプロジェクト 『作って学ぶ Next.js/React Webサイト構築』のChapter 10で完成させるプロジェクトデータです。 * [サポートサイト](https://book.mynavi.jp/supportsite/detail/9784839980177.html) * [書籍情報](https://ebisu.com/next-react-website/) ================================================ FILE: blog/components/accordion.js ================================================ import { useState, useRef } from 'react' import styles from 'styles/accordion.module.css' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faCircleChevronDown } from '@fortawesome/free-solid-svg-icons' export default function Accordion({ heading, children }) { const [textIsOpen, setTextIsOpen] = useState(false) const toggleText = () => { setTextIsOpen((prev) => !prev) } const refText = useRef(null) return (

{children}
) } ================================================ FILE: blog/components/contact.js ================================================ import Social from 'components/social' import styles from 'styles/contact.module.css' export default function Contact() { return (

Contact

cube@web.mail.address
) } ================================================ FILE: blog/components/container.js ================================================ import styles from 'styles/container.module.css' export default function Container({ children, large = false }) { return (
{children}
) } ================================================ FILE: blog/components/convert-body.js ================================================ import parse from 'html-react-parser' import Image from 'next/image' export default function ConvertBody({ contentHTML }) { const contentReact = parse(contentHTML, { replace: (node) => { if (node.name === 'img') { const { src, alt, width, height } = node.attribs return ( {alt} ) } }, }) return <>{contentReact} } ================================================ FILE: blog/components/convert-date.js ================================================ import { parseISO, format } from 'date-fns' import ja from 'date-fns/locale/ja' export default function ConvertDate({ dateISO }) { return ( ) } ================================================ FILE: blog/components/footer.js ================================================ import Container from 'components/container' import Logo from 'components/logo' import Social from 'components/social' import styles from 'styles/footer.module.css' export default function Footer() { return ( ) } ================================================ FILE: blog/components/header.js ================================================ import Container from 'components/container' import Logo from 'components/logo' import Nav from 'components/nav' import styles from 'styles/header.module.css' export default function Header() { return (
) } ================================================ FILE: blog/components/hero.js ================================================ import styles from 'styles/hero.module.css' import Image from 'next/image' import cube from 'images/cube.jpg' export default function Hero({ title, subtitle, imageOn = false }) { return (

{title}

{subtitle}

{imageOn && (
)}
) } ================================================ FILE: blog/components/layout.js ================================================ import Header from 'components/header' import Footer from 'components/footer' export default function Layout({ children }) { return ( <>
{children}