-
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.
Merge pull request #6 from flyhaozi:projs-blogs
Improve projects & blog page
- Loading branch information
Showing
14 changed files
with
238 additions
and
144 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
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,10 +1,19 @@ | ||
import Head from 'next/head' | ||
import Link from 'next/link' | ||
import cstyles from '../styles/Common.module.css' | ||
|
||
export default function Blog() { | ||
return ( | ||
<section className={cstyles.section}> | ||
<h2>Blog</h2> | ||
<h2>Under Construction</h2> | ||
<Head > | ||
<title>Blog | fHz</title> | ||
<meta property="og:title" content="Blog | fHz" key="title" /> | ||
<meta property="og:url" content="https://flyhaozi.com/blog" key="url" /> | ||
</Head> | ||
<h2>Blog (Under Construction)</h2> | ||
<ul className={cstyles.blogList}> | ||
<li><span>2021-10-01</span><Link href="/blog/2021-national-day"><a >Celebrate The 2021 National Day!!! 🎉✨</a></Link></li> | ||
</ul> | ||
</section> | ||
) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 +1,60 @@ | ||
import { promises as fs } from 'fs' | ||
import matter from 'gray-matter' | ||
import path from 'path' | ||
import Link from 'next/link' | ||
import Head from 'next/head' | ||
import cstyles from '../styles/Common.module.css' | ||
|
||
export default function Projects() { | ||
export default function Projects({ projectInfos }) { | ||
return ( | ||
<section className={cstyles.section}> | ||
<Head > | ||
<title>Projects | fHz</title> | ||
<meta property="og:title" content="Projects | fHz" key="title" /> | ||
<meta property="og:url" content="https://flyhaozi.com/projects" key="url" /> | ||
</Head> | ||
<h2>Projects</h2> | ||
<h2>Under Construction</h2> | ||
<div className={cstyles.cardContainer}> | ||
{ | ||
projectInfos.map(info => { | ||
return <Link href={'/' + info.path} key={info.path}> | ||
<a className={cstyles.projectCard}> | ||
<div className={cstyles.projectBasic}> | ||
<div> | ||
<p className={cstyles.projectType}>{info.type}</p> | ||
<p className={cstyles.projectName}>{info.title}</p> | ||
</div> | ||
<img className={cstyles.projectImg}></img> | ||
</div> | ||
<p className={cstyles.projectDesc}>{info.description}</p> | ||
</a> | ||
</Link> | ||
}) | ||
} | ||
</div> | ||
</section> | ||
) | ||
} | ||
|
||
export async function getStaticProps(context) { | ||
const projectsDir = path.join(process.cwd(), 'projects'); | ||
const projectNames = await fs.readdir(projectsDir); | ||
const projectInfos = await Promise.all(projectNames.map(async name => { | ||
const projPath = path.join(projectsDir, name); | ||
const projSource = await fs.readFile(projPath, 'utf8'); | ||
const { data } = matter(projSource); | ||
return data; | ||
})); | ||
|
||
if (!projectInfos) { | ||
return { | ||
notFound: true, | ||
} | ||
} | ||
|
||
projectInfos.sort((p1, p2) => p1.order.localeCompare(p2.order)); | ||
|
||
return { | ||
props: { projectInfos } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
path: twitter-nsfw-expander | ||
title: NSFW Expander for Twitter | ||
description: Expand NSFW contents and accounts on Twitter automatically without logging in. | ||
type: Userscript | ||
order: z | ||
links: | ||
- https://sleazyfork.org/scripts/428873-nsfw-expander-for-twitter | ||
- https://github.com/flyhaozi/NSFW-Expander-for-Twitter | ||
--- | ||
## NSFW Expander for Twitter | ||
[![](https://img.shields.io/github/stars/flyhaozi/NSFW-Expander-for-Twitter?style=social)](https://github.com/flyhaozi/NSFW-Expander-for-Twitter) | ||
|
||
This script expands NSFW contents and accounts on Twitter automatically without logging in. | ||
|
||
## ⚠ Caution | ||
The script will ignore your sensitivity settings when you are logged in, please disable it when you are at work. |
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
Oops, something went wrong.