Code Monkey home page Code Monkey logo

gatsby-theme-usubeni's Introduction

Usubeni

Usubeni is based on Gatsby.js v5, with example pages available at: https://ssshooter.com/tag/coding/

Gatsby has a slightly higher learning curve compared to Hexo, but it offers greater flexibility in return. Some of the related issues are explained in the blog.

P.S. Gatsby.js v4 version is available here

Usage

Fork or clone this project, install the dependencies, and it is recommended to use yarn. Then:

  • Modify gatsby-config.js
  • Modify src\settings.js
  • The iconfont folder is src\css\icon, please replace it if necessary, but be sure to modify the icon name in the configuration file to avoid display issues
  • Replace the theme image src\assets\yozakura.jpg
  • Replace the logo static\logo.png
  • It is recommended to write blog posts on the master branch, keep the theme branch for theme updates (you can also submit a PR), and then merge it into the master branch
  • Add new articles in the pages folder, or create them using node createPost post-title or node createPost post-title 2017-07-26

The features of this theme include:

  • Fast (Lighthouse performance score of 90)
  • Gatsby-related dependencies are mostly up to date
  • Integrated code highlighting (prismjs)
  • Integrated LaTeX (katex)
  • Configured .npmrc to alleviate the pain of installing dependencies
  • Added TOC (Table of Contents)
  • Built-in image library and tag library
  • Built-in (useless) emoji library
  • SEO optimization

Advantages of Gatsby:

  • High degree of freedom for customizing pages
  • One of the few opportunities to experience GraphQL

Disadvantages of Gatsby:

  • Steep learning curve
  • Has multiple dependencies, but not too many, only about 500m ๐Ÿ˜‚

Create Post

node .\createPost.js -t title -d 2023-11-18 -f

-d is optional. Use -f if you want create only a markdown file (it will create a folder by default).

Development

npm start

Deployment

npm run build

Optional services such as Gatsby's own cloud, Vercel, or Netlify.

Deploy with Vercel

Front Matter

---
slug: '/first-post'
date: '2022-07-03T21:00:00.171Z'
title: 'Title'
tags: ['coding']
description: 'This is a test page'
released: true
hidden: false
---

Avoid Similarity

Modify the color variables in the src\css\global.scss folder to use your favorite colors! This is the simplest way to personalize the theme! (We also welcome PRs for attractive color schemes)

Other typesetting optimizations can refer to Typography.js

Comment System

The theme comes with a comment rendering and publishing component (src\components\Comment.js), but the backend is not open source. Experienced developers can make some modifications to integrate their own comment system.

Other systems that can be integrated include:

  • Static solution, Staticman
  • Self-controlled data, valine, waline, twikoo
  • Third-party, Disqus

PWA

This template does not enable PWA. Although you can easily enable PWA functionality through gatsby-plugin-manifest and gatsby-plugin-offline, it is not necessary for personal blogs. Moreover, after enabling PWA, the pre-rendered pages become useless, seemingly due to conflicts between PWA's caching mechanism and multi-page rendering.

Notes

  1. /archive/ is the full article list, /tag/xxx/ is the single tag list.
released: true
hidden: false
  1. The released field in the frontmatter means that it will not be included in page generation, while hidden means that the page will be generated but will not appear in any lists.

Acknowledgements

gatsby-theme-usubeni's People

Contributors

ssshooter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.