Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Copilot

prod.html

learn how to use the prod shortcode

Use a variable that represents your product name when documenting a project or startup product that might undergo re-branding.

How it works

The {{<prod>}} shortcode prints out a string for your main product name defined in your site configuration. If the parameter is not configured, it displays a warning message and shows a placeholder text.

  1. Open your repository.

  2. Navigate to the themes/milo/hugo.yaml file.

  3. Update the following:

    yaml
    # Theme Feature Settings
    params: 
      names:
        product: 'Milo Docs'
Build Configuration
If the names.product parameter is not configured in your site configuration, the template will display [Product Name Not Configured] and log a warning during the build process. This prevents build failures while alerting you to the missing configuration.

Examples

This is the Example Product theme.

s
This is the {{<prod>}} theme.

Source code

html
{{- $productName := "" -}}
{{- if .Site.Params.names -}}
    {{- $productName = .Site.Params.names.product | default "" -}}
{{- end -}}
{{- if $productName -}}
    {{- $productName -}}
{{- else -}}
    {{- warnf "Product name not found in site configuration. Add 'params.names.product' to your hugo.yaml config. Page: %s" .Page.RelPermalink -}}
    [Product Name Not Configured]
{{- end -}}