Skip to content

iLek2428/dmg-blog

 
 

Repository files navigation

Riffy Blog

The next iteration of Riffy Blog

Core changes

  • I opt-out from Gatsby to Next because old site is now considered to be too hard to maintain
  • Reduce lots of JS workloads and focus on performance
  • Design by using Tailwind

Demo

blog.rayriffy.com

To install

Create a workspace in Contentful and import content model with this provided JSON files.

Then, create an API token and put those into your environment variables

$ export CONTENTFUL_SPACE_ID=<SPACE ID HERE>
$ export CONTENTFUL_ACCESS_TOKEN=<ACCESS TOKEN HERE>

If you want to use preview feature to show draft post, do following steps as well. First, add additional environment variables.

$ export CONTENTFUL_PREVIEW_ACCESS_TOKEN=<PREVIEW TOKEN HERE>
$ export CONTENTFUL_PREVIEW_SECRET=<YOUR SECRET PASSWORD TO ENABLE PREVIEW MODE>

and then add preview URL into Contentful by going to Settings > Content Preview and then create new content preview, checks for Blog Post type and add following URL into input by replace <CONTENTFUL_PREVIEW_SECRET> with your secret

http://localhost:3000/api/preview?secret=<CONTENTFUL_PREVIEW_SECRET>&slug={entry.fields.slug}

If you cannot find BLog Post to check, means you did not add Preview into sidebar yet. Doing this by click Content Model > Blog Post > Sidebar and click Preview in Available items

If you do this correctly, you should be able to click preview and using this feature right away. But be warned, you can only use this with your localhost environment, if you trying to use this on production deployment it going to soft-lock you. Solve soft-lock by clearing your cookies.

To develop

yarn dev

To build

yarn build

About

My Personal Blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 94.3%
  • JavaScript 5.2%
  • CSS 0.5%