使用 Gatsby 构建博客,Gatsby 是一个基于 React 和 Graphql 的静态 html 构建网站,可以用于博客搭建,使用 markdown 文件,通过 markdownRemark 转化为 html;项目在基于 Gatsby default starter 的基础上,增加了 sass 预处理,使用 rem 和 vw 布局,360 - 540 下字体大小随视口大小变化
-
Create a Gatsby site.
git clone repo
git clone https://github.com/violet0sea/the-great-gatsby.git
-
Start developing.
Navigate into your new site’s directory and start it up.
cd the-greate-gatsby yarn install yarn add gatsby -g gatsby develop
-
Open the source code and start editing!
Your site is now running at
http://localhost:8000
!Note: You'll also see a second link:
http://localhost:8000/___graphql
. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.
可以尝试在/src/pages/blog 下添加 markdown 文件,页面会自动生成相应的路由