The code for my personal blog. I use it to write about physics, machine learning, sustainability and web development.
The site is fully responsive, built with Gatsby, has fluid typography, relies heavily on React Hooks for stateful function components and CSS grid for layout. It uses the following libraries:
Feel free to reuse the whole or any part of this repo to create your own Gatsby site.
To get this site running locally, you need to have installed git
, gatsby-cli
and yarn
(or npm
). Then follow these steps:
Clone the repo to your machine and change into its directory.
git clone https://github.com/janosh/blog \
&& cd blog
Optionally setup git
hooks (recommended if you intend to open a PR).
git config core.hooksPath src/utils/gitHooks \
&& chmod -R u+x src/utils/gitHooks
Install dependencies.
yarn
Start the dev server. This may take a while on initial compilation since the site uses quite a lot of images which Gatsby creates thumbnails of and then caches.
gatsby develop
The easiest way to get this site published is as follows:
Create an account with netlify.
Install the netlify-cli
.
Login to your account.
netlify login
Connect your GitHub repo with your netlify account for continuous deployment.
netlify init
Finally deploy the site with
netlify deploy
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。