mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '87de22d7464e239c775fbd48ebce1665d5b1e80d'
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
---
|
||||
title: FromString
|
||||
linkTitle: Resource from String
|
||||
linkTitle: Resource from string
|
||||
description: Creates a resource from a string.
|
||||
categories: [asset management]
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: pipes
|
||||
weight: 90
|
||||
weight: 90
|
||||
parent: hugo-pipes
|
||||
weight: 110
|
||||
weight: 110
|
||||
signature: ["resources.FromString TARGET_PATH CONTENT"]
|
||||
---
|
||||
|
||||
@@ -16,6 +16,8 @@ signature: ["resources.FromString TARGET_PATH CONTENT"]
|
||||
|
||||
It is possible to create a resource directly from the template using `resources.FromString` which takes two arguments, the target path for the created resource and the given content string.
|
||||
|
||||
The result is cached using the target path as the cache key.
|
||||
|
||||
The following example creates a resource file containing localized variables for every project's languages.
|
||||
|
||||
```go-html-template
|
||||
|
Reference in New Issue
Block a user