How to add an AI chatbot to Hugo

On Hugo, a chat widget is installed through layouts/partials/footer.html. Applies on your next build and deploy. None.

Where it goes

layouts/partials/footer.html

Availability: None.

Adding the chatbot to Hugo

  1. 1

    Open layouts/partials/footer.html, creating it in your project if the theme provides its own.

  2. 2

    Paste the snippet before the closing </body> tag.

  3. 3

    Rebuild the site and deploy the public/ directory.

  4. 4

    Applies on your next build and deploy.

The snippet you paste

<script src="https://rubyrep.com/rubyrep.js" data-rubyrep="rr_your_public_key" defer></script>

Your own key replaces rr_your_public_key — you get it after training RubyRep on your site.

Worth knowing on Hugo

  • Overriding a theme partial in your own layouts/ directory keeps the change safe from theme updates.

  • Hugo renders at build time, so the tag is present in the HTML with no client-side work.

Hugo questions

Where does the code go on Hugo?
layouts/partials/footer.html. Applies on your next build and deploy.
Do I need a paid Hugo plan?
None.
Will a Hugo update remove it?
Overriding a theme partial in your own layouts/ directory keeps the change safe from theme updates.
Does it slow Hugo down?
No measurable effect. The snippet is deferred, so it loads after your page has rendered, and the chat interface itself is only fetched when a visitor opens it.

Related

Get your snippet.

Enter your Hugo site and RubyRep reads it, builds your representative, and hands you the exact line to paste.

https://

Takes about a minute. No credit card.

Using something else? See all platforms.