The solution to the failure to obtain Twikoo comments caused by Vercel being walled

insert image description here

Link to the original text: The solution to the failure to obtain Twikoo comments caused by Vercel being walled

foreword

Due to the Dns pollution of Vercel's official domain name, the Twikoo comments deployed by Vercel cannot obtain data normally. When configuring Twikoo comments, if the envId uses the domain name that comes with vercel (similar to https://xxxxx.vercel.app/ ), you will encounter the above problems.

The solution is to replace vercel's domain name with a custom domain name, please refer to custom-domains#dns-records for details .

step

Create a second-level domain name

Here we mainly talk about the steps of adding a second-level domain name. Since I am the domain name of Alibaba Cloud, I will use Alibaba Cloud as an example.
My first-level domain name is tzy1997.com, second-level domain name twikoo.tzy1997.com. The second-level domain name here, the name (xxx.tzy1997.com) can be taken casually.

  1. Log in to Alibaba Cloud Server Workbench and search for the domain name.
    insert image description here
  2. Click [Console Entry] sub-item [Domain Name] to enter the domain name console, and click [Domain Name List].
    insert image description here
  3. Click [Resolution] in the operation of the target domain name to enter the [Resolution Settings] interface, and click [Domain Name Resolution] on the left column to enter the [Domain Name Resolution] page.
  4. Click [Add Domain Name] in [Domain Name Resolution], and the following picture appears:
  5. Click [TXT authorization verification], the following information will appear, remember to save this information.
  6. Enter the [Analysis Settings] interface, click [Add Record], and fill in the corresponding information in the previous step.
  7. After adding the record, go back to step 5, click Verify, and [Verified successfully, confirm adding domain name] will appear.
  8. Click the [Verified successfully, confirm to add domain name] button, and the second-level domain name will be created.

Resolve the second-level domain name to Vercel

You can refer to the document custom-domains#dns-records , and add the following two resolution records in the second-level domain name.

It can also be added in my own way:

host record record type Parse request source (isp) record value TTL
twikoo CNAME default cname.vercel-dns.com 10 minutes
@ A default 76.76.21.21 10 minutes

Add Domains to Vercel project

Go to [Project Settings] -> [Domains] to add a domain name.

Replace envId

Modify the following content in the theme configuration file _config.butterfly.yml, and fill in your environment id in the corresponding position

# Twikoo
# https://github.com/imaegoo/twikoo
twikoo:
  envId: https://twikoo.tzy1997.com/ 
  region: 
  visitor: true
  option:

Finally, don't forget to recompile and run, and you can see the effect after running.

Guess you like

Origin blog.csdn.net/qq_41356250/article/details/127537067