Comment Service

About 3 min

vuepress-theme-hope implements the comment feature with built-in vuepress-plugin-comment2open in new window.

Info

vuepress-theme-hope passes plugins.comment in theme options as plugin options to vuepress-plugin-comment2.

Enable Support page config

Comment feature is enabled globally by default, controlled by plugins.comment.comment options.

Tips

For the complete config item of the plugin ,please see plugin documentationopen in new window.

Comment Provider

Currently you can choose from Giscus, Waline and Twikoo.

Comment service selection

  • Giscus is recommended if your blog or documentation is primarily geared towards programmers.
  • If your blog or documentation is for the general public, Waline is recommended.

Giscus

Giscus is a GitHub Discussion based commenting system that is easy to start.

Preparation

  1. You need to create a public repository and open discussion as a place to store comments
  2. You need to install the Giscus Appopen in new window to have permission to access the corresponding repository.

After completing the above steps, please go to the Giscus pageopen in new window to get your settings. You just need to fill in the repository and Discussion categories, then scroll to the "Enable giscus" section at the bottom of the page and copy the data-repo, data-repo-id, data-category and data-category-id four items as they are required.

Config

Please pass data-repo, data-repo-id, data-category and data-category-id as plugin options as repo, repoId, category categoryId.

Darkmode

To let Giscus use the correct theme, you need to pass a boolean value to <CommentService /> via the darkmode property, indicating whether darkmode is currently enabled.

For other options, see Giscus Configopen in new window.

Waline

Get APP_ID and APP_Key

Sign inopen in new window or sign upopen in new window leancloud. Then create new application in Leancloud, and you will get APP ID / APP Key / APP Master Key.

After that, create a vercel app using the below button.

Vercelopen in new window

Then input your new GitHub repo name and set LEAN_ID, LEAN_KEY and LEAN_MASTER_KEY environment variables in the "Environment Variables" column. APP ID is the value of LEAN_ID, and APP Key to LEAN_KEY, Master Key to LEAN_MASTER_KEY.

Click Deploy button to deploy. It will show you deploy successfully after a minitues time. Then config the vercel link in your theme options:

Tips

Config will be listed on Plugin Configopen in new window.

For more details, please see Waline Docsopen in new window

Twikoo

Vercel Deployment

  1. Apply for MongoDBopen in new window account

  2. Create a free MongoDB database, the recommended region is AWS / N. Virginia (us-east-1)

  3. Click CONNECT on the Clusters page, follow the steps to allow connections from all IP addresses (Why?open in new window), create Database user, and record the database connection string, please change the <password> in the connection string to the database password

  4. Sign up for a Vercelopen in new window account

  5. Click the button below to deploy Twikoo to Vercel in one click

    Vercelopen in new window

  6. Go to Settings - Environment Variables, add the environment variable MONGODB_URI, the value is the database connection string in step 3

  7. Go to Overview, click the link under Domains, if the environment configuration is correct, you can see the prompt "Twikoo cloud function is running normally"

  8. Vercel Domains (with https:// prefix, for example https://xxx.vercel.app) is your environment ID

Loading...