-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wutali
committed
Aug 13, 2020
1 parent
66ca1e1
commit d007492
Showing
13 changed files
with
84 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
url: https://wutali-nextjs-netlify-blog.netlify.app/ | ||
site_title: Next.js Netlify Blog | ||
site_description: Next.js blog template for Netlify | ||
category_visible: true | ||
tag_visible: true | ||
posts_per_page: 5 |
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,10 @@ | ||
type Settings = { | ||
readonly url: string; | ||
readonly site_title: string; | ||
readonly site_description: string; | ||
readonly posts_per_page: number; | ||
}; | ||
|
||
const settings = require("../../settings.yml") as Settings; | ||
|
||
export default settings; |
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
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
slug: license | ||
title: License | ||
date: "2020-06-08" | ||
category: back-end | ||
tags: | ||
- golang | ||
- react | ||
|
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 |
---|---|---|
@@ -1,5 +1,32 @@ | ||
import Layout from "../../../../components/Layout"; | ||
import { GetStaticProps, GetStaticPaths } from "next"; | ||
import { listPostContent } from "../../../../lib/posts"; | ||
import { listTags } from "../../../../lib/tags"; | ||
import settings from "../../../../lib/settings"; | ||
|
||
export default function () { | ||
return <Layout>posts/tags/[slug]/</Layout>; | ||
} | ||
|
||
export const getStaticProps: GetStaticProps = async ({ params }) => { | ||
const posts = listPostContent( | ||
1, | ||
settings.posts_per_page, | ||
params.slug as string | ||
); | ||
return { | ||
props: { | ||
posts, | ||
}, | ||
}; | ||
}; | ||
|
||
export const getStaticPaths: GetStaticPaths = async () => { | ||
const paths = listTags().map((it) => ({ | ||
params: { slug: it.slug }, | ||
})); | ||
return { | ||
paths: paths, | ||
fallback: false, | ||
}; | ||
}; |