From 8ae8136b8a70aee8bbf41d9acfcc0633c23bc2d2 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 7 Aug 2024 08:13:56 -1000 Subject: [PATCH] Layouts: Clean up doc comment for script partial --- layouts/partials/resource_builders/script.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/layouts/partials/resource_builders/script.html b/layouts/partials/resource_builders/script.html index b8bae29..a899a44 100644 --- a/layouts/partials/resource_builders/script.html +++ b/layouts/partials/resource_builders/script.html @@ -1,6 +1,20 @@ -{{- $isModule := .module -}} +{{- /* + +Emit an HTML script element referring to a JavaScript resource. The resource can +be either a path or a Hugo Resource object. If the former, the resource will be +looked up and built. + +@context {string|Resource} resource + The Resource +@context {bool} isModule + If true, add information to the script element indicating it should be loaded + as a module + +*/ -}} {{- $resource := .resource -}} +{{- $isModule := .module -}} + {{ if $resource.resource }} {{ $resource = partial "resource_builders/build_js.html" $resource }} {{ end }}