Skip to content
Gatsby powered static personal blog
TypeScript CSS JavaScript Shell
Branch: master
Clone or download
Latest commit 1528150 Aug 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode some refactors Feb 13, 2019
assets remove lots of dependencies Apr 15, 2019
contents change content Aug 7, 2019
drafts add article Apr 21, 2019
scripts add content Aug 4, 2019
src add token to get higher github api rate limit Aug 4, 2019
.editorconfig init Jul 30, 2018
.gitignore update dependencies May 31, 2019
.travis.yml fix travis script Apr 23, 2019
LICENSE ready to deploy Aug 2, 2018
README.md add token to get higher github api rate limit Aug 4, 2019
deploy.sh ready to deploy Aug 2, 2018
gatsby-browser.js
gatsby-config.js add token to get higher github api rate limit Aug 4, 2019
gatsby-node.js fix: some articles show in list Jun 5, 2019
package.json change content Aug 7, 2019
tsconfig.json add content Aug 4, 2019
tslint.json some refactors Feb 13, 2019
yarn.lock change content Aug 7, 2019

README.md

VicBlog Gatsby

Travis (.org) Uptime Robot ratio (7 days) Codacy grade style: styled-components

VicBlog is a static personal blog built with Gatsby.

Check it out now!

Features

  • Static website with modern web technologies
  • Hook based state management with simstate
  • Synchronous & Native Search
    • Native support for searching articles without any third-party services
  • Progressive Web Application
  • Support multiple languages (Chinese & English)
  • Styling with styled-components and SCSS
  • Articles written on markdown; Source code and contents separated
    • Supports inline react components
  • Auto generated slide directory using GitHub API v3 on every build
  • Comment system via gitalk
  • Icons via react-icons
  • Analytics via CNZZ

Development

Yarn is required.

Notice: If an environment variable is named GITHUB_TOKEN, it will be used to authenticate GitHub requests to fetch slides (to get higher rate limit for CI). If it does not exist, an anonymous request is used, which is adequate for local development. Remove the environment variable GITHUB_TOKEN before getting started.

# install dependencies
yarn

# Install dependencies From TaoBao
yarn iftb

# serve with hot reload at localhost:8000
yarn dev

# run production build
yarn build

# **After build**, serve the production build locally
yarn serve

# Update dependencies with npm-check-updates and update the package.json
yarn upddep

Firewall Notice

A dependency sharp needs to pull prebuilt binaries from GitHub releases during installation. GitHub hosts release files on AWS, which is sometimes blocked in China. Failure to download these files will cause failure in installation and following steps.

Thankfully, according to the official docs, we can change the base url for this file. With the help of python 3's http.server module, we can start a local http server and serve the file from local.

If you encountered download error mentioned above, follow the following steps to complete installation:

  1. Download the file yourself and place the file into a directory
  2. Run python -m http.server {port} --bind {url} and keep it running until the installation completes.
  3. Set the environment variable SHARP_DIST_BASE_URL to http://{url}:{port}
  4. npm install and you are ready to go!

Continuous Integration and Delivery

Travis-CI builds and publishes directly into viccrubs.github.io for every commit to master.

Credits

Built with Gatsby - the blazing-fast static site generator for React.

You can’t perform that action at this time.