Skip to content

Commit

Permalink
archive add
Browse files Browse the repository at this point in the history
  • Loading branch information
tubone24 committed May 21, 2020
1 parent cbc28c7 commit 6b432ef
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/templates/period-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ import Sidebar from '../components/Sidebar';
const PeriodSummary = ({ data, pageContext }) => {
const { displayMonth, displayYear } = pageContext;
const { edges, totalCount } = data.allMarkdownRemark;
let title;
let url;
if (displayMonth == null) {
title = `${displayYear}年の記事 (${totalCount}件)`;
url = `https://blog.tubone-project24.xyz/${displayYear}/`;
} else {
title = `${displayYear}${displayMonth}月の記事 (${totalCount}件)`;
url = `https://blog.tubone-project24.xyz/${displayYear}/${displayMonth}`;
}
return (
<div className="container">
<div
Expand All @@ -18,7 +27,7 @@ const PeriodSummary = ({ data, pageContext }) => {

<div className="col-xl-10 col-lg-7 col-md-12 col-xs-12 order-2">
<h2>
{displayYear}{displayMonth}月の記事 ({totalCount})
{title}
</h2>
<ul>
{edges.map(({ node }) => {
Expand All @@ -36,11 +45,11 @@ const PeriodSummary = ({ data, pageContext }) => {
</div>

<SEO
title={`${displayYear}${displayMonth}月の記事`}
url={`https://blog.tubone-project24.xyz/${displayYear}/${displayMonth}`}
title={title}
url={url}
siteTitleAlt="tubone BOYAKI"
isPost={false}
description={`${displayYear}${displayMonth}月の記事`}
description={title}
tag=""
image="https://i.imgur.com/StLyXdu.png"
/>
Expand Down

0 comments on commit 6b432ef

Please sign in to comment.