The comment system is disabled globally by default, managed by commentConfig.ts. Twikoo is currently supported. Following the zero-overhead principle: when disabled, no external requests are made, no extra DOM is added, and the bundle does not grow.
Tip
Lazy Loading Strategy Keep lazy: true enabled by default. Comment scripts load on-demand only when the reader scrolls near the bottom comment section, preserving zero initial bundle overhead.
The config resolver returns null (comments render nothing, zero DOM) in any of these cases:
enable is false
provider is "none"
envId or scriptUrl is empty
The component loads dynamically only when all conditions are met. Combined with lazy: true, the comment script is requested only when the reader scrolls to the bottom—first-screen performance is untouched.
The comment system is disabled globally by default, managed by
commentConfig.ts. Twikoo is currently supported. Following the zero-overhead principle: when disabled, no external requests are made, no extra DOM is added, and the bundle does not grow.Tip
Lazy Loading Strategy Keep
lazy: trueenabled by default. Comment scripts load on-demand only when the reader scrolls near the bottom comment section, preserving zero initial bundle overhead.Config Overview
enablebooleanfalsefalseloads no comment scripts or DOMprovider"none"/"twikoo""none"lazybooleantruetwikoo.envIdstring""twikoo.scriptUrlstringtwikoo.langstring"auto"autofollows the sitetwikoo.placeholderstringEnabling Twikoo Comments
Deploy a Twikoo server and obtain the environment ID. Tencent CloudBase, Vercel, Railway, and self-hosted deployments are supported.
Update the config: set
enabletotrue,providerto"twikoo", and fill inenvId:Rebuild and deploy—the comment component appears at the bottom of posts.
Resolution Rules
The config resolver returns
null(comments render nothing, zero DOM) in any of these cases:enableisfalseprovideris"none"envIdorscriptUrlis emptyThe component loads dynamically only when all conditions are met. Combined with
lazy: true, the comment script is requested only when the reader scrolls to the bottom—first-screen performance is untouched.Per-Post Control
Set
comment: falsein a post's frontmatter to disable comments for that post (the global switch must be enabled):The FAB's jump-to-comments button also produces zero DOM for that post (see Floating Controls).
Practical Examples
Localized Chinese comments
Self-hosted CDN script
FAQ
The comment component doesn't appear
Comments slow down the page
What format is envId
The comment language doesn't match the site
Copyright
Copyright Ownership:matsuzaka-yuki
License under:Attribution 4.0 International (CC-BY-4.0)