banner
YZ

周周的Wiki

种一棵树最好的时间是十年前,其次是现在。
zhihu
github
csdn

Tencent Cloud Object Storage (COS) + PicGo Build an Automated Obsidian Image Hosting

image.png

Preface#

Considering the need to distribute Obsidian notes to multiple platforms, one of the most cumbersome tasks is to repeatedly copy and paste images in the articles. To reduce this repetitive workload, one solution used here is to use Tencent Cloud Object Storage as an image hosting tool, and build an automated image uploading process with the help of the image uploading tool PicGo and the Obsidian plugin image auto upload plugin.

Preparation#

Register Tencent Cloud and enable Object Storage service#

  1. Visit the Tencent Cloud official website to register an account and complete the real-name verification. It is recommended to register using WeChat.
    image

  2. After entering the console, select Object Storage. The first-time activation comes with a 6-month free quota resource package.
    image

  3. Select Create Bucket.
    image

  4. Fill in the basic information. Make sure to check the option for Public Read permission to ensure that the images you upload can be accessed publicly.
    image

  5. The advanced configuration can be left as default, or adjusted according to your needs.
    image

  6. After successful creation, you can create a folder to manage the uploaded images.
    image

Obtain the access key information#

  1. In the console, go to Common Tools > Key Management and click Access Keys.
    image

  2. Click Create Key to generate a new access key. You can copy and save it securely. (It will be used in PicGo later)
    image

Install PicGo#

  1. Go to the PicGo official website and choose any download source to download and install PicGo.
  2. Once installed, open the software.
    image

Configure Tencent Cloud COS in PicGo#

For detailed documentation, please visit the PicGo configuration manual.

Here, I will provide the configuration for version 5:
image

  1. APPID, SecretId, and SecretKey can be obtained from the Key Management section.
    image

  2. The bucket name and storage region code can be obtained from the bucket list in your console.
    image

  3. Test if the upload is successful
    Go back to PicGo, select Tencent Cloud COS, and upload an image.
    image
    If the upload is successful, proceed to the next step to set up automatic image uploading in Obsidian.
    image

Install the image auto upload plugin in Obsidian#

  1. In Obsidian, go to Settings > Third-party Plugins > Community Plugins, and search for "image auto upload". Install and enable the plugin.
    image

  2. Note: Use the default settings and ==make sure PicGo is running in order to achieve automatic uploading==.
    image.png
    Afterwards, whenever you paste an image while writing notes in Obsidian, it will be automatically uploaded to Tencent Cloud Object Storage instead of being saved locally, and a link to the image will be automatically returned.

Bulk upload all images in previous articles#

  1. In the article where you want to upload images, use the shortcut ==Ctrl + P== to open the command palette, type ==upload all images==, and press Enter to start the automatic upload. It can also replace the original image links. Perfect!
    image.png
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.