useSeo
Comprehensive SEO setup including meta tags, canonical URLs, hreflang tags, and JSON-LD structured data. Location:app/composables/useSeo.ts
Usage
Options
Page title for meta tags and Open Graph.
Page description for meta tags and Open Graph.
Page type for
og:type meta tag.article- For documentation pages (includes Article schema)website- For landing pages (includes WebSite schema)
Custom Open Graph image URL (absolute URL).
Published date in ISO 8601 format for Article schema.
Last modified date in ISO 8601 format for Article schema.
Breadcrumb items for BreadcrumbList JSON-LD schema.Each item should have:
title(string) - Breadcrumb labelpath(string) - Breadcrumb URL path
Features
Meta Tags:- Title and description
- Open Graph tags (
og:title,og:description,og:type,og:url,og:locale) - Twitter Card tags
- Canonical URL
- Automatic hreflang tags for all locales
x-defaulthreflang pointing to default localeog:localeset to current locale
- Article schema for documentation pages
- WebSite schema for landing pages
- BreadcrumbList schema for navigation
- Publisher information from site config
Example with Full Options
useLogoAssets
Manage logo assets with copy, download, and context menu functionality. Location:app/composables/useLogoAssets.ts
Usage
Returned Properties
Whether a logo is configured in app.config.
Current display mode for the header.
Current logo URL based on color mode.
Logo URL for light mode header.
Logo URL for dark mode header.
Whether a wordmark is configured.
Current wordmark URL based on color mode.
Favicon URL from configuration.
Alt text for the logo.
Context menu items for the logo (copy, download, brand assets).
Methods
Copy logo SVG to clipboard (only works for SVG logos).Shows success/error toast notification.
Download logo file.Shows success toast notification.
Copy wordmark SVG to clipboard (only works for SVG wordmarks).
Download wordmark file.
Utility function to copy text to clipboard.
Fetch and normalize SVG content from a URL.
Features
Automatic SVG Normalization:- Replaces hard-coded colors with
currentColor - Adds
idandtitleelements for accessibility - Optimizes SVG for embedding
- Copy logo (SVG only)
- Copy wordmark (SVG only)
- Download logo
- Download wordmark
- Link to brand assets page
- Success/error feedback for copy operations
- Download confirmations
useDocusI18n
Unified internationalization interface that works with or without the@nuxtjs/i18n module.
Location: app/composables/useDocusI18n.ts
Usage
Returned Properties
Whether i18n is enabled in the project.
Current locale code (e.g.,
'en', 'fr').Array of configured locales with
code and name properties.Returns empty array if i18n is not enabled.Translation function.When i18n is disabled, uses fallback locale messages from Docus.
Generate localized path for a given route.When i18n is disabled, returns the path unchanged.
Get the path for switching to a different locale.When i18n is disabled, returns undefined.
Features
Graceful Fallback:- Works without
@nuxtjs/i18nmodule - Provides consistent API regardless of i18n configuration
- Built-in translations for UI elements
- Full TypeScript support
- Compatible with
@nuxtjs/i18ntypes
Translation Keys
Built-in translation keys available:useAssistant
Control the AI assistant panel state and functionality. Location:layer/modules/assistant/runtime/composables/useAssistant.ts
Usage
Returned Properties
Whether the AI assistant is enabled in the configuration.
Whether the assistant panel is currently open.
Whether the assistant panel is in expanded mode (520px vs 360px).
Whether the current viewport is mobile (max-width: 767px).
Current panel width in pixels (360 for compact, 520 for expanded).
Whether the assistant panel should push content aside (true when open on desktop).
Array of chat messages in the current conversation.
Message waiting to be sent when the panel opens.
FAQ questions configured in
app.config.ts, normalized to category format.Automatically handles localized FAQ questions based on current locale.Methods
Open the assistant panel.Parameters:
initialMessage(optional) - Message to send when panel opensclearPrevious(optional, default:false) - Clear previous messages before opening
Close the assistant panel.
Toggle the assistant panel open/closed state.
Toggle between compact (360px) and expanded (520px) panel widths.
Clear all messages from the current conversation.
Clear the pending message without sending it.
Features
Responsive Behavior:- Automatically detects mobile viewports
- Adjusts panel width based on expanded state
- Only pushes content on desktop viewports
- Handles localized FAQ questions
- Falls back to default locale if current locale not available
- Normalizes FAQ format (string arrays or category objects)
- Uses Nuxt’s
useStatefor persistent state across navigation - Shared state between components
- Reactive updates