Skip to content

Add OneTag AI widget to chat services - #1007

Open
fengyiqicoder wants to merge 1 commit into
next-theme:masterfrom
fengyiqicoder:onetag-chat
Open

fengyiqicoder wants to merge 1 commit into
next-theme:masterfrom
fengyiqicoder:onetag-chat

Conversation

@fengyiqicoder

Copy link
Copy Markdown

PR Checklist

  • The changes have been tested (for bug fixes / features).
  • Docs in NexT website have been added / updated (for features). Docs PR follows in a comment.

PR Type

  • Feature.

What is the current behavior?

The Chat Services section offers live chat with a person: Chatra, Tidio and Knocket.

What is the new behavior?

Adds OneTag AI as a fourth option. It puts an "ask this page" button on the site: a visitor types a question and gets an answer drawn from the page they are reading. I am the author of OneTag AI.

  • Off by default. Nothing is loaded unless onetag.enable is true and key is set.
  • The key is a public site key issued by the service, not a model provider key. Usage is hard-capped (1,000,000 tokens on the free tier, then it stops) and there is no pay-as-you-go billing, so a key copied from the page source cannot run up a cost.
  • One async script, 7 KB gzipped, rendered in a Shadow DOM, so the theme's styles and the widget's do not touch each other.
  • When a visitor asks, the request carries the question, the text of the page and the data-ref name (which integration loaded the widget). Nothing is sent before that.

Same shape as the Knocket integration: a config block, one partial, one elif.

Tested with a real Hexo 8.1.2 build in Muse, Mist, Pisces and Gemini, in light and dark mode, with PJAX on (the widget stays across navigations and answers from the new page) and at phone width. With sidebar.position: right the button moves to the left corner, so it never covers the sidebar toggle or back-to-top.

  • Screenshots with this changes:
Gemini Muse, dark mode
Gemini Muse dark

How to use?

In NexT _config.yml:

onetag:
  enable: true
  key: # Get it from https://onetagai.com

🤖 Generated with Claude Code

https://claude.ai/code/session_017g16kS8U6SzeKsAZguBPEn

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017g16kS8U6SzeKsAZguBPEn
@CLAassistant

CLAassistant commented Nov 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown

This pull request contains changes to the configuration file. Please make sure the documentation in NexT website is changed or added.
Please edit relevant source files here: https://github.com/next-theme/theme-next-docs/tree/master/source/docs and create a pull request with the changes here: https://github.com/next-theme/theme-next-docs/pulls

@fengyiqicoder

Copy link
Copy Markdown
Author

Docs PR: next-theme/theme-next-docs#189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants