-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Expected Behavior
If I have a call to the resource_link shortcode in my content, i.e. ({{% resource_link "f6e70b41-9390-494c-a569-f825b3faa01e" "Inspiration" %}}), a link (a tag) should be generated with the text passed in the second argument.
Current Behavior
An error is thrown:
Error: error building site: assemble: "/tmp/build/ed66b15e/site-content-git/content/pages/image-galleries/jewelry-gallery.md:1:1": got positional parameter 'f6e70b41-9390-494c-a569-f825b3faa01e'. Cannot mix named and positional parameters
Steps to Reproduce
- Clone an existing content repo or make a new one
- Find a page or resource under the
contentfolder and note its UUID - On another page, link to it using the
resource_linkshortcode, passing the UUID in as the first argument and a title in as the second
Possible Solution
Pull out the expected arguments from .Params and set them explicitly when calling external_resource_link, rather than using merge
Additional Details
There is a method on shortcodes called .IsNamedParams (https://gohugo.io/templates/shortcode-templates/#isnamedparams) that can check if the shortcode has had named params passed to it. This may be helpful. I did my testing with 21m.715-fall-2009 after running the link_to_external_resource and nav_item_to_external_resource management commands in ocw-studio.