hugo/docs/content/en/hugo-pipes/bundling.md
2023-05-22 16:47:07 +02:00

23 lines
695 B
Markdown
Executable file

---
title: Concat
linkTitle: Concatenating assets
description: Bundle any number of assets into one resource.
categories: [asset management]
keywords: []
menu:
docs:
parent: pipes
weight: 60
weight: 60
signature: ["resources.Concat TARGET_PATH SLICE_RESOURCES"]
---
## Usage
Asset files of the same MIME type can be bundled into one resource using `resources.Concat` which takes two arguments, the target path for the created resource bundle and a slice of resource objects to be concatenated.
```go-html-template
{{ $plugins := resources.Get "js/plugins.js" }}
{{ $global := resources.Get "js/global.js" }}
{{ $js := slice $plugins $global | resources.Concat "js/bundle.js" }}
```