Skip to content

v0.5.0

Compare
Choose a tag to compare
@daiyanze daiyanze released this 15 Jan 13:23
· 14 commits to master since this release
55e7b8e

Breaking Changes & Features

From this version on, there're some big changes for this plugin. Please read the content below to make sure that the changes are able to fully function on your side.

1. Upgrade Gatsby to V5.0

Gatsby v5 has changed quite a lot of things. It didn't take much time for gatsby-plugin-pitayan to migrate from v4. Thus, it would be a pleasant experience for you as well.

To smoothly migrate your site to Gatsby v5, you'll have to do the following steps.

  • Read Gatsby V5 manual here. https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v4-to-v5/
    If you manually tweaked anything, make those changes align with the Gatsby v5 standards.
  • Upgrade Nodejs to >= v18.0.0. (FYI, dependencies of react & react-dom now are also upgraded to >=v18.0.0.)
  • Make sure the 3rd party plugins you're using all support Gatsby V5. If not, there might be some bumbles of starting up local development server.
  • Remove the package-lock.json in case there're warnings against your upgrade.
  • Execute npm install to get the updated dependencies
  • Remove the Gatsby cache (usually it's .cache) from your project root folder before you "npm run develop".

2. Table of Contents

It's created under responsive design for the post page which is displayed under "large screen" devices (browsers). It's sticky to the top of the post component and has active states for each of the item within it.

By default, this ToC will only show item up to 2 levels. Suppose your content is having from H1 till H3. Only the H1 and H2 will be displayed in the ToC list. However, it's editable via a plugin option of tableOfContentsLevels.

plugins: [
    {
      resolve: `@pitayan/gatsby-theme-pitayan`,
      options: {
        siteAssets: "src/assets",
        postsPerPage: 10,
        tableOfContentsLevels: 3,
...

In order to center the post component, the sharing group buttons were attached to the left side of post component for the balance. It's also sticky to the top of the post component.

image

PRs

Full Changelog: v0.4.3...v0.5.0