Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ニュースページの追加 #196

Merged
merged 8 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ module.exports = {
path: `${__dirname}/src/markdowns`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `news`,
path: `${__dirname}/src/markdowns/news`,
},
},
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
`gatsby-transformer-json`,
`gatsby-transformer-yaml`,
{
Expand Down
3 changes: 3 additions & 0 deletions src/components/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export const Page: React.FC<{
<Link to={"/term/"} className="navbar-item">
利用規約
</Link>
<Link to={"/news/"} className="navbar-item">
ニュース
</Link>
<Link to={"/how_to_use/"} className="navbar-item">
使い方
</Link>
Expand Down
8 changes: 8 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,14 @@ const Main = React.memo(
利用規約
</Link>
</li>
<li>
<Link
to={"/news/"}
className="has-text-weight-bold is-underlined"
>
ニュース
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

変更履歴の左くらいに移動させていただくかもです!

</Link>
</li>
<li>
<Link
to={"/how_to_use/"}
Expand Down
53 changes: 53 additions & 0 deletions src/pages/news/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from "react"
import "../../components/layout.scss"
import { Page } from "../../components/page"
import Seo from "../../components/seo"
import { Link, graphql, useStaticQuery } from "gatsby"
import shareThumb from "../../images/nemo/share-thumbnail.png"

const NewsIndex = () => {
const data = useStaticQuery(graphql`
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
query IndexPage {
allMarkdownRemark (
filter: {fileAbsolutePath: {regex: "/news/"}}
sort: {frontmatter: {date: DESC}}
) {
edges {
node {
html
frontmatter {
title
slug
date(formatString: "YYYY/MM/DD")
}
}
}
}
}
`);

return (
<Page>
<Seo
title="ニュース | VOICEVOX"
description="無料で使える中品質なテキスト読み上げ・歌声合成ソフトウェア。商用・非商用問わず無料で、誰でも簡単にお使いいただけます。イントネーションを詳細に調整することも可能です。"
image={shareThumb}
/>
<section className="section">
<div className="container is-max-desktop">
<h1 className="title">ニュース</h1>
{data.allMarkdownRemark.edges.map((edge) => (
<div key={edge.node.frontmatter.slug} className="mb-3">
<Link to={`/news/${edge.node.frontmatter.slug}`}>
{edge.node.frontmatter.title}
</Link>
<p className="has-text-grey-light">{edge.node.frontmatter.date}</p>
</div>
))}
</div>
</section>
</Page>
)
}

export default NewsIndex
Loading