How to effectively and quickly replace jsdelivr links in Hexo articles

Original link: https://qzkyl.ml/posts/3462.html

foreword

Recently, I haven’t paid attention to the network dynamics for a long time, so that cdn.jsdelivr.net paralyzed without knowing it, and I need friends to feel very distressed about it.

In fact, this tool was taken into consideration when I contacted Hexo , so I wrote down this tool and Shell commands. Today, I improved the operation process smoothly

There are two ways, you can choose according to your needs (I think it should also be more practical on the PC side)

The PC tool supports the replacement of content, and can obtain the date and time in the article to uniformly modify the file attribute time. Useful for articles with unchanged content, or blogs that display articles with the last modification time.

PC tool (highly recommended)

Open the tool, select the directory where the article is located, enter the content to be replaced and the content to be replaced, and click Start to replace.

Whether the replacement is successful, the number of successful replacements will be prompted at the end (equal to the number of your articles)

Download address: 20220530 update.exe

Shell commands

Time is in a hurry, only quick replacement content is written, and it does not have the function of modifying data time.

Shell command:

 1
 sed -i 's/ cdn.jsdelivr.net /fastly.jsdelivr.net /g' * md

cd to the directory where the article is located, and execute the above command to quickly replace the content of cdn.jsdelivr.net with fastly.jsdelivr.net . Change it according to your needs

Kind tips

The PC tool is non-toxic and harmless, written in easy language, and you can choose to delete it if you report poison.

This tool works in most environments, Hexo is just one example.

This article is reprinted from: https://qzkyl.ml/posts/3462.html
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment