Skip to content

markup/asciidocext: Implement diagram caching #14160

@jmooring

Description

@jmooring

The v3.1.0 release of the asciidoctor-diagram extension introduced the ability to cache generated image files in addition to the existing metadata files.

To make this work in a Hugo context, we need to:

  1. Set the diagram-cache-images-option document attribute to true
  2. Set the diagram-cachedir document attribute to a path outside of the publishDir

Implementation details:

  1. The diagram-cache-images-option attribute will be hardcoded to true. Caching metadata files without caching image files defeats the purpose of caching when building a site. To disable caching entirely (both image and metadata files), users should set the diagram-nocache-option document attribute to true.
  2. The the diagram-cachedir attribute will be set to the compiled value of the caches.misc.dir setting in the site config, normalized for the current OS.
  3. Users will be warned if they attempt to override either diagram-cache-images-option or diagram-cachedir in the site config.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions