Using Craft.do as a blog - Next-Craft
slug
next_craft_en
date
Apr 25, 2022
summary
Using Craft.do API and Next.js to generate a static site, and manage all content in Craft.do.
tags
Website
Craft.do
Next.js
status
Published
type
Post
Chinese Version: 用 Craft.do 生成一个博客 — Next-Craft
Last year, I released a script based on Cloudflare Worker to custom Craft.do share page domain. Recently I tried to improve that script and ported it to Next.js.
Source Code
Demo
Quick Start
- Duplicate this demo config page to your space, then share your config page.
- Star and Fork Next-Craft repository.
- Replace your craftConfigShareUrl in blog.config.js file.
- Deploy on Vercel or other Hosting Providers.
Deployment Detail
Duplicate this demo config page to your space, then share your config page.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe59f6afa-0a63-4cf8-8b43-b014d8ee2f33%2FUntitled.png?table=block&id=b70ba596-5147-492a-a820-e9213c17e3de&cache=v2)
Open Next-Craft repository, star and fork it:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F01157598-91cc-4fbb-bd0b-6d8c629c8bea%2FUntitled.png?table=block&id=456e8565-25c5-4f89-93fb-3787e0bc56bb&cache=v2)
In your repository, find the
blog.config.js
file, click the Modify button, and replace the craftConfigShareUrl item in the file with the link to the config page you shared above:![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5316c0e7-621e-48e2-9692-c6ea2e4304b3%2FUntitled.png?table=block&id=944bf513-761b-4647-a6ef-1c30d066f17d&cache=v2)
Your site is now ready for deployment. Here's how to deploy the service. First, open the Vercel, which you can login directly from GitHub.
Create a new Vercel project, select your GitHub repository and click Import button, skip creating a team (Paid Service), leave everything else as default, and click Deploy to complete the deployment.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdea9d23a-cd9b-476d-9a32-36e065fb804c%2FUntitled.png?table=block&id=e2e7c9f4-7fa6-48f7-971e-0407e7802c94&cache=v2)
If you are having trouble deploying, please click here to get in touch with me quickly.
Set Domain
Open your Vercel project, then select Setting->Domains, add your domain name, follow the prompts and wait for the settings to take effect.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F12502de6-8e7a-4777-aad9-97d7eeb9f375%2FUntitled.png?table=block&id=f7e4a845-ec99-4c2c-b694-ce8b711ad29f&cache=v2)