-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ナビバーにニュースリンクを追加 * ニュース一覧ページの作成 * 個別記事ページ表示用の機能作成 * pluginsの重複している箇所を削除 * 型付けを単一の関数内で行う * ニュースに関するリンクの位置を変更 * GraphQL実行時の型作成 * noindex有効化とリンクのコメントアウト
- Loading branch information
Showing
7 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
slug: "fuga" | ||
title: "VOICEVOXサンプルニュース_2" | ||
date: "2024-07-01" | ||
--- | ||
|
||
この文章は `VOICEVOXサンプルニュース_2` のテストです。 | ||
|
||
## 小見出し | ||
|
||
あいうえお | ||
|
||
### 小見出し | ||
|
||
かきくけこ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
slug: "hoge" | ||
title: "VOICEVOXサンプルニュース_1" | ||
date: "2024-05-01" | ||
--- | ||
|
||
この文章は `VOICEVOXサンプルニュース_1` のテストです。 | ||
|
||
## 小見出し | ||
|
||
あいうえお | ||
|
||
### 小見出し | ||
|
||
かきくけこ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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<Queries.IndexPageQuery>(graphql` | ||
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} | ||
noindex={true} // TODO: リリース時に外す | ||
/> | ||
<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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from "react" | ||
import "../components/layout.scss" | ||
import { Page } from "../components/page" | ||
import Seo from "../components/seo" | ||
import { graphql } from "gatsby" | ||
|
||
const NewsPost = ({ data }) => { | ||
const { markdownRemark } = data; | ||
const { frontmatter, html } = markdownRemark; | ||
|
||
return ( | ||
<Page> | ||
<Seo | ||
title={`${frontmatter.title} | ニュース | VOICEVOX`} | ||
description="無料で使える中品質なテキスト読み上げ・歌声合成ソフトウェア。商用・非商用問わず無料で、誰でも簡単にお使いいただけます。イントネーションを詳細に調整することも可能です。" | ||
noindex={true} // TODO: リリース時に外す | ||
/> | ||
<section className="section"> | ||
<div className="container is-max-desktop"> | ||
<h1 className="title">{frontmatter.title}</h1> | ||
<p className="has-text-grey-light">{frontmatter.date}</p> | ||
<div | ||
className="markdown mt-5" | ||
dangerouslySetInnerHTML={{ __html: html }} | ||
/> | ||
</div> | ||
</section> | ||
</Page> | ||
) | ||
} | ||
|
||
export const query = graphql` | ||
query($slug: String!) { | ||
markdownRemark(frontmatter: { slug: { eq: $slug } }) { | ||
html | ||
frontmatter { | ||
slug | ||
title | ||
date(formatString: "YYYY/MM/DD") | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export default NewsPost |