Skip to content
CAI
Software that uses CAICheck a score

gohugoio/hugo

47.8

Weak · 13 November 2026

109.3k

lines of production code

Go

primary language

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add AVIF image processing support

Users can now encode and decode AVIF images using the warpc WASM-based image processor. This change introduces the \avif.go\ codec implementation, the \genavif\ build system for compiling the libavif C library to WebAssembly, and integration tests verifying basic encoding, animated AVIF handling, and color property preservation.

internal/warpc · high confidence

Add CSS string type definitions

The common/types/css package now includes explicit type definitions for QuotedString and UnquotedString, allowing Hugo to distinguish between CSS values that require quoting and those that do not, ensuring correct output formatting for CSS properties.

common/types/css · high confidence

Add Emacs Org-Mode to HTML conversion

Users can now convert Emacs Org-Mode files to HTML. This change introduces a new converter in the markup/org package that utilizes the go-org library to parse Org content and render it as HTML, including support for syntax-highlighted code blocks via the existing highlighter. A basic test is included to verify the conversion process.

markup/org · high confidence

Add Hugo template namespace for accessing site metadata

A new \tpl/hugo\ package has been introduced to expose Hugo's internal site configuration as a template function. This change allows templates to access the \Hugo\ object (containing version and build details) via the \hugo\ namespace, enabling users to conditionally render content or display version information directly within their site templates.

tpl/hugo · high confidence

Add Markdown render hooks for tables

Users can now customize the HTML output of Markdown tables by providing a \render-table.html\ template in their layouts. This new feature allows for full control over table structure, including access to table attributes, header rows, body rows, and cell details such as text and alignment, enabling advanced styling and integration with CSS frameworks.

markup/goldmark/tables · high confidence

Add StripHTML utility and template context management

The tpl package now includes a StripHTML utility function that removes HTML tags from strings while preserving newlines and handling specific edge cases (such as those in issue 9199). Additionally, the package introduces a Context struct to manage template rendering state, including dependency scopes, page references, and partial caching information, along with supporting types like CurrentTemplateInfo for tracking template execution context.

tpl · high confidence

Add diagrams template namespace for generating SVGs

A new \diagrams\ template namespace is introduced, providing the \Goat\ function to generate SVG diagrams from input data. This feature allows users to create visual diagrams within their templates by leveraging the underlying \goat\ library, with the resulting diagrams accessible via methods to retrieve the full wrapped SVG or just the inner markup.

tpl/diagrams · high confidence

Add hash template functions for FNV32a and xxHash

The \tpl/hash\ package introduces new template functions \hash.FNV32a\ and \hash.XxHash\, allowing users to generate non-cryptographic hashes directly in templates. \hash.FNV32a\ returns a 32-bit FNV-1a hash as an integer, while \hash.XxHash\ provides a hex-encoded xxHash string. These additions complement existing hashing capabilities by offering faster, non-cryptographic alternatives suitable for content fingerprinting and cache busting.

tpl/hash · high confidence

Add inflect template functions for word pluralization, singularization, and humanization

Hugo now provides a new \inflect\ namespace for template functions, allowing users to easily manipulate word forms. The \humanize\ function converts strings to a more readable format (e.g., "my-first-post" becomes "My first post") and adds ordinal suffixes to integers (e.g., 103 becomes "103rd"). The \pluralize\ and \singularize\ functions handle basic word inflection. These functions are implemented using the \gobuffalo/flect\ library and are registered via the standard Hugo template function namespace system.

tpl/inflect · high confidence

Add integrity hash support for sha384

The integrity transformer now supports the sha384 hash algorithm in addition to md5, sha256, and sha512. This allows users to generate Subresource Integrity (SRI) hashes using sha384 for improved security when fingerprinting resources.

_resources/resource\transformers/integrity · high confidence

Add openapi3.Unmarshal template function with external reference support

Hugo now includes a new \openapi3.Unmarshal\ template function that parses OpenAPI 3 specification files (YAML or JSON) into a usable object within templates. This function supports resolving external \$ref\ references, allowing you to split your API documentation across multiple local files or fetch them from remote URLs, with the results cached for performance.

tpl/openapi · high confidence

Add reStructuredText (RST) markup support

Hugo now supports rendering reStructuredText content files. This feature introduces a new RST converter that invokes the external \rst2html\ (or \rst2html.py\) tool to transform RST source into HTML. Users can configure syntax highlighting for code blocks via the \markup.rst.syntaxHighlight\ option, which accepts \long\ (default), \short\, or \none\. The implementation includes a configuration structure for RST-specific settings and integration tests verifying the conversion behavior and configuration validation.

markup/rst · high confidence

Add site template namespace for accessing site data

A new \site\ template namespace has been added to the template functions, allowing templates to access the current site object via the \Context\ function. This change introduces the \tpl/site\ package which wraps the underlying site data and registers it as a namespace, enabling direct access to site-level information within Hugo templates.

tpl/site · high confidence

Add styled error page for Hugo server

The Hugo server now displays a dedicated, styled HTML error page when errors occur during the build process. This new page, located at tpl/tplimpl/embedded/templates/\_server/error.html, provides a dark-themed interface that highlights the error message and lists affected files with line numbers and syntax highlighting, improving the visibility and readability of build errors for users.

_tpl/tplimpl/embedded/templates/\server · high confidence

Add template metrics tracking with caching hints

The new metrics package introduces a system for tracking template execution performance, including cumulative, average, and maximum durations. When enabled via the \--templateMetricsHints\ flag, it also provides caching hints by calculating a similarity score between template outputs to estimate cache effectiveness and reporting the count of cached executions.

metrics · high confidence

Added placeholder directories to the project skeleton

The project creation template now includes empty placeholder directories (assets, content, data, i18n, layouts, static, themes) to ensure the standard Hugo directory structure is present immediately upon initialization.

create/skeletons/project · high confidence

Automated release process for Hugo

The \releaser\ package has been introduced to automate the Hugo release workflow. It handles version calculation (including support for alpha, beta, and RC pre-releases), updates version strings in \common/hugo/version\_current.go\ and minimum version requirements in \commands/new.go\, and manages Git operations such as pulling, committing version bumps, and pushing tags. The tool supports a two-step process for main releases and a simplified one-click flow for patch releases, with a \--try\ flag for local simulation without remote changes.

releaser · high confidence

Code highlighting now supports dark/light mode CSS generation and inline code rendering

The code highlighting system has been updated to support modern theming and layout options. Users can now generate CSS stylesheets that scope selectors under top-level mode classes (e.g., \.dark .chroma\), enabling seamless switching between light and dark themes via parent classes on the page. Additionally, a new \hl\_inline\ option allows code blocks to be rendered as inline \\<code\>\ elements rather than wrapped in \\<pre\>\ tags, which is useful for compact layouts or specific design requirements.

markup/highlight · high confidence

Create pages from Go templates

Hugo now supports creating pages and resources programmatically using Go templates via the new \\_content.gotmpl\ file. This feature introduces the \pagesfromdata\ package, which provides a template context allowing authors to call \AddPage\ and \AddResource\ to define site structure, frontmatter, and content directly within the template logic, rather than relying solely on static files. The implementation includes integration tests verifying page generation, resource handling, and content processing (including markdown and external converters like Asciidoctor), as well as unit benchmarks for the internal hashing mechanism used to track changes.

hugolib/pagesfromdata · high confidence

Dart Sass transpiler support for SCSS/SASS compilation

Hugo now supports using Dart Sass as a transpiler for SCSS and SASS stylesheets. Users can select this engine via the \transpiler: "dartsass"\ option in \toCSS\ or \css.Sass\ calls. This integration provides access to Dart Sass-specific features, including the \importContext\ option for resolving imports from in-memory resources, the \vars\ option for passing Hugo variables into stylesheets via the \hugo:vars\ namespace, and options to control source maps (\EnableSourceMap\, \SourceMapIncludeSources\), output styles, and deprecation warnings (\SilenceDeprecations\, \SilenceDependencyDeprecations\).

_resources/resource\transformers/tocss · high confidence

Expanded math template functions with new operations and namespace support

The math template namespace now includes a broader set of mathematical operations, adding functions for absolute value (Abs), ceiling (Ceil), floor (Floor), rounding (Round), logarithm (Log), power (Pow), square root (Sqrt), and trigonometric calculations (Acos, Asin, Atan, Atan2, Cos). It also introduces Max, Min, MaxInt64, and Product, while allowing variadic arguments for arithmetic functions like Add, Sub, Mul, Div, Min, and Max to accept multiple numbers or slices. Additionally, a workaround for precision issues on the s390x architecture has been implemented for Atan and Tan functions.

tpl/math · high confidence

Hugo now collects HTML classes, IDs, and tags for PurgeCSS integration

Hugo's publisher now includes a new HTML elements collector that scans generated pages to extract all used HTML tags, CSS classes, and IDs. This data is aggregated and written to the \hugo\_stats.json\ file, enabling users to integrate with CSS purging tools like PurgeCSS to remove unused styles. The collector is robust against minified output, correctly handles dynamic class bindings (such as Alpine.js and Vue.js syntax), and intelligently skips content inside script, style, pre, and textarea tags to avoid false positives.

publisher · high confidence

Hugo now supports TOML, YAML, and JSON for new project and theme skeletons

When creating a new project or theme using the \hugo new\ command, users can now specify the configuration file format via the \--format\ flag. The \create/skeletons\ package has been updated to generate \hugo.toml\, \hugo.yaml\, or \hugo.json\ files based on this choice, and the default archetype front matter is also generated in the corresponding format. This provides flexibility in choosing the preferred configuration syntax for new Hugo sites.

create/skeletons · high confidence

Initial repository scaffolding and build configuration

The repository is initialized with essential configuration files and build infrastructure. This includes a multi-stage Dockerfile for building Hugo with Go 1.27 and Dart Sass, a Mage-based build system (magefile.go) replacing previous Makefile targets, and a comprehensive check.sh script for running linters and tests. The project also establishes standard development workflows through CONTRIBUTING.md, AGENTS.md, and CLAUDE.md, alongside standard Git configuration files (.gitignore, .gitattributes, .mailmap) and release automation configuration (hugoreleaser.yaml).

(repo-wide) · high confidence

Inline CSS @import resolution and TailwindCSS v4 support

The CSS and JavaScript resource transformers now include a new inline import resolver that recursively inlines @import statements, supporting lookups via a new importContext option to resolve imports from Hugo resources before falling back to the filesystem. This capability is integrated into the PostCSS and TailwindCSS processors, allowing users to control inlining behavior with options like skipInlineImportsNotFound and disableInlineImports. Additionally, the TailwindCSS processor has been updated to support Tailwind CSS v4, including specific handling for security errors and improved error messaging when imports cannot be resolved.

_resources/resource\transformers/cssjs · high confidence

Introduce 'hugo mod npm pack' command with workspace support

Users can now run 'hugo mod npm pack' to aggregate npm dependencies from Hugo modules into a single, stable workspace package.json. This new command consolidates dependencies from multiple modules, prefers package.hugo.json over package.json when available, and generates a private workspace package with a stable name to simplify maintenance and prevent false stale warnings during regeneration.

modules/npm · high confidence

Introduce Babel JavaScript transpilation transformer

