IG metadata → Liquid variables

Scan the Publisher’s output/ for {ResourceType}-{id}.json and emit a Liquid include assigning smart__<ResourceType>__<id>__<category>__<key> for each published resource.

Skills it satisfies

A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.

dak-postprocessing

What the DAK post-processing phase produces after the IG Publisher runs — the JSON/JSON-LD surface, the DAK API hub, and the metadata-to-Liquid bridge — and how an IG repository’s own site gets the same sidecars from the cached AST (ig-site:sidecars). Read before changing a post-processing step, and before assuming the Publisher produced something it did not.

Source: smart-base/L3/skills/smart-l3/dak-postprocessing.md.

Also satisfied by: dak-api-hub.

The skill declares no I/O contract (schemas/skills/dak-postprocessing/{input,output}.schema.json).

Inputs and outputs

Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.

porttyperequireddescriptionconstraint
inigOutputRepoPathyesThe Publisher’s output/, the script’s source of truth.string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments.
inigRootRepoPathRepository root, where input/ lives. Defaults to ..string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments.
outincludeRepoPathinput/includes/smart.liquid, copied to output/smart.liquid.string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments.
outcategoriesTexturl__canonical, url__page, url__json, text__display, link__html, elements__<key>.string · A short single-line human string. Not admissible as a command-line argument.

Processes and tasks

Steps this Tool can carry out, because each names a skill it satisfies:

processsteplanevia skill
SMART Guideline end to end4 · Create / adapt L2 DAK assetsAuthoring agentdak-postprocessing

How it is deployed and reached

  • Command line. From the repository root: python3 input/scripts/generate_smart_liquid.py.
  • GitHub Actions. No workflow in this checkout runs its command.

As an API: its operation in the OpenAPI document and the MCP tool list of its layer.

installnone
runtimepython3
networkno
when to choose it
whenPage content needs to reference a published resource by canonical URL, page URL, download URL or display label without hard-coding it.
limitsThe documentation page it writes, input/pagecontent/smart.liquid.md, is only processed by the NEXT build, so the script also writes output/smart.liquid.html directly; a surface that takes two builds to converge cannot support an incremental staging loop. Ids are normalised by replacing every non-alphanumeric character with _, so ids differing only in punctuation collide into one variable.
costSeconds. Recomputed from scratch on every run; no delta path.

What it is made of

rolefile
scriptinput/scripts/generate_smart_liquid.pynot in this checkout

Linked data

The Tool is published as its own JSON-LD document at its IRI, http://smart.who.int/base/tools/smart-liquid-variables.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.

{
  "@context": "http://smart.who.int/base/smart-base.context.jsonld",
  "@id": "http://smart.who.int/base/tools/smart-liquid-variables.jsonld",
  "@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
  "partOf": "http://smart.who.int/base/smart-base.jsonld",
  "name": "smart-liquid-variables",
  "title": "IG metadata → Liquid variables",
  "description": "Scan the Publisher's `output/` for `{ResourceType}-{id}.json` and emit a Liquid include assigning `smart__<ResourceType>__<id>__<category>__<key>` for each published resource.",
  "install": {
    "none": true
  },
  "invoke": {
    "shell": "python3 input/scripts/generate_smart_liquid.py"
  },
  "io": {
    "inputs": [
      {
        "name": "igOutput",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
        "description": "The Publisher's `output/`, the script's source of truth.",
        "required": true
      },
      {
        "name": "igRoot",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
        "description": "Repository root, where `input/` lives. Defaults to `.`.",
        "required": false
      }
    ],
    "outputs": [
      {
        "name": "include",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
        "description": "`input/includes/smart.liquid`, copied to `output/smart.liquid`."
      },
      {
        "name": "categories",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Text",
        "description": "`url__canonical`, `url__page`, `url__json`, `text__display`, `link__html`, `elements__<key>`."
      }
    ]
  },
  "satisfies": [
    "dak-postprocessing"
  ],
  "requirements": {
    "runtime": [
      "python3"
    ],
    "network": false
  },
  "selection": {
    "when": "Page content needs to reference a published resource by canonical URL, page URL, download URL or display label without hard-coding it.",
    "limits": "The documentation page it writes, `input/pagecontent/smart.liquid.md`, is only processed by the NEXT build, so the script also writes `output/smart.liquid.html` directly; a surface that takes two builds to converge cannot support an incremental staging loop. Ids are normalised by replacing every non-alphanumeric character with `_`, so ids differing only in punctuation collide into one variable.",
    "cost": "Seconds. Recomputed from scratch on every run; no delta path."
  }
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev