'use client' import { IntegrationGuide } from '@/components/IntegrationGuide' import { CodeBlock } from '@/components/CodeBlock' import { getIntegration } from '@/lib/integrations' import { notFound } from 'next/navigation' export default function HugoIntegrationPage() { const integration = getIntegration('hugo') if (!integration) return notFound() return (

Add Pulse to your Hugo site by placing the script in a partial or directly in your base template.


Method 1: Partial (Recommended)

Create an analytics partial and include it in your base template's <head>.

{`{{ if not .Site.IsServer }} {{ end }}`}

Then include the partial in your baseof.html:

{` {{ .Title }} {{ partial "analytics.html" . }} {{ block "main" . }}{{ end }} `}

Method 2: Direct Insertion

If you prefer, add the script tag directly to the <head> of your baseof.html without creating a partial.

The if not .Site.IsServer guard ensures the script is excluded during local development with hugo server.

) }