Hugo now supports transpiling JavaScript assets using Babel via the new \babel\ resource transformer. Users can pipe JavaScript resources through \babel\ in their templates to apply presets, plugins, and options such as minification, source maps (inline or external), and custom configuration files. The transformer automatically resolves standard Babel config files (\.js\, \.mjs\, \.cjs\) and integrates with Hugo's security policies for external command execution.

_resources/resource\transformers/babel · high confidence

Introduce Scratch for temporary state storage

The \common/hstore\ package now includes a \Scratch\ type that allows users to store, retrieve, and manipulate temporary state during the build process. This feature supports setting and getting values, appending to slices, performing arithmetic on numbers and strings, and managing nested maps with sorted retrieval. The implementation is thread-safe, ensuring correct behavior when accessed concurrently during parallel builds.

common/hstore · high confidence

Introduce \`hugo new\` command for creating content

Users can now generate new content files using the \hugo new\ command, which leverages archetype templates to scaffold posts, pages, and bundles. The implementation supports directory-based archetypes for creating content bundles, respects the \--force\ flag to overwrite existing files, and integrates with the configured editor for immediate content editing. It also validates target paths against known content formats and handles various metadata formats including YAML, JSON, and TOML.

create · high confidence

Introduce \`resources.GetRemote\` with secure HTTP fetching and caching

Hugo now provides a new \resources.GetRemote\ function that allows templates to fetch remote resources via HTTP. This feature includes a built-in HTTP cache that respects \Cache-Control\ headers (including \no-store\), supports per-request timeouts, and automatically retries on temporary HTTP errors (408, 429, 5xx) while honoring the \Retry-After\ header. Security is enforced by validating resolved IP addresses against the \security.http.urls\ policy to prevent SSRF attacks and by restricting HTTP methods and URLs. Users can also specify custom HTTP methods (e.g., HEAD), request headers, and selectively include response headers in the returned data.

_resources/resource\factories/create · high confidence

Hugo now includes a new 'related' package that provides a configurable inverted index engine for finding related content. Users can define custom indices (such as keywords, dates, or page fragments) with specific weights, types (basic or fragments), and filtering options like cardinality thresholds and tokenization. This allows for more precise and performant 'See Also' sections, including support for matching content via page fragment identifiers.

related · high confidence

Introduce dedicated compare template namespace with cond and multi-arg support

The template functions for comparing values (eq, ne, gt, ge, lt, le, default, and the new cond/ternary function) are now consolidated into a standalone 'compare' namespace. This change allows these functions to be accessed via the compare namespace (e.g., {{ compare.Eq }} or {{ cond ... }}) and supports multiple arguments for comparison operators (e.g., eq arg1 arg2 arg3 treats as arg1==arg2 && arg1==arg3). The new cond function provides a ternary-like capability for conditional logic in templates.

tpl/compare · high confidence

Introduce default security policies for Hugo

Hugo now ships with a built-in security configuration that restricts potentially dangerous operations by default. This includes whitelisting allowed external executables (such as Sass, Go, Git, Node, and PostCSS), restricting accessible environment variables, limiting HTTP methods and URLs for remote resource fetching (blocking localhost and URLs with userinfo to prevent SSRF), and denying text/html and text/org content types to mitigate XSS risks. Node.js tool execution is also hardened with a permission model, and themes are prevented from overriding these security defaults.

config/security · high confidence

Introduce js.Build for bundling JavaScript and CSS with esbuild

Hugo now includes a new \js.Build\ template function that bundles JavaScript and CSS assets using the esbuild bundler. This feature supports modern module resolution, including npm packages and Hugo module imports, and allows users to configure build options such as minification, source maps, and target environments. The build process also handles file-loader artifacts (like fonts and images referenced in CSS) and integrates with Hugo's dependency tracking for efficient rebuilds.

_resources/resource\transformers/js · high confidence

Introduce new 'deploy' command with multi-cloud support and configuration options

Hugo now includes a new 'deploy' command that allows users to deploy site builds to remote cloud storage targets such as AWS S3, Google Cloud Storage, and Azure Blob Storage. This feature introduces support for include/exclude glob filters, configurable upload ordering, and parallel transfer workers to optimize deployment speed. It also adds specific capabilities for CDN cache invalidation, including support for Google Cloud CDN and AWS CloudFront (via the AWS SDK v2). The deployment logic respects media types for content handling and allows stripping index.html from URLs. The deploy functionality is optional and can be excluded from the binary build using the 'nodeploy' build tag.

deploy · high confidence

Introduce post-publish resource transformation support

Added a new \postpub\ package that wraps resources to enable post-publish transformations. This introduces a \PostPublishedResource\ interface and implementation that intercepts field access (such as Permalink, Content, and MediaType) using placeholder strings prefixed with \\_\_h\_pp\l1\\ and suffixed with \\_\e=\. The \\\_e=\ suffix is specifically designed to prevent minifiers from stripping quotes around attribute values, addressing issue \#8884. This mechanism allows Hugo to apply transformations to resources after they have been written to the destination, with placeholders later resolved to actual values.

resources/postpub · high confidence

Introduce render hook interfaces for Markdown elements

The \markup/converter/hooks\ package now defines the core interfaces (such as \LinkContext\, \CodeblockContext\, \TableContext\, \BlockquoteContext\, and \HeadingContext\) that allow users to customize the HTML output for specific Markdown elements. This change establishes the contract for render hooks, enabling authors to replace default rendering logic for links, code blocks, tables, blockquotes, and headings with custom templates.

markup/converter/hooks · high confidence

Introduce template function namespace registry

Added a new internal registry system for template functions, allowing functions to be grouped into namespaces with support for aliases, examples, and documentation metadata. This change introduces the \TemplateFuncsNamespaceRegistry\ and related types in \tpl/internal\, enabling better organization and discoverability of template functions for users.

tpl/internal · high confidence

Introduction of Hugo Modules

Hugo now supports a module system built on Go Modules, allowing users to manage reusable components, themes, and dependencies via \go.mod\. This change introduces the \modules\ package, which provides commands like \hugo mod init\, \hugo mod get\, \hugo mod vendor\, and \hugo mod tidy\ to handle dependency resolution, vendoring, and graph visualization. Users can now define module imports in \hugo.toml\ (e.g., \\[\[module.imports\]\]\), configure mounts for content and assets, and use Go Workspaces for local development. The system supports direct version imports, replacement directives, and integrates with Hugo's existing file mounting and configuration structures.

modules · high confidence

Introduction of dynamic partitioned cache for improved rebuild performance

A new dynamic cache system (dynacache) has been introduced to manage resource caching with partitioned storage and adaptive sizing. This change enhances the rebuild process by allowing more granular control over cache eviction based on identity changes and staleness, which helps prevent partial rebuild failures and improves overall build speed during watch mode.

cache/dynacache · high confidence

Introduction of high-level image processing interfaces

The \common/himage\ package now exposes a set of Go interfaces to support advanced image handling capabilities. Users can now work with animated images (specifically GIF and WebP) via the \AnimatedImage\ interface, which provides access to individual frames, loop counts, and frame durations. Additionally, the new \ColorPropertiesProvider\ interface allows for the preservation of HDR color space information (CICP properties) during image processing, ensuring color accuracy is maintained through transformations.

common/himage · high confidence

New 'safe' template namespace for content escaping

The template functions for marking content as safe (safeCSS, safeHTML, safeHTMLAttr, safeJS, safeJSStr, safeURL) and the new try function are now organized under a dedicated 'safe' namespace. Users can access these functions via the safe namespace (e.g., {{ safe.HTML .Content }}), providing a more explicit and organized way to handle untrusted content escaping in templates.

tpl/safe · high confidence

New BaseURL type and RefLinker interface in common/urls

The common/urls package now includes a dedicated BaseURL struct that standardizes how base URLs are handled, ensuring consistent trailing slashes and providing methods to manipulate protocols and ports. Additionally, a RefLinker interface has been introduced to define the contract for reference linking functionality.

common/urls · high confidence

New GDPR privacy configuration for third-party services

Hugo now includes a dedicated privacy configuration section that allows users to control how third-party services like Google Analytics, YouTube, Vimeo, X (Twitter), Instagram, and Disqus behave on their sites. This update introduces options to enable Do Not Track (DNT) support for Google Analytics, X, and Vimeo, activate privacy-enhanced modes for YouTube, and switch to simple, no-JavaScript static modes for Instagram, Vimeo, and X. By default, Google Analytics will now respect the browser's Do Not Track header, providing better privacy compliance out of the box.

config/privacy · high confidence

New HTTP cache configuration for remote resources

A new HTTP cache configuration system has been introduced, allowing users to control caching behavior for remote resources via the \httpcache\ config section. Users can now enable HTTP cache behavior (RFC 9111) for specific resources using glob patterns and configure polling intervals for watch mode to detect changes in remote resources. The configuration supports options to respect \Cache-Control: no-store\ directives in both requests and responses, and allows disabling polling for specific resources.

cache/httpcache · high confidence

New Hugo template functions and environment variables

This change introduces several new template functions and environment variables to the Hugo build process. In templates, you can now use \hugo.IsMultihost\ to detect if the site is served on multiple hosts, \hugo.IsMultilingual\ to check for multi-language support, and \hugo.Sites\ to iterate over all site variants (including roles and versions). Additionally, the \HUGO\_PUBLISHDIR\ environment variable is now available in the Node.js execution environment, and the \hugo env\ command provides more verbose output, including a complete dependency list and Dart Sass Embedded version info.

common/hugo · high confidence

New JavaScript batching system and predicate-based filtering

Hugo introduces a new \js.Batch\ system for building JavaScript resources, implemented in \internal/js/esbuild/batch.go\, which supports multihost setups, ordered group building, and error handling for missing imports. Additionally, a new \common/predicate\ package provides generic predicate functions and range matchers (including \==\ and \!=\ operators) for filtering site matrix vectors, enabling more flexible content and resource filtering based on roles, versions, and other dimensions.

github.com/gohugoio/hugo · high confidence

New buffer pool for efficient byte buffer reuse

A new buffer pool implementation has been added to the bufferpool package, providing a sync.Pool of bytes.Buffer instances. This allows users to obtain and return buffers efficiently, reducing allocation overhead. The pool automatically resets buffers before returning them to circulation, ensuring they are clean for reuse. Tests confirm that buffers are correctly pooled and reset.

bufferpool · high confidence

New cast namespace for template type conversions

Hugo now provides a dedicated 'cast' namespace for template functions, exposing \int\, \float\, and \string\ helpers. These functions wrap the \spf13/cast\ library and specifically handle Hugo's template safety types (such as \template.HTML\, \template.CSS\, \template.JS\, and \template.JSStr\) by converting them to strings before casting, ensuring that safe HTML and script content can be converted to numbers or strings without errors.

tpl/cast · high confidence

New code generation helpers for method inspection and JSON marshaling

The codegen package now includes a new \methods.go\ file that provides an \Inspector\ for analyzing Go source code ASTs to extract method sets from types, handling sorting by weight and package imports. This enables the code generator to accurately reflect method signatures (including embedded interface methods) and generate corresponding JSON marshaling code. The change also updates the test suite to use \quicktest\ instead of \testify\ and adds specific tests for method extraction and JSON generation logic.

codegen · high confidence

New collections package with Append, Slice, and Stack utilities

The \common/collections\ package introduces core utilities for managing data structures in Hugo. It adds an \Append\ function that safely combines slices, handling mixed types by falling back to \\[\]interface{}\ and ensuring input slices are copied to prevent side effects. A \Slice\ function is provided to construct typed slices from arguments, respecting custom \Slicer\ implementations. Additionally, generic \Stack\ and thread-safe \StackThreadSafe\ types are added, offering standard LIFO operations (Push, Pop, Peek) and iteration capabilities.

common/collections · high confidence

New common iterator utilities for sequence concatenation and locking

A new \hiter\ package has been added to provide reusable iterator functions. It introduces \Concat\ and \Concat2\ to merge multiple sequences (including \iter.Seq\ and \iter.Seq2\) into a single stream, automatically handling nil sequences. Additionally, \Lock\ and \Lock2\ allow wrapping iterators to ensure thread safety by acquiring a lock before iteration begins and releasing it upon completion.

common/hiter · high confidence

New common string utilities and regex caching

The \common/hstrings\ package introduces a set of shared string manipulation functions and a concurrent regular expression cache. Users benefit from a \StringEqualFold\ type that implements case-insensitive equality for template comparisons, helper functions like \HasAnyPrefix\ and \InSlicEqualFold\ for string matching, and several methods for deduplicating string slices (\UniqueStrings\, \UniqueStringsReuse\, \UniqueStringsSorted\). Additionally, the \GetOrCompileRegexp\ function provides a thread-safe cache for compiled regular expressions to improve performance when patterns are reused.

common/hstrings · high confidence

New crypto template functions for hashing and HMAC

The tpl/crypto package introduces a new 'crypto' namespace for Hugo templates, providing functions to generate cryptographic checksums and message authentication codes. Users can now use \md5\, \sha1\, \sha256\, and the generic \crypto.Hash\ (supporting md5, sha1, sha256, sha384, sha512) to produce hex-encoded digests, which is particularly useful for constructing Subresource Integrity (SRI) hashes. Additionally, the \hmac\ function allows signing messages with a secret key using various hash algorithms and supports both hex and binary output encodings.

tpl/crypto · high confidence

New css.Build and css.ChromaStyles template functions

The tpl/css package now exposes the \css.Build\ function, allowing users to compile and process CSS assets with options such as minification, target browser versions, custom loaders, and external imports (e.g., Tailwind CSS). Additionally, the \css.ChromaStyles\ function generates syntax-highlighting CSS stylesheets for code blocks, supporting light/dark mode theming and custom class selectors. These functions provide a more flexible and programmatic way to handle CSS in Hugo templates compared to the previous resource pipeline.

tpl/css · high confidence

New debug template functions for inspecting data and measuring performance

Hugo now includes a \debug\ namespace with template functions to aid in template development. The \debug.Dump\ function allows you to print a JSON representation of any value (such as page or site data) directly in your templates, while \debug.Timer\ lets you measure and log the execution time of specific template sections, reporting count, total duration, average, and median times at the end of the build. Additionally, \debug.VisualizeSpaces\ helps identify invisible whitespace issues by replacing spaces with visible characters.

tpl/debug · high confidence

New debug utility package for development-time assertions and logging

Added the \common/hdebug\ package, which provides helper functions (\Printf\, \AssertNotNil\, \Panicf\) for development-time debugging. These utilities allow developers to print debug information or assert non-nil values during local development, but will panic if executed in a real CI environment, ensuring that debug code does not slip into production builds.

common/hdebug · high confidence

New default theme skeleton with modern asset pipeline and layout structure

The default theme skeleton has been updated to provide a complete, ready-to-use site structure. It now includes a semantic HTML layout (baseof, home, section, page, taxonomy, and term templates) with a header, main content area, and footer. The theme integrates a modern asset pipeline using Hugo's built-in CSS and JS builders, which automatically minify and fingerprint assets in production while providing linked source maps in development. Additionally, it features a reusable menu partial for navigation and a terms partial for displaying taxonomies like tags, along with sample content and basic styling for headers and footers.

create/skeletons/theme · high confidence

New deployment configuration package with stripIndexHTML support

The deploy/deployconfig package introduces a dedicated configuration structure for deployment targets and matchers, allowing users to define specific upload behaviors such as including/excluding files via glob patterns, setting cache control headers, and enabling gzip compression. A key new capability is the StripIndexHTML option on targets, which automatically maps local index.html files to directory roots on the remote server. The package also validates configuration inputs, ensuring that empty targets or matchers and invalid regular expression patterns in ordering or matcher definitions are rejected with clear errors.

deploy/deployconfig · high confidence

New documentation helper package for Hugo docs

A new \docshelper\ package has been added to provide helpers for generating Hugo documentation. It introduces a \DocProvider\ type and an \AddDocProviderFunc\ registration mechanism, allowing other parts of the codebase to contribute documentation data that is aggregated by \GetDocProvider\. This is an internal tooling addition with no direct user-facing feature change.

docshelper · high confidence

New embedded partials for social sharing, SEO, and comments

Added embedded template partials for Disqus comments, Google Analytics (with a warning for deprecated Universal Analytics IDs), Open Graph metadata, Twitter Cards, Schema.org metadata, and pagination (supporting 'default' and 'terse' formats). These templates provide built-in support for social sharing optimization, search engine metadata, comment integration, and paginated navigation without requiring user-provided templates.

_tpl/tplimpl/embedded/templates/\partials · high confidence

New encoding template functions for base64, hex, and JSON serialization

The \tpl/encoding\ package introduces a new \encoding\ namespace for Hugo templates, providing \base64Encode\ and \base64Decode\ for base64 conversion, \encoding.HexEncode\ and \encoding.HexDecode\ for hexadecimal conversion, and an enhanced \jsonify\ function. The \jsonify\ function now supports an options map to control indentation (via \indent\ and \prefix\ keys) and includes a \noHTMLEscape\ option to prevent HTML entity escaping in the JSON output.

tpl/encoding · high confidence

New file I/O utilities and pattern-matching writer in common/hugio

The common/hugio package introduces several new utilities to improve file handling and output processing. A new CopyDir function allows copying directories with optional filtering, while a new HasBytesWriter enables efficient pattern matching against byte streams, supporting multiple patterns and detecting matches that span write boundaries. BOM (Byte Order Mark) handling is consolidated with new trimBOM and NewSkipBOMReader functions to ensure consistent UTF-8 processing. Additionally, writer utilities like NewMultiWriteCloser and ToWriteCloser provide flexible ways to duplicate writes and wrap writers with close capabilities.

common/hugio · high confidence

New file classification system for Hugo component folders

The hugofs/files package introduces a new classifier (classifier.go) that defines and manages Hugo's core component folders (archetypes, static, layouts, content, data, assets, i18n). This change adds logic to identify these specific directories, resolve component folder names from file paths, and handle special file types like \_content.gotmpl and package.hugo.json. Tests verify the correct identification of these component folders.

hugofs/files · high confidence

New fmt template namespace with logging-aware functions

The \tpl/fmt\ package introduces a new \fmt\ namespace for Hugo templates, providing functions like \print\, \printf\, and \println\ for string formatting, alongside \errorf\, \warnf\, and their \idf\ variants (\erroridf\, \warnidf\) which log messages at the corresponding severity levels and return empty strings. The \idf\ functions support error/warning suppression via configuration (e.g., \ignoreLogs\), and experimental \warnmf\/\errormf\ functions allow logging with structured map fields.

tpl/fmt · high confidence

New hmaps package for configuration merging and caching

The common/maps package has been renamed to common/hmaps and replaced with a new set of utilities for handling Hugo configuration and internal state. This includes a thread-safe generic Cache with optional size limits, an Ordered map that preserves insertion order, and an OrderedIntSet for efficient integer set operations. The package also introduces a Params type with recursive merging strategies (deep, shallow, none) and case-insensitive key handling, alongside a KeyRenamer for pattern-based configuration key transformation.

common/hmaps · high confidence

New identity package for dependency tracking

Hugo introduces a new \identity\ package that provides a system for identifying values and tracking dependencies. This includes an \identity.Manager\ for grouping identities, a \Finder\ for searching identities within managers with caching and depth limits, and a \Question\ type for one-time answer resolution. The package also supports predicate-based identities and is designed to improve the accuracy and performance of Hugo's rebuild and change detection mechanisms.

identity · high confidence

New images.QR template function for generating QR codes

The \tpl/images\ package now exposes a new \images.QR\ template function that allows users to generate QR code images directly from text strings within their templates. The function accepts the text to encode and optional configuration parameters for error correction level (low, medium, quartile, high) and scale (pixels per module). It returns an image resource that can be rendered or processed further, with the output path automatically hashed to ensure cache busting. This feature is accompanied by integration tests verifying correct generation, parameter handling, and error cases.

tpl/images · high confidence

New internal package for external content rendering

The markup/internal package now includes a new external.go file that provides functionality for rendering content using external binaries. This includes the ExternallyRenderContent function which executes external commands with provided arguments and captures their output, handling both stdout and stderr appropriately. The package also includes utility functions for normalizing line feeds from external processes and finding Python binary candidates on the system.

markup/internal · high confidence

New js template namespace for JavaScript bundling and transformation

A new \js\ template namespace has been introduced, exposing three functions: \js.Build\ for processing JavaScript resources with ESBuild, \js.Babel\ for Babel-based transformation, and \js.Batch\ for creating named batchers to group JavaScript assets. This change adds the underlying template function infrastructure (registration in \tpl/js/init.go\ and implementation in \tpl/js/js.go\) that enables these JavaScript build capabilities within Hugo templates.

tpl/js · high confidence

New js.Batch API for bundling JavaScript

A new \js.Batch\ template function is introduced, allowing users to group multiple JavaScript scripts, runners, and instances into a single bundled output. This feature enables more efficient asset management by combining related scripts and configuring shared options (such as parameters, export names, and import contexts) across a batch, rather than building each script individually.

internal/js · high confidence

New localized number formatting template functions

The \lang\ template namespace now includes \FormatNumber\, \FormatPercent\, \FormatCurrency\, \FormatAccounting\, and \FormatNumberCustom\. These functions allow users to format numeric values according to the current language's locale settings, with \FormatNumberCustom\ offering additional control over decimal, grouping, and negative sign delimiters.

tpl/lang · high confidence

New math template function for type-preserving arithmetic

A new \DoArithmetic\ function has been added to the \common/math\ package, enabling template authors to perform addition, subtraction, multiplication, and division on numeric values while preserving the input type (int, uint, or float) and supporting string concatenation for the \+\ operator. This utility allows for more precise numeric handling in templates by avoiding unintended type coercion, and includes comprehensive test coverage for various integer, unsigned integer, and floating-point combinations.

common/math · high confidence

New namespaced strings template functions

The \tpl/strings\ package now provides a dedicated \strings\ namespace for template functions, consolidating string manipulation capabilities such as \Contains\, \Count\, \Diff\, \FindRE\, \ReplaceRE\, \Truncate\, and \Chomp\ under the \strings\ prefix (e.g., \{{ strings.Contains ... }}\). This change introduces a structured \Namespace\ registration in \init.go\ and implements the functions in \strings.go\, \regexp.go\, and \truncate.go\, including support for HTML-aware truncation and regex limiting, while adding comprehensive tests in \strings\_test.go\, \regexp\_test.go\, and \truncate\_test.go\.

tpl/strings · high confidence

New os template namespace for filesystem operations

Hugo introduces a new \os\ template namespace providing functions to interact with the filesystem directly from templates. This includes \fileExists\ to check for file presence, \readFile\ to read file contents as a string, \readDir\ to list directory entries, \stat\ to retrieve file information, and \getenv\ to access environment variables. The implementation uses a symlink-dropping filesystem wrapper for security and ensures consistent behavior across different filesystem layers.

tpl/os · high confidence

New output format configuration system and built-in formats

The output package now provides a structured configuration system for defining and managing output formats. A new \DecodeConfig\ function allows users to partially redefine existing formats (such as changing the \baseName\ for JSON) or add entirely new ones (like a custom XML format) via the site configuration, with validation for media types. The package also introduces several new built-in output formats, including \calendar\, \csv\, \markdown\, and \webappmanifest\, and refactors the internal \Format\ struct to support properties like \protocol\, \root\, and \permalinkable\. This change establishes the foundation for more flexible output generation and template selection in Hugo.

output · high confidence

New parallel task execution helper

A new \common/para\ package has been added, providing a \Workers\ type and a \Runner\ interface to execute tasks in parallel with a configurable concurrency limit. This helper uses Go's \errgroup\ and semaphores to manage goroutine execution, allowing users to run multiple functions concurrently while respecting a specified worker count and context cancellation.

common/para · high confidence

New path parsing system with multi-dimensional content identifiers

Hugo introduces a new path parsing engine in the common/paths package that supports content and layout identification using multiple dimensions beyond just language. Files can now use underscore-wrapped identifiers for version (e.g., \_version\v1\), role (e.g., \_role\admin\), output format, and kind, in addition to the existing language identifiers (e.g., \_language\fr\). This allows for more flexible content organization and template selection in complex, multi-dimensional sites.

common/paths · high confidence

New path template functions for manipulating file paths

Hugo now includes a new \path\ namespace in templates, providing functions to manipulate file paths: \path.Base\ (last element), \path.BaseName\ (last element without extension), \path.Dir\ (directory part), \path.Ext\ (extension), \path.Join\ (combine path elements), \path.Split\ (separate directory and file), and \path.Clean\ (normalize path). These functions standardize path handling by converting inputs to forward slashes and cleaning up extraneous separators, making it easier to work with file paths in Hugo templates.

tpl/path · high confidence

New reflect namespace for template type introspection

A new \reflect\ template namespace has been added, providing functions to inspect the type of objects within templates. This includes \IsMap\ and \IsSlice\ for generic Go types, as well as \IsPage\, \IsSite\, \IsResource\, and \IsImageResource\ for Hugo-specific entities. Additionally, \IsImageResourceWithMeta\ and \IsImageResourceProcessable\ allow templates to distinguish between image resources that support full processing and those that only support metadata (such as AVIF, HEIF, and HEIC).

tpl/reflect · high confidence

New render hooks for code blocks and passthrough snippets

Hugo now supports custom render hooks for fenced code blocks and passthrough content (such as LaTeX). Users can provide custom templates at layouts/\_markup/render-codeblock.html (or language-specific variants like render-codeblock-go.html) to control how code blocks are rendered, accessing properties like the language, inner code, and attributes. Similarly, when the passthrough extension is enabled, users can define layouts/\_markup/render-passthrough-block.html and render-passthrough-inline.html to customize the rendering of content delimited by custom markers (e.g., $...$ for inline math). This allows for greater flexibility in styling code and special content blocks. Also in this area: 1 commit (0 fixes) modifying markup.

markup/goldmark/codeblocks, markup/goldmark/passthrough · medium confidence

New resource mounting and date-handling utilities

The \resources/resource\ package now includes a \Mount\ method on the \Resources\ slice, allowing templates to remap resource paths from a base directory to a new target path (e.g., \resources.Match(...).Mount(...)\). Additionally, new helper functions and interfaces have been added to standardize date logic: the \Dated\ interface and \IsFuture\/\IsExpired\ functions in \dates.go\ provide consistent checks for resource publish and expiry dates, while \params.go\ and \resource\_helpers.go\ introduce robust parameter retrieval with support for nested keys and TOML date parsing.

resources/resource · high confidence

New resources template functions and namespace registration

The tpl/resources package now registers a comprehensive set of template functions for managing assets, including Get, GetRemote, GetMatch, Match, ByType, Copy, Concat, Fingerprint, FromString, Minify, Publish, PostProcess, and ExecuteAsTemplate. This change introduces the resources.Copy function to duplicate assets to new paths, adds resources.GetRemote for fetching external resources via HTTP, and ensures that resource lookup functions (Get, GetMatch, Match, ByType) preserve original permalink casing instead of normalizing them. It also includes a regression fix ensuring global resources are correctly published when accessed via methods like .Get or .GetMatch on resource collections.

tpl/resources · high confidence

New segments configuration and --renderSegments flag

Hugo now supports defining named segments in the configuration to selectively render specific subsets of content. Users can define segments using include and exclude rules based on dimensions such as kind, path, language, and output format, and then specify which segments to render via the new \renderSegments\ configuration option or the \--renderSegments\ command-line flag. This feature allows for more granular control over site generation, enabling scenarios like rendering only documentation or specific content sections. The implementation includes a new \hugolib/segments\ package with integration and unit tests, and deprecates the legacy \lang\ field in segment definitions in favor of the \sites.matrix\ configuration.

hugolib/segments · high confidence

New shared utility types and concurrency-safe collections

The common/types package now includes several new foundational types to support internal refactoring and improved concurrency handling. This adds a generic EvictingQueue for managing bounded, LIFO lists of items with duplicate suppression, a RunEvery scheduler in common/tasks for executing functions at dynamic intervals, and a Closer/Closers mechanism for standardized resource cleanup. Additionally, new conversion helpers (ToDuration, ToStringSlicePreserveString) and type definitions (LowHigh, KeyValue, Zeroer) are provided to streamline data handling across the codebase.

common/types · high confidence

New templates namespace with defer, exists, and decorator support

The \tpl/templates\ package now exposes a new \templates\ namespace in templates, providing \templates.Exists\ to check if a template file is present, \templates.Defer\ to delay execution of template blocks (with restrictions inside \partialCached\), and \templates.Current\ to inspect the active template's metadata. It also introduces partial decorator capabilities via \inner\ and internal decorator stack management, fixing issues where falsy returns or empty strings in partials caused unbalanced stacks or incorrect JavaScript escaping.

tpl/templates · high confidence

New text utility functions for position tracking and string transformation

The common/text package now includes new capabilities for handling text positions and transformations. A new Positioner interface and Position struct allow components to report precise file, line, and column information in error messages, with customizable formatting via the HUGO\_FILE\_LOG\_FORMAT environment variable. Additionally, new utility functions have been added: RemoveAccents and RemoveAccentsString strip diacritics from text, Chomp removes trailing newlines, Puts ensures a trailing newline is present, and VisitLinesAfter iterates through lines including their newline characters. These utilities support more robust text processing and clearer error reporting for users.

common/text · high confidence

New transform template functions namespace

The \tpl/transform\ package now exposes a dedicated \transform\ namespace for template functions, consolidating content transformation capabilities. This includes \emojify\ for converting emoji codes, \highlight\ and \highlightCodeBlock\ for syntax highlighting (with support for \type\ and \code\ options), \markdownify\ and \plainify\ for text conversion, \htmlEscape\/\htmlUnescape\/\XMLEscape\ for character escaping, \ToMath\ for KaTeX rendering, \Unmarshal\ for parsing JSON, TOML, YAML, and CSV data, \Remarshal\ for converting between data formats, \HTMLToMarkdown\ for HTML-to-Markdown conversion, \PortableText\ for handling Portable Text content, and \CanHighlight\ to check language support.

tpl/transform · high confidence

New urls template function namespace

Hugo introduces a dedicated \urls\ namespace for template functions, consolidating URL-related operations into a single, organized group. Users can now access functions such as \urls.JoinPath\ for constructing URLs from multiple segments, \urls.PathEscape\ and \urls.PathUnescape\ for handling URL encoding, \urls.Parse\ for parsing URL strings, and \urls.Anchorize\ for generating sanitized anchor names. Existing functions like \absURL\, \relURL\, \absLangURL\, \relLangURL\, \urlize\, \ref\, and \relref\ are also registered within this namespace, providing a consistent and explicit way to manage URL manipulation in templates.

tpl/page, tpl/urls · high confidence

Pandoc converter now supports citations and bibliography rendering

The Pandoc markup handler in Hugo now processes citations and bibliographies by invoking Pandoc with the \--citeproc\ flag. This allows users to include citation keys in their content (e.g., \@key\) and configure bibliography sources and citation styles via front matter, resulting in properly formatted reference lists and in-text citations in the generated HTML. The implementation also includes logic to detect Pandoc version 3.11+ and switch from the deprecated \--mathjax\ flag to \--math-method=mathjax\ for compatibility.

markup/pandoc · high confidence

Support for GitHub and Obsidian-style blockquote alerts

Hugo now recognizes and renders blockquotes that follow the GitHub and Obsidian alert syntax (e.g., \\> \[!NOTE\]\, \\> \[!TIP\]\, \\> \[!CAUTION\]\). These alerts are exposed to custom render hooks via a new \Type\ field (distinguishing between 'regular' and 'alert') and specific alert context methods like \AlertType\, \AlertTitle\, and \AlertSign\ (supporting Obsidian's foldable +/- signs). The implementation includes a new \markup/goldmark/blockquotes\ extension that parses these patterns, handles mixed-case alert types, and ensures correct text parsing and positioning within the rendered output.

markup/goldmark/blockquotes · high confidence

Support for block attributes and auto-generated IDs in Goldmark

The Goldmark markdown parser now supports block-level attributes (e.g., \{\#id .class}\) applied to elements like headings and code blocks, allowing users to customize HTML output with custom IDs and classes. Additionally, automatic ID generation is enabled for definition terms in description lists (controlled by \autoDefinitionTermID\), ensuring consistent fragment identifiers for accessibility and linking. The implementation includes fixes for potential panics when handling stray or solitary attribute nodes, ensuring stable rendering.

markup/goldmark/internal/extensions · high confidence

Support for executing templates on resource content via ExecuteAsTemplate

Users can now process the content of any Resource object as a Hugo template using the new \resources.ExecuteAsTemplate\ function. This capability, implemented in the \resources/resource\_transformers/templates\ package, allows template data to be injected into resource content (such as converting a string resource into a rendered HTML fragment), with support for context-aware features like internationalization as demonstrated in the integration tests.

_resources/resource\transformers/templates · high confidence

Support for roles and versions as site matrix dimensions

Hugo now supports filtering and organizing content by roles and versions in addition to languages. Users can define roles (e.g., guest, member) and versions (e.g., v1, v2) in the configuration, and use them in front matter to control which site combinations see specific content. This enables multi-version documentation and role-based access control within the same site structure.

hugolib/sitesmatrix · high confidence

Unified image metadata extraction with XMP and IPTC support

The image metadata system now consolidates EXIF, IPTC, and XMP data into a single \MetaInfo\ structure accessible via \$image.Meta\. Users can configure which metadata sources to read (EXIF, IPTC, XMP) and which specific fields to include or exclude using glob patterns in the \imaging.meta\ configuration. The metadata is exposed as separate \.Exif\, \.IPTC\, and \.XMP\ objects, which can be merged using the \merge\ template function to create a unified view of all available tags.

resources/images/meta · high confidence

Security

Asciidoctor integration now enforces security policies and configurable arguments

The Asciidoctor external binary integration in Hugo now applies sensible default security policies, restricting disallowed backends, extensions, and attributes to prevent unsafe execution. Users can now explicitly configure Asciidoctor command-line arguments (such as backend, safe mode, section numbers, and verbosity) via the markup configuration, while invalid or dangerous options are safely ignored in favor of the secure defaults.

markup/asciidocext · high confidence

Architecture

Centralize page kind constants in a dedicated package

Page kind constants (such as home, section, taxonomy, term, and page) and their associated lookup logic have been moved into a new dedicated \resources/kinds\ package. This change consolidates the definition of page types and provides a unified API for resolving kind strings, including support for legacy aliases like \taxonomyterm\ mapping to \taxonomy\. Tests have been added to ensure these constants remain stable and that case-insensitive lookups function correctly.

resources/kinds · high confidence

Introduce new BaseFs architecture for Hugo's file system handling

Hugo introduces a new \BaseFs\ struct in \hugolib/filesystems\ to manage the composite virtual file systems used for source, project, publish, static, and work directories. This change restructures how Hugo composites project and theme content, providing a more granular and robust foundation for file system operations, including improved handling of file mounts, locking for concurrent builds, and directory watching. The new architecture is designed to support better theme composition, module integration, and performance optimizations in static file handling.

hugolib/filesystems · high confidence

Introduces a new markup conversion interface and provider system

The \markup/converter\ package now exposes a formalized \Converter\ interface and a \Provider\ registration system, replacing the previous implicit or monolithic handling of markdown processing. This change introduces a \ParseRenderer\ interface that allows converters (such as the new Goldmark implementation) to separate parsing from rendering, enabling features like Table of Contents extraction without full content rendering. Users benefit from a more modular architecture that supports pluggable markdown engines and finer-grained control over how content is processed and rendered.

markup/converter · high confidence

Introduction of a centralized dependency container

Hugo introduces a new \deps\ package containing a \Deps\ struct that acts as a central container for shared dependencies across the application. This struct aggregates core components such as the logger, file systems, configuration provider, template store, and various caches, replacing the previous scattered or global access patterns. This change consolidates how internal services and resources are passed between different parts of the Hugo engine, improving modularity and state management during site builds.

deps · high confidence

Introduction of the allconfig package for unified configuration management

Hugo introduces the new \config/allconfig\ package, which consolidates the entire site configuration into a single, structured entry point. This change replaces the previous fragmented configuration loading with a centralized system that handles decoding, merging, and validation of all settings—including languages, modules, caches, and markup—through a unified decoder setup. The new architecture improves resilience against configuration errors (such as nil map assignments and invalid YAML) and provides a consistent interface for accessing configuration data across the project.

config/allconfig · high confidence

New multi-dimensional document tree implementation

The internal document tree structure in hugolib/doctree has been replaced with a new architecture supporting multiple dimensions (language, version, and role) via the new NodeShiftTree and TreeShiftTreeSlice types. This change allows Hugo to manage content trees across different site configurations and versions simultaneously, enabling more efficient partial rebuilds and improved performance for sites with many sections. The new system introduces a Shifter interface for handling tree transformations and a Transformer interface for appending nodes, backed by radix trees with thread-safe access patterns.

hugolib/doctree · high confidence

Refactored helpers into modular packages

The helpers package has been reorganized into distinct modules (content, emoji, general, path, pathspec, processing\_stats, url) to improve code structure and maintainability. This change consolidates related functionality, such as content rendering, emoji processing, path manipulation, and URL handling, into their respective files, making the codebase easier to navigate and extend.

helpers · high confidence

Refactored hugofs into a modular filesystem architecture

The hugofs package has been restructured into a composable system of specialized filesystem wrappers to improve maintainability and performance. This change introduces distinct components for managing Hugo's various file sources: a component filesystem for handling specific content types (like layouts and i18n), a decorator filesystem for attaching metadata to file info, a filename filter filesystem for enforcing inclusion/exclusion rules, and a directory merger for combining mount sources. Additionally, new tracking filesystems have been added to monitor open files, count file creations, and compute content hashes (using xxHash) for efficient change detection during server rebuilds. These internal architectural improvements streamline how Hugo handles file mounts, symlinks, and metadata, resulting in faster rebuilds and more robust file system interactions.

hugofs · high confidence

Behavioural changes

2 commits (0 fixes) modifying common/hhtml

A change to existing behaviour in common/hhtml — 2 commits, 2 files: “tpl/strings: Rewrite truncate using the hhtml scanner”; “tpl: Make StripHTML (plainify) more robust and faster”.

common/hhtml · medium confidence · unverified

5 commits (0 fixes) modifying resources/images/testdata/images\_golden/process/avif

A change to existing behaviour in resources/images/testdata/images\_golden/process/avif — 5 commits, 9 files: “images: Make 60 the default quality for AVIF”; “Add some PNG to AVIF golden test cases”; “images: Make AVIF chroma subsampling content-aware via the hint”; and 2 more.

_resources/images/testdata/images\golden/process/avif · medium confidence · unverified

Automated generation of JSON marshaling code for Page interface

The page generation system now includes an automated code generator that creates the \MarshalJSON\ implementation for the \Page\ interface. This change introduces a new \page\_generate\ package that inspects the \PageMetaProvider\ interface and produces the \page\_marshaljson.autogen.go\ file, ensuring that JSON serialization logic is kept in sync with the interface definition without manual maintenance.

_resources/page/page\generate · high confidence

Cached lexer lookups for improved syntax highlighting performance

The syntax highlighting system now caches the results of lexer lookups to avoid the performance penalty of repeated, slow resolution attempts, particularly when a requested language is not found. This change introduces a concurrent map-based cache in the chromalexers package, wrapping the underlying chroma lexer retrieval to store and reuse previously resolved lexers, thereby speeding up the highlighting process for pages with multiple code blocks.

markup/highlight/chromalexers · high confidence

Centralize warning IDs and field names in common/constants

The constants package now explicitly defines specific warning identifiers (such as those for render shortcodes, Goldmark raw HTML, superfluous partial prefixes, and leaf bundle home pages) alongside resource field names like RelPermalink and Permalink. This centralization ensures that these specific string literals are consistently referenced across the codebase, reducing the risk of typos and making it easier to manage or disable these specific warnings and field lookups.

common/constants · high confidence

Centralized path and multihost configuration management

The hugolib/paths package now provides a unified Paths struct that manages absolute resource and publish directories, language prefixes, and multihost-specific base paths. This change introduces support for multihost deployments by calculating per-language target base paths and the longest common base path, ensuring that CSS file-loader URLs and other assets are correctly resolved across different hosts. Users benefit from more robust path handling in complex multihost and multilingual setups, with the system automatically determining the correct base paths for resource output and permalink generation.

hugolib/paths · high confidence

Centralized template function registration via tplimplinit

The template system now uses a new \tplimplinit\ package to centrally initialize and register all Hugo template functions. This change introduces a \CreateFuncMap\ function that aggregates namespaces from the \internal.TemplateFuncsNamespaceRegistry\, ensuring that all template helpers (such as \css\, \js\, \strings\, etc.) are consistently wired into the template engine. This provides a single, unified entry point for template function initialization, replacing previous ad-hoc registration patterns.

tpl/tplimplinit · high confidence

Configurable wrapping of standalone Markdown images within paragraphs

Users can now control whether standalone images in Markdown content are automatically wrapped in a paragraph tag via the new \wrapStandAloneImageWithinParagraph\ configuration option under \\[markup.goldmark.parser\]\. When set to \false\ (the new default behavior implied by the removal of the surrounding paragraph), block-level images are extracted from their parent paragraph and placed directly in the document flow, allowing for better semantic structure and styling (e.g., using \\<figure\>\ tags via render hooks). When set to \true\, the previous behavior is preserved, keeping standalone images inside a \\<p\>\ tag. This change also ensures that attributes applied to the image line (such as CSS classes) are correctly transferred to the image element itself when unwrapped.

markup/goldmark/images · high confidence

Consolidate hashing logic and introduce resettable synchronization primitives

This change consolidates all hashing utilities into the new common/hashing package, replacing the previous MD5-based image hashing with the faster xxHash algorithm and providing a unified set of hashing functions for strings, readers, and complex structures. Additionally, it introduces the common/hsync package, which provides resettable synchronization primitives (OnceMore, OnceMoreValue, OnceMoreFunc) that allow one-time actions to be repeated after a reset, supporting more flexible caching and initialization patterns.

common/hashing · high confidence

Consolidated metadata decoder with XML support and improved Org mode handling

The metadata decoding logic in parser/metadecoders has been consolidated into a unified Decoder struct that manages configuration for all supported formats. This change introduces native support for decoding XML files (using github.com/clbanning/mxj/v2) alongside existing formats. For Org mode, the library now supports additional front matter headers (LASTMOD, PUBLISHDATE, EXPIRYDATE) and handles filetags as slices. YAML decoding has been migrated to github.com/goccy/go-yaml, which includes a fix to ensure empty YAML files return an empty map instead of nil, preventing crashes. CSV decoding now exposes configurable options for delimiters, comment characters, lazy quotes, and target data types (slice or map).

parser/metadecoders · high confidence

Docker entrypoint now supports custom scripts and npm installation

The Docker container now executes a custom \hugo-docker-entrypoint.sh\ script if present, allowing users to inject pre-startup logic. Additionally, if a \package.json\ is detected and \node\_modules\ is missing, the entrypoint automatically runs \npm i\ to install dependencies before launching Hugo, ensuring Node.js packages are available regardless of the host OS or architecture.

scripts/docker · high confidence

Enhanced page image resolution with global resource fallback

The internal template logic for resolving page images now checks global resources in addition to page-specific resources when looking up internal images. This ensures that images referenced in the \images\ parameter or matched by feature/cover patterns are correctly resolved even if they are not directly attached to the page, improving reliability for sites using global image assets.

_tpl/tplimpl/embedded/templates/\_partials/\funcs · high confidence

Enhanced position tracking and page context in Goldmark render hooks

The internal rendering context for Goldmark has been refactored to improve how render hooks access document position and page data. A new \Context\ struct manages position stacks and value tracking, allowing render hooks to more accurately resolve element positions via the \ElementPositionResolver\ interface. Additionally, hooks now receive both the current page and the inner page context (\PageInner\), enabling more precise handling of nested or dynamic page structures during Markdown rendering.

markup/goldmark/internal/render · high confidence

Enhanced terminal output with color support and progress reporting

Terminal logs now display colored output for error, warning, and notice messages to improve readability, with support enabled on Windows. The system respects the NO\_COLOR environment variable to disable colors when requested. Additionally, build progress is now reported via OSC 9;4 sequences, allowing compatible terminal emulators to show real-time progress indicators.

common/terminal · high confidence

File and directory ignore logic moved to source package

The logic for determining which files and directories Hugo should ignore (such as dotfiles, backup files ending in \~, and emacs temp files) has been consolidated into the \source\ package. The \source.SourceSpec\ now exposes an \IgnoreFile\ method that applies these patterns, and a new test suite in \source/content\_directory\_test.go\ verifies this behavior, ensuring consistent handling of hidden and temporary files across the source layer.

source · high confidence

File watcher now supports polling fallback and event batching

The file watcher in the server now includes a polling-based fallback mechanism for environments where native filesystem events (like inotify) are unavailable or exhausted, ensuring reliable change detection across all platforms. Additionally, file change events are now batched within a configurable time interval before being processed, which reduces the overhead of frequent rebuild triggers and improves performance during rapid file modifications.

watcher · high confidence

Goldmark Markdown processor replaces Blackfriday as the default engine

The site's Markdown rendering engine has been switched from Blackfriday to Goldmark. This change introduces support for modern Markdown features including strikethrough, task lists, definition lists, footnotes, and emoji. It also adds configurable auto-ID generation for headings (with GitHub-compatible and Blackfriday legacy strategies), enables attribute lists for blocks and code fences, and provides render hooks for links, images, headings, and code blocks. The Table of Contents now preserves formatting like strikethrough and emojis, and security is improved by excluding event attributes from rendered HTML.

markup/goldmark · high confidence

Goldmark becomes the default Markdown engine

Hugo now uses Goldmark as the default Markdown handler, replacing the previous Blackfriday engine. Users configuring their site to use the default Markdown processor will see their content rendered by Goldmark, which may result in differences in HTML output and feature support. If a site explicitly sets the default handler to 'blackfriday', Hugo will now return an error instructing the user to switch to 'goldmark', as Blackfriday has been removed.

markup · high confidence

Goldmark configuration defaults and options introduced

The new \markup/goldmark/goldmark\_config\ package establishes the default configuration for the Goldmark markdown processor. This includes enabling GitHub-compatible auto IDs for headings, setting linkify to use HTTPS by default, and configuring default behaviors for render hooks (images and links) to use embedded versions automatically. It also exposes configuration options for extensions such as typographer, footnotes (with auto-ID prefixing and custom backlink HTML), definition lists, tables, strikethrough, task lists, CJK line breaks, and the new Extras (delete, insert, mark, subscript, superscript) and Passthrough extensions.

_markup/goldmark/goldmark\config · high confidence

Hugo CLI restructured with new command framework and build tag support

The Hugo command-line interface has been restructured to use the simplecobra framework, introducing a new 'hugo build' alias for the default build command and moving the 'deploy' command behind a 'withdeploy' build tag (showing a clear error message when the tag is absent). The 'hugo config' command now supports a '--lang' flag to display configuration for specific languages and a '--printZero' flag to include zero-value settings in the output. Additionally, the 'hugo convert' command now includes an '--unsafe' flag to allow potentially less safe operations, and the 'hugo gen chromastyles' command has added '--classDark' and '--classLight' flags for customizing CSS class names in dark and light modes.

commands · high confidence

Hugo's template engine is replaced with a lightweight fork of Go's text/template

The internal template engine in \tpl/internal/go\_templates/texttemplate\ has been replaced with a lightweight fork of Go's standard library \text/template\ and \html/template\ packages. This change introduces Hugo-specific execution hooks (via \ExecHelper\ and \Preparer\ interfaces) to optimize function and map lookups, and adds support for the \return\ keyword to allow early exits from partials with optional values. The fork includes updated documentation, examples, and tests synchronized with recent Go versions, ensuring compatibility with modern Go template syntax while maintaining Hugo's custom behavior for template execution and error handling.

_tpl/internal/go\templates/texttemplate · high confidence

Improved error reporting with file context and line numbers

Hugo now provides significantly more detailed error messages for files like templates, configuration, and Sass. The new error handling system in common/herrors extracts line and column numbers from various error sources (YAML, templates, i18n) and attaches context, showing the specific line with the error along with surrounding lines. This makes debugging syntax errors, nil pointer dereferences, and other file-related issues much easier by pinpointing the exact location in the source file.

common/herrors · high confidence

Improved handling of .RenderShortcodes and raw HTML warnings

The Hugo context wrapper for Goldmark now correctly manages page context for .RenderShortcodes by stripping nested context markers, which fixes issues where context was leaked or lost when shortcodes were indented or rendered standalone. Additionally, the system now emits a warning when raw HTML is omitted during rendering, covering both block-level and inline HTML comments, while ensuring that unsafe HTML comments are not warned about when the unsafe flag is disabled.

markup/goldmark/hugocontext · high confidence

Improved jsconfig.json generation for editor IntelliSense

The jsconfig.json builder now excludes mappings for the current source root, ensuring that only external or mounted module paths are included in the generated configuration. This change prevents redundant or conflicting path mappings in editors like VS Code, improving IntelliSense accuracy for projects using mounted resources. The implementation also removes the deprecated \baseUrl\ setting, relying solely on the \paths\ configuration as recommended by TypeScript.

resources/jsconfig · high confidence

Improved numeric comparison and conversion accuracy in templates

The template engine now handles numeric comparisons and type conversions more precisely, preventing silent data loss or incorrect results. A new \CompareNumbers\ function allows exact comparison between integers, unsigned integers, and floats without first converting integers to float64, which avoids precision loss for large values. Additionally, the \ConvertIfPossible\ logic ensures that conversions between numeric types (e.g., from YAML's uint64 to Go int types) are lossless and respect overflow boundaries, fixing issues where YAML integers might not match expected Go int types.

common/hreflect · high confidence

Introduce case-insensitive string comparison for template operators

The compare package now implements case-insensitive lexicographic comparison for strings, ensuring that template operators like \ge\, \le\, and equality checks treat values such as "A" and "a" as equivalent. This change updates the underlying comparison logic to use fold-case semantics, which affects how strings are sorted and compared in Hugo templates, providing more predictable behavior for users dealing with mixed-case content.

compare · high confidence

Introduce configurable media type system with extended format support

The media package has been refactored to support a configurable media type system, allowing users to define custom MIME types and file suffixes via configuration. This change introduces built-in support for modern formats including WebP, AVIF, HEIF, and HEIC images, as well as WebAssembly, CSV, and Markdown content types. It also corrects the JavaScript MIME type from \application/javascript\ to the standard \text/javascript\ and expands the default suffix mappings for existing types like JPEG and HTML. Users can now customize how file extensions map to content types, enabling better handling of non-standard or proprietary file formats.

media · high confidence

Introduce consolidated file cache with corruption recovery and pruning

Hugo now uses a new consolidated file cache implementation for storing processed images, assets, and remote resources. This change introduces a dedicated cache root directory and a new pruning mechanism that removes expired or unused entries, while also handling file corruption by treating read errors as cache misses to ensure recovery. The cache configuration now supports a \:project\ placeholder for directory paths and enforces case-insensitive matching on Windows to prevent duplicate entries.

cache/filecache · high confidence

Introduce hstring.HTML type to prevent template recursion

A new \hstring.HTML\ type has been added to represent rendered HTML content. This type implements the \PrintableValueProvider\ interface, ensuring that when printed in templates, it is treated as \template.HTML\ and considered safe without requiring the \safeHTML\ pipe. This change is designed to prevent infinite recursion errors in template rendering, specifically addressing cases where the \linkify\ option is enabled alongside constructs like \{{ .Text \| .Page.RenderString }}\ in hook templates.

common/types/hstring · high confidence

JavaScript concatenation now includes safety barriers

When using the resources.Concat function to bundle multiple JavaScript files, Hugo now automatically inserts a newline and semicolon (\\n;\\n) between each file. This prevents syntax errors that could occur if the last line of one file and the first line of the next file were concatenated without a separator, ensuring that the resulting bundle is valid JavaScript.

_resources/resource\factories/bundler · high confidence

Language configuration and API modernization with locale-based keys

The language configuration system has been refactored to use \Locale\ (e.g., "en-US") as the primary identifier instead of the legacy \LanguageCode\, introducing new canonical fields \Label\, \Direction\, and \Locale\ in \LanguageConfig\ while deprecating \LanguageName\, \LanguageCode\, and \LanguageDirection\. This change updates the \Language\ struct to rely on these new fields with fallbacks to legacy values for backward compatibility, and enforces stricter validation by failing on invalid time zones and empty language names. Additionally, the \Language.Params\ method is deprecated in favor of \Site.Params\, and the underlying locale library has been upgraded to \golocales\ with CLDR v48.1 support to improve translation lookups and sorting.

langs · high confidence

Live reload script updated to v4.0.2 with improved navigation and stability

The embedded LiveReload JavaScript client has been upgraded to version 4.0.2, bringing better support for Hugo's internal navigation prefix (\_\_hugo\_navigate) to ensure correct page updates. The update also includes a fix to disconnect the WebSocket connection on page swaps, preventing flash issues during Chromium's speculative prerendering, and resolves a data race in the Go server's connection handling.

livereload · high confidence

Localized time formatting in Hugo templates

The \time.Format\ template function now correctly localizes month and weekday names (both full and abbreviated forms) based on the site's configured language. This change ensures that dates rendered in templates, such as \{{ .Date.Format "January 2, 2006" }}\, display in the user's language (e.g., "gennaio" for Italian, "juni" for Norwegian) rather than always using English names, while still supporting Hugo's custom layout prefixes like \:date\_full\.

common/htime · high confidence

Minification errors are now surfaced to the user

When minifying resources (such as HTML, CSS, or JavaScript), errors that occur during the minification process are now propagated to the user instead of being silently ignored. This ensures that issues like invalid syntax or unsupported features in the source content are reported, allowing for easier debugging and preventing broken output from being generated.

_resources/resource\transformers/minifier · high confidence

New Asciidoctor configuration options for TOC preservation and boolean attributes

The Asciidoctor integration now supports a \PreserveTOC\ configuration option, allowing users to keep the table of contents in the generated HTML output instead of removing it. Additionally, the configuration system has been updated to support boolean document attributes, providing finer control over how Asciidoctor processes content. These changes are defined in the new \asciidocext\_config\ package, which establishes the default settings and allowed values for backend, safe mode, and failure level.

_markup/asciidocext/asciidocext\config · high confidence

New centralized markup configuration with legacy migration support

Hugo introduces a new, unified configuration structure for markup settings, consolidating options for Goldmark, AsciiDoc, reStructuredText, syntax highlighting, and table of contents into a single \markup\ namespace. This change includes automatic migration logic for legacy Goldmark configuration formats: boolean values for the \typographer\ and \footnote\ extensions are now converted to their respective struct-based configurations to maintain compatibility with older site setups.

_markup/markup\config · high confidence

New centralized minification configuration with deprecation handling

The minifiers package now uses a dedicated \MinifyConfig\ struct to manage settings for HTML, CSS, JS, JSON, SVG, and XML, replacing the previous implicit configuration. This change introduces explicit control over minification behavior, including defaults like keeping HTML end tags and preserving specific SVG namespaces (e.g., \x-bind\). It also adds backward compatibility for deprecated configuration keys (\decimals\ → \precision\, \keepconditionalcomments\ → \keepspecialcomments\, \keepcss2\ → \version\), ensuring older Hugo configurations continue to work while warning users to update to the new keys by version v0.150.0.

minifiers · high confidence

The default HTML rendering for Markdown content has been updated with new embedded templates. Links and images now resolve relative paths using page resources and site resources, preserving query strings and fragments. Tables support custom attributes and cell alignment styling. Code blocks using the 'goat' language identifier render as SVG diagrams with optional width/height attributes.

_tpl/tplimpl/embedded/templates/\markup · high confidence

New frontmatter serialization and JSON key normalization logic

The parser now includes dedicated logic for serializing frontmatter and normalizing JSON output. The new frontmatter.go file implements InterfaceToFrontMatter and InterfaceToConfig, supporting YAML, TOML, JSON, and XML formats, with TOML output now using the go-toml/v2 library and XML using mxj/v2. Additionally, new JSON marshalling utilities (lowercase\_camel\_json.go) introduce behavior changes for JSON output: keys are automatically lowercased (preserving uppercase for HTTP-related keys), null boolean values for specific fields like 'enable' and 'lineNos' are converted to false, and empty/zero values can be omitted from JSON output while preserving intentionally empty maps.

parser · high confidence

New modular transform pipeline for HTML processing

Hugo now uses a new \transform\ package to process rendered content through a chain of steps. This change introduces a \transform.Chain\ that executes transformers sequentially, improving error handling by writing intermediate output to a temporary file on failure. Specific transformers now handle injecting the LiveReload script (placed robustly after the head tag), adding the Hugo generator meta tag (only if absent), and replacing relative URLs with absolute ones in HTML and XML (including srcset attributes).

transform · high confidence

New page parser implementation for content files

The \parser/pageparser\ package introduces a new lexer and parser for Hugo content files (Markdown, HTML, etc.), handling front matter (YAML, TOML, JSON, Org Mode), the \\<!--more--\>\ summary divider, and shortcode syntax (including nested shortcodes, inline shortcodes, and typed parameters). This replaces the previous parsing logic, providing a unified, state-machine-based approach to tokenizing page content.

parser/pageparser · high confidence

New resource argument resolution helpers

Added a new \helpers.go\ file in \tpl/internal/resourcehelpers\ containing utility functions \ResolveIfFirstArgIsString\ and \ResolveArgs\ to standardize how Hugo parses arguments for resource transformations. These helpers now handle mixed string/map inputs and provide clearer error messages when unsupported types are passed, improving the robustness of resource pipeline options.

tpl/internal/resourcehelpers · high confidence

New structured configuration system with directory-based loading and build stats

Hugo introduces a new configuration architecture that replaces the previous Viper-based system with a structured, type-safe approach. The default configuration file name is now hugo.toml (while still supporting config.toml for compatibility). Configuration can now be loaded from a /config directory, supporting environment-specific overrides (e.g., \_default/ and production/ subdirectories) and allowing multiple config files to be merged. The build configuration now includes a BuildStats struct that writes aggregated build data (CSS class names, IDs, tags) to hugo\_stats.json, replacing the previous boolean writeStats option. Cache buster patterns are now configurable via the build.cacheBusters array, with sensible defaults for Tailwind and PostCSS. The server configuration supports HTTP headers and redirects with regex matching. Environment variables HUGO\_NUMWORKERMULTIPLIER and HUGO\_MEMORYLIMIT control parallelism and memory limits. The configuration provider is now thread-safe and uses a new hmaps.Params structure for internal storage.

config · high confidence

Node.js tool execution hardened with permission model and ESM resolution fixes

Hugo now runs Node.js tools (like PostCSS, Babel, and TailwindCSS) using the Node.js --permission flag, restricting file system access to the project directory and configured allow-lists. To prevent symlink-based path escapes, Hugo scans allowed roots and fails if any symlink points outside the permitted paths. Additionally, a new ESM loader hook ensures that bare imports in ESM configuration files (e.g., postcss.config.js) correctly fall back to NODE\_PATH when Node's resolver encounters ERR\_ACCESS\_DENIED or ERR\_MODULE\_NOT\_FOUND, fixing issues with global installs and module caches.

common/hexec · high confidence

Preserve Blackfriday anchor generation logic

The markup/blackfriday package now includes a SanitizedAnchorName function that replicates the anchor name sanitization logic from the original Blackfriday v1 Markdown engine. This allows users to maintain consistent auto-generated ID behavior for headings when migrating away from the deprecated Blackfriday engine, ensuring that anchor links remain stable during the transition.

markup/blackfriday · high confidence

Redefine built-in templates for aliases, RSS, and sitemaps

The built-in templates for aliases, RSS feeds, and sitemaps have been rewritten to improve correctness and internationalization support. The alias template now includes the HTML lang attribute and a canonical link, while the RSS template explicitly supports author details and respects the configured item limit. Sitemap generation now utilizes AllTranslations to include hreflang alternate links for translated pages, and the sitemap index template has been updated to correctly reference sitemap absolute URLs.

tpl/tplimpl/embedded/templates · high confidence

Refactor page resource interfaces and introduce HugoInfo environment details

The page resource package has been restructured to expose the \Page\ type as an interface and introduce granular provider interfaces (such as \ContentProvider\, \MarkupProvider\, and \ChildCareProvider\) to decouple functionality. A new \HugoInfo\ struct has been added to \resources/page\ to centralize environment details, providing template-accessible methods like \IsDevelopment\, \IsProduction\, \IsServer\, and \WorkingDir\. Additionally, the legacy \Author\ and \AuthorList\ types have been deprecated in favor of taxonomies, and the \Data\ type now supports lazy loading of pages via function invocation.

resources/page · high confidence

Refactored filename filtering and glob matching in hugofs/hglob

The hugofs/hglob package has been refactored to improve how Hugo matches and filters filenames. A new FilenameFilter implementation (NewFilenameFilterV2) now handles inclusion and exclusion patterns using a unified approach, replacing the older separate inclusions/exclusions API. Glob matching is now case-insensitive by default and uses a caching mechanism via the hmaps package for performance. The underlying glob library has been upgraded from github.com/gobwas/glob v0.2.3 to v1.0.0, and the common/maps package has been renamed to common/hmaps, with corresponding updates to the glob caching logic.

hugofs/hglob · high confidence

Refactored image processing with new filters and codec support

The image processing subsystem has been restructured to support a more flexible filter chain and improved format handling. A new \AutoOrient\ filter automatically corrects image orientation based on EXIF data, while new filters for \Dither\, \Mask\, \Opacity\, \Overlay\, \Padding\, and \Text\ (with custom font and alignment support) provide advanced manipulation capabilities. The underlying codec has been updated to use WebP and AVIF encoding via WASM, enabling better compression and animation support, and the system now correctly handles JPEG/PNG extension mismatches by reading magic bytes. Additionally, global imaging configuration options like \quality\ and \hint\ are deprecated in favor of per-format settings.

resources/images · high confidence

Refactored menu system with dedicated navigation package and caching

The menu functionality has been reorganized into a dedicated navigation package, introducing a new menu cache to improve performance and unexporting internal menu entry methods. The URL resolution logic for menu items now prioritizes the connected Page's permalink over any explicitly configured URL, ensuring that menu items linked to pages always reflect the page's current path. Additionally, the system now supports custom parameters for menu entries defined in page front matter or site configuration, allowing for more flexible menu customization.

navigation · high confidence

Refactored page metadata handling with stricter date validation and new build config enums

The page metadata subsystem has been restructured to improve robustness and clarity. Front matter date handling now includes stricter validation, treating null dates as zero dates and supporting full datetime prefixes in filenames for automatic date extraction. The \BuildConfig\ for pages has shifted from boolean flags to explicit string enums (\never\, \always\, \local\ for listing; \never\, \always\, \link\ for rendering), ensuring deterministic behavior and better compatibility with content adapters. Additionally, the underlying reader logic for page content has been fixed to ensure each open operation returns an independent reader, preventing state corruption when multiple parts of the system access the same page content simultaneously.

resources/page/pagemeta · high confidence

Refactored resource handling and image processing internals

The resources package has been restructured to improve caching, metadata handling, and transformation logic. A new Artifact interface and Data.Artifacts field allow templates to access additional output files like source maps. Image processing now uses a unified Meta interface (with Exif deprecated) and supports color extraction via the $image.Colors method. The resource caching system has been enhanced with a new ImageCache and improved key generation to prevent duplicate publishing and handle multihost setups correctly. Additionally, a PostProcess mechanism enables post-build resource handling, and the internal key system now uses xxHash for more robust transformation identification.

resources · high confidence

Refactored time template functions into a standalone namespace package

The time template functions have been reorganized into a dedicated \tpl/time\ package that registers as a distinct \time\ namespace. This change introduces a new \time.In\ function to convert times to specific IANA time zones, adds \time.Duration\ and \time.ParseDuration\ for duration handling, and allows \time.AsTime\ to accept an optional location argument. The namespace also supports overlapping usage where calling \time\ with no arguments returns the namespace context, while passing arguments invokes \AsTime\. Existing aliases like \dateFormat\ and \now\ are preserved within this new structure, and locale-specific formatting (such as month abbreviations) is now handled via the configured language settings.

tpl/time · high confidence

Refined Markdown attribute handling for code blocks

The internal attribute processing logic has been updated to better distinguish between general Markdown attributes and specific options for the Chroma syntax highlighter. A new set of attributes (such as \hl\_inline\, \anchorLineNos\, and \style\) is now recognized as Chroma-specific options, allowing them to be passed directly to the highlighter while keeping general attributes separate. This change also ensures that code-fence attribute values are properly escaped in the default renderer to prevent HTML injection issues.

markup/internal/attributes · high confidence

Reimplemented collections template functions

The \tpl/collections\ package has been completely rewritten as a standalone package, introducing new implementations for core template functions such as \append\, \apply\, \complement\, \index\, and \merge\. This change brings improved type handling, better error messages, and performance optimizations (including stable sorting and caching) to collection operations like filtering, sorting, and merging in Hugo templates.

tpl/collections · high confidence

Reimplemented partials with caching, return support, and recursion detection

The \tpl/partials\ package has been rewritten to introduce a new caching mechanism for \partialCached\ that ensures each cached partial is invoked only once per request, preventing redundant execution and resolving previous deadlock issues. The \partial\ and \partialCached\ functions now support returning values via the \{{ return }}\ keyword, allowing partials to act as decorators or value providers rather than just rendering output. Additionally, the system now detects and fails on infinite template recursion to prevent hangs, and warns users about superfluous \partials/\ prefixes in template names. The cache is automatically flushed on rebuilds, and metrics tracking has been added to monitor partial usage and performance.

tpl/partials · high confidence

Reimplemented template system with new lookup logic and embedded templates

The template engine has been completely rewritten to support both text and HTML templates, introducing a new \TemplateDescriptor\ for precise layout matching and a \TemplateStore\ that manages embedded templates (such as Disqus, Google Analytics, OpenGraph, and various shortcodes) alongside user-defined layouts. This change brings a new template versioning scheme (v2), legacy layout mapping support for older site structures, and updated integration tests verifying the new behavior for render hooks, shortcodes, and template resolution.

tpl/tplimpl · high confidence

Replaced legacy logging with structured, handler-based logging

The logging system in common/loggers has been completely rewritten to use the structured logging library github.com/bep/logg. This change introduces a new handler architecture (default, terminal, and miscellaneous handlers) that manages log output, ANSI color stripping, and message deduplication. For users, this means log output is now structured, supports distinct-level filtering to prevent duplicate warnings/errors, and includes improved handling of terminal output such as stripping ANSI escape codes from error logs.

common/loggers · high confidence

Shortcode templates updated with deprecations, removals, and new features

Embedded shortcode templates have been updated to reflect several changes. The \gist\, \twitter\, \tweet\, \twitter\_simple\, and \instagram\_simple\ shortcodes now throw errors indicating they were removed in v0.156.0 (or v0.123.0 for instagram\_simple), directing users to use \x\ or \instagram\ instead. The \comment\ shortcode now warns that it was deprecated in v0.143.0. New or updated shortcodes include \details\ (rendering an HTML details element), \figure\ (with improved resource handling), \param\, \qr\ (generating QR codes), \ref\, and \relref\. The \vimeo\ shortcode now correctly handles the \allowFullScreen\ option, and the \youtube\ shortcode includes updated iframe attributes like \referrerpolicy\. The \x\ shortcode is now the supported way to embed X (Twitter) posts.

_tpl/tplimpl/embedded/templates/\shortcodes · high confidence

Standardize behavior when external Asciidoctor converter is missing

The Asciidoctor integration in \markup/asciidocext/internal\ now explicitly checks for the presence of the \asciidoctor\ binary before attempting conversion. If the binary is not found in the system PATH, the converter returns a clear error message indicating that rendering cannot proceed, rather than failing silently or with an ambiguous error. This ensures users are immediately aware of missing dependencies when using external converters.

markup/asciidocext/internal · high confidence

Sync internal Go template parser to Go 1.22.5

The internal Go template parser in \tpl/internal/go\_templates/texttemplate/parse\ has been synchronized with the Go 1.22.5 source code. This update brings the latest fixes and behavioral changes from the standard library's \text/template\ and \html/template\ packages into the project's forked implementation, ensuring compatibility with recent Go template syntax and parsing rules.

_tpl/internal/go\templates/texttemplate/parse · high confidence

Sync internal HTML template engine to Go 1.26.3

The internal HTML template engine in \tpl/internal/go\_templates/htmltemplate\ has been synchronized with the Go standard library version 1.26.3. This update brings the latest security hardening and bug fixes from upstream Go, including improved context-aware escaping for HTML, CSS, JavaScript, and URL contexts, as well as refined handling of attribute types and template cloning behaviors.

_tpl/internal/go\templates/htmltemplate · high confidence

Table of Contents now exposes heading levels and escapes HTML in IDs

The Table of Contents API now includes the numeric level for each heading, accessible via the new \Level\ field on the \Heading\ struct (e.g., \.Fragments.HeadingsMap\), allowing templates to filter or display headings by depth. Additionally, the \ToHTML\ method now properly escapes special characters in heading IDs to prevent HTML injection, and the function arguments for start/stop levels are strictly cast to integers, returning a clear error if invalid types are passed.

markup/tableofcontents · high confidence

Unified services configuration section

Hugo now consolidates configuration for integrated services (Disqus, Google Analytics, Instagram, X/Twitter, and RSS) into a single \[services\] section in the config file. This change introduces a structured config type that supports both the new nested format and backward compatibility with legacy root-level keys (e.g., googleAnalytics, disqusShortname), ensuring existing configurations continue to work while providing a cleaner, unified namespace for future service integrations.

config/services · high confidence

Updated forked Go template packages to Go 1.27

The internal fork of Go's text/template and html/template packages has been synchronized with the Go 1.27 source code. This update brings the latest upstream template engine improvements and bug fixes to Hugo, ensuring that template parsing and execution behavior aligns with the Go 1.27 standard library while maintaining Hugo-specific customizations and patches.

_scripts/fork\_go\templates · high confidence

Updated internal Go template test environment utilities

The internal test environment package for Go templates (tpl/internal/go\_templates/testenv) has been synchronized with upstream Go source code. This update introduces modernized helper functions for test execution, including improved subprocess management with better timeout and grace period handling, platform-specific checks for executable support and symlink capabilities, and environment cleaning to prevent test interference from variables like GODEBUG. These changes ensure that template tests run more reliably across different operating systems and build configurations.

_tpl/internal/go\templates/testenv · high confidence

i18n subsystem restructured with go-i18n v2 and improved fallback logic

The internationalization system has been upgraded to use go-i18n v2, introducing support for YAML translation files alongside TOML and JSON. Translation lookup now prioritizes the site's default content language over English when a specific language bundle is missing, and correctly handles language variants (e.g., preferring \en-us\ over \en\). The implementation also fixes pluralization handling for floats and integers, resolves case-sensitivity issues in language codes, and adds validation for reserved keys in translation files.

langs/i18n · high confidence

Fixes

Fix .WordCount, .FuzzyWordCount, and .ReadingTime when summary marker is set

The .WordCount, .FuzzyWordCount, and .ReadingTime page variables now correctly calculate metrics based on the full page content, even when a manual summary is defined using the \<!--more--\> marker. Previously, these metrics were incorrectly calculated against the truncated summary content, leading to inaccurate statistics in templates.

hugolib · high confidence

Test coverage

Added HTML template test fixtures for template definition and inclusion; Added test data assets for image processing tests; Added test fixtures for resource handling and content parsing; Added test helper utilities and their tests; Added tests for predicate filtering and range operators; Added tests for version parsing and comparison logic; New assertion helpers for quicktest-based testing; New golden image testing infrastructure for image processing; New test configuration helper package.

Dependencies

Upgrade to Go 1.27 and update dependencies

The project now requires Go 1.27 to build, as reflected in the updated go.mod file. This change includes a comprehensive update of dependencies, such as esbuild to v0.28.2, goldmark to v1.8.6, and Chroma to v2.27.0, ensuring the latest features and security patches are utilized.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 48 → 48 (-0.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 36 → 35 (-1.8)
  • Architecture 73 → 73 (-0.0)
  • Maturity 59 → 68 (+8.1)
  • Readiness 51 → 46 (-4.6)
  • Security 67 → 65 (-2.1)
  • Accessibility 73 → 88 (+14.8)
  • Performance 77 → 95 (+18.3)

Resolved (26)

  • Duplicated block (12–13 lines × 2) (resources/resource_transformers/tocss/dartsass/transform.go)
  • Duplicated block (23 lines × 2) (tpl/css/css.go)
  • Duplicated block (5 lines × 2) (hugolib/integrationtest_builder.go)
  • Duplicated block (7 lines × 2) (markup/pandoc/convert.go)
  • High IaC: DS-0025 (Dockerfile)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Hotspot: hugolib/hugo_sites_build.go (hugolib/hugo_sites_build.go)
  • Hotspot: internal/js/esbuild/resolve.go (internal/js/esbuild/resolve.go)
  • Hotspot: markup/highlight/chromastyles.go (markup/highlight/chromastyles.go)
  • Hotspot: tpl/partials/partials.go (tpl/partials/partials.go)
  • Namespace.Sass (cognitive 20) (tpl/css/css.go)
  • No ADRs found
  • Off-boarding risk: anonymized user #1
  • Off-boarding risk: anonymized user #2
  • Orphaned file (tpl/strings/truncate.go)
  • Outdated: github.com/getkin/kin-openapi
  • Outdated: github.com/spf13/fsync
  • Outdated: github.com/tdewolff/minify/v2
  • Outdated: github.com/tdewolff/parse/v2
  • …and 6 more

New (94)

  • ClassTooLong: collector (modules/collect.go)
  • Duplicated block (16 lines × 3) (tpl/css/css.go)
  • Duplicated block (17–18 lines × 2) (navigation/menu_cache.go)
  • Duplicated block (23 lines × 2) (tpl/css/css.go)
  • Duplicated block (5 lines × 2) (hugolib/integrationtest_builder.go)
  • Duplicated block (7 lines × 2) (markup/pandoc/convert.go)
  • Edited copies of one member (3 members, 14+ corresponding lines) (hugolib/roles/roles.go)
  • Edited copies of one member (3 members, 14+ corresponding lines) (tpl/hugo/init.go)
  • Edited copies of one member (3 members, 15+ corresponding lines) (cache/filecache/filecache.go)
  • Edited copies of one member (3 members, 15+ corresponding lines) (hugolib/hugo_sites.go)
  • Edited copies of one member (3 members, 18+ corresponding lines) (hugolib/hugo_sites.go)
  • Edited copies of one member (3 members, 18+ corresponding lines) (resources/page/pagegroup.go)
  • Edited copies of one member (3 members, 24+ corresponding lines) (internal/js/esbuild/batch.go)
  • Edited copies of one member (3 members, 41+ corresponding lines) (markup/goldmark/render_hooks.go)
  • Edited copies of one member (3 members, 6+ corresponding lines) (hugolib/roles/roles.go)
  • Edited copies of one member (3 members, 7+ corresponding lines) (common/collections/slice.go)
  • Edited copies of one member (3 members, 7+ corresponding lines) (common/paths/pathparser.go)
  • Edited copies of one member (3 members, 9+ corresponding lines) (hugolib/integrationtest_builder.go)
  • Edited copies of one member (4 members, 10+ corresponding lines) (hugolib/doctree/simpletree.go)
  • Edited copy of a member (10 corresponding lines) (common/hreflect/helpers.go)
  • …and 74 more

Changes since last survey

  • 53 commits — 40 feature/other, 13 fixes

By area

  • (root) — 19 commits
  • internal/warpc — 4 commits
  • tpl/collections — 3 commits
  • .github/workflows — 2 commits
  • langs/i18n — 2 commits
  • markup/goldmark — 2 commits
  • tpl/tplimpl — 2 commits
  • .circleci/config.yml — 1 commit
  • common/constants — 1 commit
  • common/hexec — 1 commit
  • common/htime — 1 commit
  • common/hugo — 1 commit
  • config/allconfig — 1 commit
  • hugofs/glob.go — 1 commit
  • hugolib/hugo_sites_build.go — 1 commit
  • hugolib/integrationtest_builder.go — 1 commit
  • markup/highlight — 1 commit
  • resources/images — 1 commit
  • resources/page — 1 commit
  • resources/resource_factories — 1 commit

Notable commits

  • fix: Adjust Exif test to fix now failing deprecation tests
  • fix: Fix misc layout lookup issues
  • fix: ci: Revert to plain go install honnef.co/go/tools/cmd/staticcheck@latest
  • fix: hugolib: Fix template change detection when saving via temp file and rename
  • fix: js: Fix js.Build with browser-disabled extensionless requires
  • fix: langs/i18n: Fix project translations losing to module translations
  • fix: markup/goldmark: Fix auto heading ID when link text starts with a bracket
  • fix: tpl/collections: Fix merge of maps with concrete element types
  • fix: tpl/collections: Fix sort when some items lack the sort key
  • fix: tpl/tplimpl: Fix shortcode layout lookup in non-default output formats
  • fix: urls: Fix JoinPath panic with empty slice
  • fix: warpc, commands: Fix Close of image dispatchers, recover in fast render
  • fix: warpc: Fix AVIF encode crashing at encoderSpeed 6 and lower
  • change: Fix typo in AGENTS.md
  • change: Redirect .Params.title etc. to .Title etc. and deprecate it
  • change: Remove libsass and the extended build tag
  • change: Remove the extended build from the release
  • change: Skip content check for static files with the same size and modification time
  • change: Update README.md
  • change: Upgrade to Go 1.27.4
  • …and 33 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

gohugoio/hugo was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 4f8354ebf0f60d05e44147e6c4ecb7e63e891f04 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-b8b1a43ae4c3.