mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '35dec7c96f7ee3eb17dd444f7067f0c776fb56ae'
This commit is contained in:
21
docs/content/en/functions/resources/Concat.md
Normal file
21
docs/content/en/functions/resources/Concat.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: resources.Concat
|
||||
description: Concatenates a slice of resources.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
aliases: []
|
||||
related: []
|
||||
returnType: resource.Resource
|
||||
signatures: ['resources.Concat TARGETPATH [RESOURCE...]']
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $plugins := resources.Get "js/plugins.js" }}
|
||||
{{ $global := resources.Get "js/global.js" }}
|
||||
{{ $js := slice $plugins $global | resources.Concat "js/bundle.js" }}
|
||||
```
|
||||
|
||||
Asset files of the same [media type] can be bundled into one resource using the `resources.Concat` function which takes two arguments, the target path for the created resource bundle and a slice of resource objects to be concatenated.
|
||||
|
||||
[media type]: https://en.wikipedia.org/wiki/Media_type
|
Reference in New Issue
Block a user